You can find comprehensive examples of all available workflow types and steps in the Workflow test suites here.You can also use the skills provided at osmedeus/osmedeus-skills. These can help your AI agent generate workflows automatically for you.
Workflow Kinds
Osmedeus supports two workflow kinds:| Kind | Purpose |
|---|---|
module | Single execution unit with steps |
flow | Orchestrates multiple modules |
Basic Structure
Module Workflow
Flow Workflow
Step Types
bash - Execute Shell Commands
function - JavaScript Utility Functions
parallel-steps - Run Steps Concurrently
foreach - Loop Over Input
[[variable]] syntax inside foreach loops to avoid template conflicts.
http - Make HTTP Requests
llm - AI-Powered Analysis
agent - Agentic LLM Execution
query— task prompt for the agentmax_iterations— maximum tool-calling loop iterations (required)agent_tools— list of preset or custom tools (e.g.,bash,read_file,save_content,grep_regex,http_get)memory— conversation memory configurationexports— use{{agent_content}}for the final response text
Template Variables
Built-in Variables
| Variable | Description |
|---|---|
{{Target}} | Current target |
{{Output}} | Output directory for this run |
{{BaseFolder}} | Osmedeus installation directory |
{{Binaries}} | Binary tools directory |
{{Data}} | Data directory (wordlists, etc.) |
{{Workflows}} | Workflows directory |
{{Workspaces}} | Workspaces directory |
{{threads}} | Thread count based on tactic |
{{Version}} | Osmedeus version |
{{PlatformOS}} | Operating system (linux, darwin, windows) |
{{PlatformArch}} | CPU architecture (amd64, arm64) |
{{PlatformInDocker}} | "true" if running in Docker |
{{PlatformInKubernetes}} | "true" if running in Kubernetes |
{{PlatformCloudProvider}} | Cloud provider (aws, gcp, azure, local) |
Foreach Loop Variables
Use double brackets[[variable]] inside foreach loops:
Exports and Variable Passing
Pass data between steps using exports:Decision Routing
Branch workflow execution based on conditions. Decisions support two modes: switch/case (exact string matching) and conditions (boolean expressions).Switch/Case Mode
Match a variable’s value against exact strings:Inline Actions in Cases
Each case can run inline commands or functions instead of (or in addition to) agoto. When combined with goto, inline actions execute first, then the jump happens.
Available case fields:
| Field | Type | Description |
|---|---|---|
goto | string | Jump to a step by name, or _end to terminate |
command | string | Run a single bash command inline |
commands | string[] | Run multiple bash commands in sequence |
function | string | Execute a single utility function |
functions | string[] | Execute multiple utility functions in sequence |
Conditions Mode
Use JavaScript boolean expressions for more flexible routing. All matching conditions execute (no short-circuit), and the last matchinggoto wins.
Handlers (on_success / on_error)
Workflow Hooks
Hooks let you run steps before and after the main workflow execution. Use them for setup, cleanup, notifications, or result post-processing.Hook Execution Order
- pre_scan_steps run before any main steps execute
- post_scan_steps run after all main steps complete
- Both support all step types (bash, function, parallel-steps, foreach, etc.)
- Hook steps have access to the same template variables as main steps
Flow-Level Hooks
Hooks also work on flows. They run once around the entire flow, not per module:Runner Configuration
Host Runner (Default)
Docker Runner
SSH Runner
Per-Step Runner Override
Complete Example
Running Your Workflow
Next Steps
- See CLI References for all command options
- See Extending Osmedeus to add custom step types
- See Advanced Configuration for API keys and storage setup