Basic Step
steps.ts
Step Options
| Option | Type | Description |
|---|---|---|
name | string | Unique identifier for the step |
description | string | Human-readable description |
inputSchema | ZodSchema | Zod schema for input validation |
outputSchema | ZodSchema | Zod schema for output validation |
fn | function | The step implementation |
options | object | Temporal activity options override |
Steps vs Workflows
Workflows
- Orchestrate steps
- Must be deterministic
- No direct I/O operations
Steps
- Execute I/O operations
- Can call APIs, databases, LLMs
- Automatically retried on failure
Step with I/O
steps.ts
Retry Options
Override retry behavior per step:Shared Steps
By default, steps are scoped to their workflow. To share steps across workflows, create ashared_steps.ts file:
shared_steps.ts
workflow.ts
Evaluators
Evaluators are a special type of step for analyzing LLM responses. They must return anEvaluationResult:
evaluators.ts
workflow.ts