Quickstart: Build Your First Workflow

Welcome to WaveAssist! There are two ways to get started:

  1. Use a Template: Get started instantly with our pre-built templates like GitZoid for AI-powered PR reviews.
  2. Build from Scratch: Follow this guide to create a simple workflow that generates a daily fortune.

Option 1: Deploy a Template

  1. Visit our Templates section
  2. Choose a template that fits your needs
  3. Click the “Deploy with WaveAssist” button
  4. Follow the template-specific setup instructions

Option 2: Build a Simple Workflow

Goal: Create a workflow that:

  1. Randomly selects a fortune.
  2. Logs the fortune to the console.

Step 1: Create a New Project

  1. Log in to the WaveAssist Dashboard.
  2. Click the Add Project button.
  3. Fill in the project details:
    • Project Name: Daily Fortune
    • Project Key: daily-fortune (A unique identifier used for project-wide activities and API integrations.)
  4. Click Create.

Create a New Project

  1. Go inside your project and download your keys to use for next steps.

    Download Keys


Step 2: Add a Node to Choose a Fortune

Nodes are Python scripts that represent tasks in your workflow. Let’s create a node to randomly select a fortune.

  1. Open your project and click Add Node.
  2. Fill in the node details:
    • Node Name: Choose Fortune
    • Enabled: ‘Enabled’
    • Starting Node: Check this box to make it the starting node of the workflow.
    • Interval: Cron to run it every morning at 8:30 am of your timezone.

Create and Edit Node

  1. Click Save, and then click on View Code.

  2. Paste the following code into the editor: Dont forget to replace your uid in the code - download by clicking on Download Keys

# Import the WaveAssist SDK to interact with your project
import waveassist

# Initialize the WaveAssist client with your unique project UID and name
# Replace <your-uid-here> with your actual UID
waveassist.init('<your-uid-here>', 'daily-fortune')

# Define a list of fortune messages to be stored
fortunes = [
    "Today is your lucky day!",
    "Curiosity leads to breakthroughs.",
    "Take a deep breath and smile.",
    "Be bold. Fortune favors the brave!",
    "Patience is a virtue.",
    "Every day is a fresh start."
]

# Store the list of fortunes in WaveAssist’s data storage under the key 'fortunes'
waveassist.store_data('fortunes', fortunes)

# Print confirmation with the stored fortunes
print("Stored Fortunes:", fortunes)

Step 3: Add another Node to Log the Fortune

Now, let’s create another node to log the fortune.

  1. Click Add Node again.
  2. Fill in the node details:
    • Node Name: Log Fortune
    • Enabled: ‘Enabled’
    • Run After Nodes: Select Choose Fortune from the list to ensure this node runs after the Choose Fortune node.

      Log Fortune Node

  3. Click Save, and then click on View Code. Paste the following code into the editor:
import waveassist
import random

# Initialize the WaveAssist client using your project UID and name
# Replace <your-uid-here> with your actual UID
waveassist.init('<your-uid-here>', 'daily-fortune')

# Fetch the list of stored fortunes from WaveAssist's data storage
fortunes = waveassist.fetch_data('fortunes')

# Select a random fortune for today
today_fortune = random.choice(fortunes)

# Display the selected fortune
print("Your fortune for today:", today_fortune)

# Save for future work
waveassist.store_data('today_fortune',today_fortune)
  1. Click Save.

Step 4: Run the Workflow

  1. Once the nodes are created, press the Play button on the Starting Node from the project dashboard.

    Log Fortune Node

  2. Open the Logs section to see the output.

You should see something like this:

Your fortune for today: Today is your lucky day!

Workflow Log Output


Step 5: Deploy the Workflow

To ensure your workflow runs every day at the scheduled time, you must deploy it.

  1. Click on the Deploy button in the project dashboard. Enter version code and deploy.

    Deploy

  2. Navigate to the Deployments section to verify that your workflow is successfully deployed.

    Deployments

Now your code will auto run every day as the cron schedule and print your fortune!🎉

Want this fortune to be mailed you you everyday, follow along to the next section to expand the project to receive daily fortune emails!


What’s Next?

Want to expand your project? Here are some ideas:

  • Send the fortune via email: Use the WaveAssist email integration.
  • Post to Slack: Connect your workflow to Slack.
  • Add logic: Categorize fortunes as funny, motivational, or serious.
  • Generate fortunes with AI: Use OpenAI to create dynamic fortunes.

Check out the full guide: Expand Your Fortune Project →

Expand Your Fortune Project

Enhance your fortune project to receive daily fortune emails directly in your inbox!


💡 Want more examples? Visit WaveAssist GitHub Repository for inspiration.