Mastra Workflows
Orchestrate complex, multi-step processes
Define an execution graph of agents and tool calls. Suspend for human review. Re-use steps and workflows.
precisely define your execution graph
Handle complex workflows with nesting, state management, and sophisticated branching and parallel execution.
Sequential
step.then(nextStep)
Parallel
step.parallel([a,b])
Branch
step.branch([[cond1, step1],[cond2, step2]])
Loops
step.doWhile(cond)
compose with agentic primitives
Build intelligent agents that execute tasks, access your data sources, and maintain memory persistently.
Ready to get started with Mastra?