Skip to main content

Quickstart: Build Your First Flow in 5 Minutes

In this tutorial, you'll create a simple flow that runs automatically every minute. This will teach you the basics of Staqr's automation engine.

What you'll learn:

  • How to create a flow
  • What triggers and actions are
  • How to test flows
  • How to view execution logs

Time: 5 minutes Prerequisites: Staqr account (any role with Flows access)

What is a Flow?

A Flow is an automated workflow consisting of a trigger (what starts it) and actions (what it does). Learn more in Building Flows.


What We'll Build

A simple flow that:

  • Trigger: Runs automatically every 1 minute (schedule trigger)
  • Action: Logs "Hello from Staqr!" to the execution log

This is the simplest possible flow, but it teaches the core concepts you'll use for complex automations.


Step 1: Navigate to Flows

  1. Click Flows in the left navigation rail
  2. You'll see the Flows page (may be empty if you haven't created any flows yet)

What you see:

  • Flow list (empty or showing existing flows)
  • "Create Flow" button in the top right
  • Folders sidebar (for organizing flows)

Step 2: Create a New Flow

  1. Click the "Create Flow" button (top right)
  2. The Flow Builder opens with an empty canvas

What you see:

  • Empty flow canvas
  • "Add trigger" placeholder (flows must start with a trigger)
  • Toolbar with Save, Test, and Publish buttons

Step 3: Add a Schedule Trigger

A trigger is what starts your flow. We'll use a Schedule trigger to run automatically.

  1. Click "Select Trigger" or the trigger placeholder
  2. In the trigger panel, search for and select "Schedule"
  3. In the schedule configuration:
    • Cron expression: */1 * * * * (runs every 1 minute)
    • Or use the visual builder if available
  4. Click Save or confirm the trigger
Cron Expressions

*/1 * * * * means "every 1 minute". The five fields are: minute, hour, day of month, month, day of week. Learn more about schedule triggers.

What you did: You configured the flow to run automatically every minute. The flow will keep running on this schedule until you disable it.


Step 4: Add a Code Action

An action is what your flow does when triggered. We'll use a Code action to log a message.

  1. Click "+" or "Add action" below the trigger
  2. Search for and select "Code" from the action types
  3. In the code editor, enter:
console.log("Hello from Staqr!");
return { message: "Success!", timestamp: new Date().toISOString() };
  1. Click Save to confirm the action

What you did: You created a simple JavaScript function that logs a message. When the flow runs, this code executes and returns a result.

Code Actions

Code actions run in a secure sandbox. You can use JavaScript to transform data, call APIs, or perform any logic your automation needs.


Step 5: Test Your Flow

Now let's test the flow to see it in action.

  1. Click the "Test" button (usually in the top toolbar)
  2. The flow executes immediately (doesn't wait for the schedule)
  3. You'll see the execution results with your message!

What you see:

  • Execution status: Success (green checkmark)
  • Trigger output (execution timestamp)
  • Action output with your logged message and returned data
  • Execution time (usually under 1 second)

Congratulations! Your first flow works!


Step 6: View Flow Runs (Optional)

Your flow is now running automatically every minute. Let's check the execution history.

  1. Navigate to "Flow Runs" in the left navigation (or click the runs tab in the flow builder)
  2. You'll see a list of all flow executions
  3. Click on any run to see detailed logs

What you see:

  • List of executions with timestamps
  • Status indicator (Success/Failed)
  • Execution duration
  • Click any run to see full input/output logs

Clean Up (Optional)

Your flow will continue running every minute. To stop it:

Option A: Disable the flow

  1. Go back to the Flows page
  2. Find your flow in the list
  3. Toggle the Enabled switch to Off (or use the context menu)

Option B: Delete the flow

  1. Open the flow in Flow Builder
  2. Click the delete option (usually in a menu or settings)

What You Learned

  • Flows are automated workflows with triggers and actions
  • Triggers start flows (schedule, webhook, or event-based)
  • Actions do the work (code execution, integrations, API calls)
  • Testing runs flows immediately for debugging
  • Flow Runs show execution history and detailed logs

Next Steps

Now that you've built your first flow, explore more capabilities:

Beginner

Intermediate

Advanced


Prefer Visual API Testing?

If you'd rather test APIs using a GUI instead of the Flow Builder, download our Postman Collections. They let you call Staqr and Commerce APIs interactively without writing code - perfect for support engineers, sales demos, and API exploration.

👉 Download Postman Collections


Troubleshooting

Flow doesn't run automatically:

  • Verify the flow is Enabled (check the toggle switch)
  • Confirm the schedule trigger cron expression is valid
  • Check Flow Runs for any error logs

Code action fails:

  • Check for JavaScript syntax errors in your code
  • Ensure you have a return statement
  • View the execution log for detailed error messages

Can't find Flows in navigation:

  • Your user role may not have Flows permission
  • Contact your administrator for access

Test button doesn't work:

  • Ensure the flow has a valid trigger configured
  • Save any pending changes before testing

Need Help?


Next: Continue with more advanced tutorials or explore the documentation for your specific role (Administrator, Developer, DevOps).