Agent Orchestration Platform
Orchestrate complex, multi-step agentic processes
Mastra workflows let you define complex sequences of tasks using clear, structured steps rather than relying on the reasoning of a single agent. When a process needs to be repeatable, predictable and auditable, Mastra's agent orchestration platform gives you full control over how tasks break down, how data moves between them and what gets executed when.
Precisely define your execution graph
When a single agent cannot reliably handle a multi-step process, Mastra workflows give you full control over execution. Define steps with input and output schemas, compose them into sequential, parallel, branching or looping execution graphs and handle errors at every stage. Mastra Studio visualizes the execution graph and runs it step by step.
Sequential
step.then(
nextStep
)Parallel
step.parallel([
a,b
])Branch
step.branch([
[cond1, step1],
[cond2, step2]
])Loops
step.doWhile(cond)Compose with agentic primitives
Mastra workflows integrate directly with agents, tools, memory and MCP so every step can call the right primitive for the job. Nest workflows inside other workflows to reuse logic across processes. Persist state across steps so long-running workflows survive suspension and resumption.
Call agents and tools directly from workflow steps for intelligent execution
docsNest workflows inside other workflows to reuse logic across processes. Mastra's agent orchestration tools stay modular and composable as complexity grows
docsShare values across steps and resume workflows from exactly where they paused
docsFrequently asked questions
When should I use a Mastra workflow instead of an agent?
What execution patterns do Mastra workflows support?
Can Mastra workflows call agents and tools?
How does state management work in Mastra workflows?
How do I run Mastra workflows in production?
Ship better agents
Go from prototype to production on the open-source agent orchestration platform built for developers