Steps
Steps are the individual actions that make up agent workflows. Each step performs a specific operation and can depend on other steps.What is a Step?
A step defines:- What action to perform (LLM call, code execution, memory operation, etc.)
- When to execute (dependencies, conditions)
- How to handle results (success, error, retry logic)
- What data to use (inputs, parameters, previous step outputs)
Basic Steps
Step Dependencies
Sequential Execution
Usedepends_on to control execution order:
Parallel Execution
Steps without dependencies run in parallel:Multiple Dependencies
Steps can depend on multiple previous steps:Step Outputs
Accessing Results
Reference step outputs in subsequent steps:Output Structure
Step outputs follow a consistent structure:Step Configuration
Basic Configuration
Visibility Settings
Control what users see:Step Metadata in Result Handlers
To configure step attributes in result handlers, useStepMetadata:
Common Patterns
Data Processing Pipeline
Research and Analysis
Validation Workflow
Code Execution with External Files
For steps that run Python code from external files, use the@agent.exec decorator:
See the Code Execution Guide for detailed examples
and file organization patterns.
Step Lifecycle
- Created: Step is defined but not yet executed
- Waiting: Step is waiting for dependencies to complete
- Running: Step is currently executing
- Completed: Step finished successfully
- Failed: Step encountered an error
Best Practices
- Clear Dependencies: Use
depends_onto control execution order - Meaningful Names: Give steps descriptive names for debugging
- Handle Outputs: Always plan how step outputs will be used
- Error Handling: Use result handlers for error scenarios
- Resource Management: Consider timeout and resource limits for long-running steps
Step Types by Action
| Action Type | Purpose | Output |
|---|---|---|
llm.message() | AI text generation | response, model_used |
codeexec.execute() | Code execution | result, stdout, stderr |
memory.store() | Store data | stored_id, status |
memory.search() | Retrieve data | memories, count |
websearch.search() | Web search | results, urls |
bot.invoke() | Call other agents | result, status |