Workflow Steps
Detailed guide to all available workflow step types in Julep
Overview
Workflow steps are the building blocks of tasks in Julep. Each step represents a specific action or operation that can be performed as part of a taskβs execution. This guide covers all available step types and their usage.
Common Steps
Prompt Step
Send messages to the AI model:
Tool Call Step
Execute tools defined in the task:
Evaluate Step
Perform calculations or data manipulation:
Wait for Input Step
Pause workflow for user input:
Key-Value Steps
Get Step
Retrieve values from storage:
Set Step
Store values for later use:
Iteration Steps
Foreach Step
Iterate over a collection:
Map-Reduce Step
Process collections in parallel:
Parallel Step
Execute steps concurrently:
Conditional Steps
If-Else Step
Conditional execution:
Switch Step
Multiple condition handling:
Other Control Flow
Sleep Step
Pause execution:
Return Step
Return values from workflow:
Yield Step
Execute subworkflows:
Best Practices
-
Step Organization
- Group related steps logically
- Use comments to explain complex steps
- Keep step chains focused and manageable
-
Error Handling
- Use if-else for error conditions
- Provide fallback options
- Log important state changes
-
Performance
- Use parallel execution when possible
- Optimize data passing between steps
- Cache frequently used values
Example: Complex Workflow
Hereβs an example combining various step types: