Task Workflows
Tasks in Julep are powerful, Github Actions-style workflows that define long-running, multi-step actions. They allow for complex operations by defining steps and have access to all Julep integrations.
Task Structure
A Task consists of:
name
: The name of the task (required for creation)description
: A description of the taskmain
: The main workflow steps (required, minimum 1 item)input_schema
: JSON schema to validate input when executing the tasktools
: Additional tools specific to this taskinherit_tools
: Whether to inherit tools from the parent agent
Workflow Steps
Tasks can include various types of workflow steps:
Tool Call: Runs a specified tool with given arguments
Prompt: Runs a prompt using a model
Evaluate: Runs Python expressions and uses the result as output
Wait for Input: Suspends execution and waits for user input
Log: Logs information during workflow execution
Embed: Embeds text for semantic operations
Search: Searches for documents in the agent's doc store
Set: Sets a value in the workflow's key-value store
Get: Retrieves a value from the workflow's key-value store
Foreach: Runs a step for every value from a list in serial order
Map-reduce: Runs a step for every value of the input list in parallel
Parallel: Executes multiple steps in parallel
Switch: Executes different steps based on a condition
If-else: Conditional step with then and else branches
Sleep: Pauses the workflow execution for a specified time
Return: Ends the current workflow and optionally returns a value
Yield: Switches to another named workflow
Error: Throws an error and exits the workflow
Example Task
Here's an example of a daily motivation task:
This task demonstrates the power and flexibility of Julep's workflow system, allowing for complex, multi-step processes that can interact with various tools and models to achieve sophisticated outcomes.
Last updated