Workflows orchestrate, but they can’t do any real work themselves — no API calls, no database queries, no LLM requests. That’s by design. Output replays workflow code to recover from failures, so if you made an API call directly in a workflow, it could run twice. Steps are the boundary: they run once, their results are cached, and if something fails, only the failed step retries.Documentation Index
Fetch the complete documentation index at: https://docs.output.ai/llms.txt
Use this file to discover all available pages before exploring further.
Basic Step
Here’s a step that looks up a company using an external API:steps.ts
await lookupCompany('acme.com'). The workflow decides when to call each step; the step does the actual work.
Step Properties
| Property | 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 |
options | object | Optional workflow options (see Options) |
fn | function | The step implementation |
Steps vs Workflows
Workflows
Workflows:
- Orchestrate steps in sequence or parallel
- Must be deterministic (no I/O)
- Replayed on failure to recover state
Steps
Steps:
- Where I/O happens: APIs, databases, LLMs
- Results cached — won’t re-run on replay
- Automatically retried on failure
Calling an LLM
Steps are where you make LLM calls using@outputai/llm. The prompt file handles the model configuration; the step handles the orchestration:
steps.ts
prompt references a .prompt file in your workflow’s prompts/ directory. See Writing Prompt Files for how to create them.
Options
Steps accept an optionaloptions property to configure retry behavior and timeouts. Use options.activityOptions for Temporal activity options. Options set on a workflow apply to all its steps; a step can override them with its own options.activityOptions:
steps.ts
Import Rules
Steps can import:- Clients from
src/clients/ - Type definitions, constants, helpers, utilities
- Any file that is not a component file (steps, evaluators, or workflow)
- Other steps (activity calling activity)
- Evaluators (they are also activities)
- Workflow files
What’s Next
- Step Patterns & Best Practices — Extract utilities, organize step files, share steps across workflows, and use evaluators for flow control
- Evaluators — Score LLM output and control workflow flow with LLM-as-a-judge