@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
21 lines (12 loc) • 479 B
Markdown
# Workflow\.then()
The `.then()` method creates a sequential dependency between workflow steps, ensuring steps execute in a specific order.
## Usage example
```typescript
workflow.then(step1).then(step2)
```
## Parameters
**step** (`Step`): The step instance that should execute after the previous step completes
## Returns
**workflow** (`NewWorkflow`): The workflow instance for method chaining
## Related
- [Control flow](https://mastra.ai/docs/workflows/control-flow)