Workers API
Within a Workflow, can you run a Workflow Step in parallel?
For example: The AI SDK allows parallel execution of a step: https://developers.cloudflare.com/workflows/build/workers-api/#call-workflows-from-workers
And so does Mastra: https://mastra.ai/en/docs/workflows/control-flow#simultaneous-steps-with-parallel
It's not clear if Workflows have this feature.
Cloudflare Docs
Workers API
This guide details the Workflows API within Cloudflare Workers, including methods, types, and usage examples.
Branching, Merging, Conditions | Workflows | Mastra Docs
Control flow in Mastra workflows allows you to manage branching, merging, and conditions to construct workflows that meet your logic requirements.
1 Reply
Hey! By parallel you probably mean concurrently (as from what I see in Mastra docs). You can run concurrent steps with
Promise.all()
. We have an example here https://developers.cloudflare.com/workflows/build/rules-of-workflows/#do-not-rely-on-state-outside-of-a-step .
In short:
Let me know if this is what you were looking for