Overview
| Type | Description | Primary Use |
|---|---|---|
bash | Execute shell commands | Run tools, file operations |
function | Run utility functions | Conditions, logging, file checks |
foreach | Iterate over file lines | Process lists |
parallel-steps | Run steps concurrently | Parallel tool execution |
remote-bash | Per-step Docker/SSH | Mixed environments |
http | Make HTTP requests | API calls, webhooks |
llm | AI-powered processing | Analysis, summarization |
agent | Agentic LLM execution | Autonomous tool-calling agents |
bash
Execute shell commands.Basic Command
Multiple Commands (Sequential)
Parallel Commands
Structured Arguments
Save Output to File
function
Execute utility functions via Goja JavaScript VM.Single Function
Multiple Functions
Parallel Functions
Use in Conditions
foreach
Iterate over lines in a file with parallel execution using a worker pool.Basic Loop
With Nested Variables
Bounded Concurrency
The foreach executor uses a worker pool pattern:- Workers pull items from a shared queue
- Maximum
threadsitems processed concurrently - Memory-efficient: doesn’t spawn all goroutines upfront
- Graceful cancellation on context timeout
Fields
| Field | Required | Description |
|---|---|---|
input | Yes | Path to file with items (one per line) |
variable | Yes | Variable name for current item |
threads | No | Maximum concurrent iterations (default: 1) |
step | Yes | Step to execute for each item |
variable_pre_process | No | Transform each input line before storing (e.g., trim([[line]])) |
Pre-Processing Input
Transform each input line before it is stored in the loop variable:Variable Syntax
Use[[variable]] (double brackets) for loop variables to avoid conflicts with {{templates}}:
Nested Foreach
Foreach steps can contain other foreach steps:parallel-steps
Run multiple steps concurrently.remote-bash
Execute commands in Docker or SSH without module-level runner.Docker Execution
SSH Execution
Fields
| Field | Required | Description |
|---|---|---|
step_runner | Yes | docker or ssh |
step_runner_config | Yes | Runner configuration |
command | Yes | Command to execute |
step_remote_file | No | Remote file to copy back |
host_output_file | No | Local destination for remote file |
http
Make HTTP requests with automatic retries and connection pooling.Supported Methods
| Method | Description |
|---|---|
GET | Retrieve data (default) |
POST | Create/submit data |
PUT | Update/replace resource |
PATCH | Partial update |
DELETE | Remove resource |
GET Request
POST Request
PUT Request
PATCH Request
DELETE Request
Auto-Exported Variables
After HTTP step execution, variables are exported with the pattern<step_name>_http_resp:
HTTP Features
- Connection Pooling: Reuses connections for efficiency
- Automatic Retries: Retries on network errors and 5xx responses (up to 3 attempts)
- Timeout: Configurable via step
timeoutfield (default: 30s) - Template Support: Headers and request body support
{{variable}}interpolation
llm
AI-powered processing using LLM APIs (OpenAI-compatible).Chat Completion
Message Roles
| Role | Description |
|---|---|
system | System prompt defining behavior |
user | User input/question |
assistant | Model’s previous response |
tool | Tool/function call result |
With Tool Calling
Define tools the LLM can invoke (OpenAI-compatible function calling):{{step_name_llm_resp.tool_calls}}.
Embeddings
Generate vector embeddings for text:Multimodal Content (Vision)
Include images in messages:Structured Output (JSON Schema)
Force structured JSON responses:Configuration Override
Override global LLM settings per step:Auto-Exported Variables
After LLM step execution:Provider Rotation
If multiple LLM providers are configured, the executor automatically:- Rotates to next provider on rate limits or errors
- Retries up to
max_retries * provider_counttimes - Records rate limit metrics for monitoring
agent
Agentic LLM execution with an autonomous tool-calling loop. The agent receives a task, plans its approach, calls tools iteratively, and produces a final answer.Basic Usage
Preset Tools
The following preset tools are available via thepreset field:
| Preset | Description |
|---|---|
bash | Execute shell commands |
read_file | Read entire file contents |
read_lines | Read specific line range from a file |
file_exists | Check if a file exists |
file_length | Count non-empty lines in a file |
append_file | Append content to a file |
save_content | Write content to a file |
glob | Find files matching a glob pattern |
grep_string | Search for literal string in files |
grep_regex | Search for regex pattern in files |
http_get | Make HTTP GET request |
http_request | Make HTTP request (any method) |
jq | Query JSON with jq expressions |
exec_python | Execute inline Python code |
exec_python_file | Execute a Python file |
exec_ts | Execute inline TypeScript code |
exec_ts_file | Execute a TypeScript file |
run_module | Run an Osmedeus module |
run_flow | Run an Osmedeus flow |
Custom Tool Handlers
Define custom tools with a handler expression:Multi-Goal Queries
Usequeries for multiple goals evaluated in sequence:
Sub-Agents
Spawn specialized sub-agents from the main agent:spawn_agent tool.
Memory Configuration
Control conversation memory for long-running agents:| Field | Description |
|---|---|
max_messages | Sliding window size for conversation history |
summarize_on_truncate | Summarize old messages before removing them |
persist_path | Save conversation to file after completion |
resume_path | Resume from a previous conversation file |
Planning Stage
Run a planning prompt before the main execution loop:Structured Output
Enforce a JSON schema on the agent’s final output:Model Selection
Specify preferred models (tried in order before falling back to default):Tool Tracing Hooks
Add JavaScript hooks for tool call monitoring:Stop Condition
Evaluate a JS expression after each iteration to stop early:Parallel Tool Calls
Control whether the agent can execute multiple tool calls in parallel (enabled by default):Auto-Exported Variables
After agent step execution, these variables are automatically available:| Variable | Description |
|---|---|
{{agent_content}} | Final agent response text |
{{agent_history}} | Full conversation history (JSON) |
{{agent_iterations}} | Number of iterations used |
{{agent_total_tokens}} | Total tokens consumed |
{{agent_prompt_tokens}} | Prompt tokens consumed |
{{agent_completion_tokens}} | Completion tokens consumed |
{{agent_tool_results}} | All tool call results (JSON) |
{{agent_plan}} | Planning stage output (if plan_prompt was set) |
{{agent_goal_results}} | Per-goal results (for multi-goal queries) |
Fields Reference
| Field | Required | Description |
|---|---|---|
query | Yes* | Task prompt for the agent |
queries | Yes* | Multiple task prompts (alternative to query) |
max_iterations | Yes | Maximum tool-calling loop iterations (must be > 0) |
agent_tools | No | List of preset or custom tools |
system_prompt | No | System prompt for the agent |
sub_agents | No | Inline sub-agents spawnable via spawn_agent tool |
memory | No | Sliding window config (max_messages, summarize_on_truncate, persist_path, resume_path) |
models | No | Preferred models tried in order before falling back to default |
output_schema | No | JSON schema enforced on final output |
plan_prompt | No | Planning stage prompt run before the main loop |
stop_condition | No | JS expression evaluated after each iteration |
on_tool_start | No | JS hook expression run before each tool call |
on_tool_end | No | JS hook expression run after each tool call |
parallel_tool_calls | No | Enable/disable parallel tool execution (default: true) |
query or queries is required.
Common Step Fields
All steps support these fields:Field Reference
| Field | Description |
|---|---|
name | Required. Unique step identifier |
type | Required. Step type (bash, function, foreach, parallel-steps, remote-bash, http, llm, agent) |
depends_on | Array of step names this step depends on (enables parallel execution) |
pre_condition | Expression to evaluate; step skipped if false |
timeout | Maximum execution time (default varies by step type) |
log | Path to write step output log |
exports | Map of variable names to values to export |
on_success | Actions to execute on successful completion |
on_error | Actions to execute on failure |
decision | Conditional routing based on variable values |
Next Steps
- Variables - Exports and propagation
- Control Flow - Conditions and routing
- Functions Reference - Available functions