Skip to main content
Mastra 1.0 is available 🎉 Read announcement

Workflow.then()

The .then() method creates a sequential dependency between workflow steps, ensuring steps execute in a specific order.

Usage example
Direct link to Usage example

workflow.then(step1).then(step2);

Parameters
Direct link to Parameters

step:

Step
The step instance that should execute after the previous step completes

Returns
Direct link to Returns

workflow:

NewWorkflow
The workflow instance for method chaining
On this page