Skip to main content
When your workflow needs to perform several independent operations — like fetching a user profile, their subscription, and their settings — there’s no reason to do them one at a time. OpenWorkflow lets you run steps in parallel using JavaScript’s built-in Promise.all, keeping full durability for each step.

Basic Usage

Use Promise.all to run multiple steps in parallel:
All three steps run concurrently. Each step is still individually memoized, so if the workflow crashes mid-execution, completed steps return instantly on resume.

How It Works

When executing parallel steps:
  1. All steps in the Promise.all start concurrently
  2. Each step creates its own step attempt in the database
  3. The worker waits for all steps to complete
  4. Results are returned as an array

Crash Recovery

Parallel steps handle crashes gracefully:
  1. Workflow starts three parallel steps
  2. Two steps complete, one is in progress
  3. Worker crashes
  4. New worker picks up the workflow
  5. Two completed steps return cached results
  6. The incomplete step re-executes

Error Handling

If any parallel step fails, Promise.all rejects with that error:
For independent operations where you want all results (including errors), use Promise.allSettled:

Common Patterns

Fetching Multiple Resources

Sending Multiple Notifications

Processing a Batch

Best Practices

Use Descriptive Step Names

Each parallel step needs a unique name:

Limit Parallelism for External APIs

When calling external APIs, consider rate limits:
Parallel steps work best when operations are truly independent:
For dependent operations, use sequential steps: