Skip to main content
Flow control actions allow you to manage the execution order and concurrency of your workflow. The parallel action enables you to run multiple action branches at the same time, improving performance when tasks are independent.

parallel

Executes multiple action branches simultaneously. Each branch runs independently and can have its own chain of subsequent actions.

Steps

A list of action steps to execute in parallel. Each step is a reference to another action in the workflow. Each step follows the format action.action_id where action_id is the identifier of another action in your workflow.

Stop On Failure

Whether to stop all parallel branches when any branch fails. When true, remaining branches are cancelled on the first failure. Setting this to false allows all branches to complete even if some fail, useful when you want partial results.

Examples

Fetch Multiple Data Sources

Retrieve data from multiple tables simultaneously:
After the parallel action completes, you can access results from each branch using their action IDs:
  • {{ .fetch_users }} — Results from the users query
  • {{ .fetch_orders }} — Results from the orders query
  • {{ .fetch_products }} — Results from the products query

Parallel API Calls

Call multiple external APIs at the same time:

Parallel with Chained Actions

Each parallel branch can have its own chain of subsequent actions:

Graceful Degradation

Allow partial failures to continue the workflow:

Best Practices

Independent Operations: Only use parallel for actions that don’t depend on each other’s results. If action B needs the result of action A, they must run sequentially.
Error Handling: Set stopOnFailure: false when some branches are optional and you want the workflow to continue even if they fail.
Rate Limits: Be mindful of rate limits when making parallel API calls to the same external service. You may need to implement throttling or use sequential processing instead.

Next Steps

Data Operations

Learn about fetching and storing data from databases.

HTTP Requests

Make parallel calls to external APIs.

Transformation

Combine and transform parallel results with JavaScript.

Actions Overview

Learn the fundamentals of actions in ServFlow.