Skip to main content
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.
This guide walks you through creating workflows in Osmedeus, from basic concepts to advanced patterns.

Workflow Kinds

Osmedeus supports two workflow kinds:

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

Note: Use [[variable]] syntax inside foreach loops to avoid template conflicts.

http - Make HTTP Requests

llm - AI-Powered Analysis

agent - Agentic LLM Execution

The agent step type creates an autonomous tool-calling loop. The agent receives a task, plans its approach, calls tools iteratively, and produces a final answer. Key fields:
  • query — task prompt for the agent
  • max_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 configuration
  • exports — use {{agent_content}} for the final response text
See Step Types - agent for the full reference.

Template Variables

Built-in Variables

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) a goto. When combined with goto, inline actions execute first, then the jump happens. Available case fields:

Conditions Mode

Use JavaScript boolean expressions for more flexible routing. All matching conditions execute (no short-circuit), and the last matching goto wins.
Conditions support template variables, function calls, and standard JavaScript operators.

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