Types of Task Steps
Learn about different types of task steps and their use
Overview
In Julep broadly speaking there are two types of steps:
Control Flow Steps
These steps control the flow of the task. They are used to create conditional logic, loops, and parallel execution.
Key-Value Steps
These steps are used to get and set values in the task.
Iteration Steps
These steps are used to iterate over a collection.
Conditional Steps
These steps are used to create conditional logic.
Other Control Flow Steps
These steps are used to control the flow of the task.
The steps defined out here are in the YAML format. You can learn more about the YAML format here.
Control Flow Steps
Prompt Step
Send messages to the AI model:
In the prompt step we offer a bunch of Python functions to help you manipulate data. Here is a list of the functions you can use:
-
Standard library modules:
re
: Regular expressions (safe against ReDoS)json
: JSON encoding/decodingyaml
: YAML parsing/dumpingstring
: String constants and operationsdatetime
: Date and time operationsmath
: Mathematical functionsstatistics
: Statistical operationsbase64
: Base64 encoding/decodingurllib
: URL parsing operationsrandom
: Random number generationtime
: Time operations
-
Constants:
NEWLINE
: Newline charactertrue
: Boolean truefalse
: Boolean falsenull
: None value
Tool Call Step
Execute tools defined in the task:
Evaluate Step
Perform calculations or data manipulation:
In the evaluate step we offer a bunch of Python functions to help you manipulate data. Check out the Python Expressions for more information.
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
Example: Complex Workflow
Here’s an example combining various step types: