Parameters
Defining Parameters
Using Parameters
Passing Parameters
Exports
Exports pass values from one step to the next.Basic Export
Export Sources
| Source | Description |
|---|---|
{{stdout}} | Command standard output |
{{stderr}} | Command standard error |
{{exit_code}} | Command exit code |
{{http_status_code}} | HTTP response status |
{{http_response_body}} | HTTP response body |
{{llm_response}} | LLM chat response |
HTTP Exports
Agent Exports
| Source | 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) |
Function Exports
Variable Scope
Step-Level Scope
Exports are available to all subsequent steps:Foreach Variable Scope
Loop variables use[[]] syntax and are only available inside the loop:
Resolution Order
Variables are resolved in this order:- Exports from previous steps
- Parameters from user input
- Built-in variables (Target, Output, etc.)
- Environment variables
Built-in Variables
Osmedeus provides a comprehensive set of built-in variables that are automatically available in all workflows. These variables are recognized by the linter and do not need to be defined.Path Variables
| Variable | Description |
|---|---|
{{BaseFolder}} | Osmedeus installation directory |
{{Binaries}} | Path to tool binaries |
{{Data}} | Path to data files |
{{ExternalData}} | Path to external data files |
{{ExternalConfigs}} | Path to external configuration files |
{{ExternalAgentConfigs}} | Path to agent configuration files |
{{ExternalAgents}} | Path to agent scripts |
{{ExternalScripts}} | Path to external scripts |
{{Workflows}} | Path to workflows directory |
{{MarkdownTemplates}} | Path to markdown templates |
{{ExternalMarkdowns}} | Path to external markdown files |
{{SnapshotsFolder}} | Path to snapshots storage |
{{Workspaces}} | Path to workspaces directory |
Target Variables
| Variable | Description |
|---|---|
{{Target}} | Current scan target |
{{target}} | Current scan target (lowercase alias) |
{{TargetFile}} | Path to target file (for multi-target runs) |
{{TargetSpace}} | Sanitized target (filesystem safe) |
Output Variables
| Variable | Description |
|---|---|
{{Output}} | Workspace output directory |
{{output}} | Workspace output directory (lowercase alias) |
{{Workspace}} | Workspace directory |
{{workspace}} | Workspace directory (lowercase alias) |
Thread Variables
| Variable | Description |
|---|---|
{{threads}} | Thread count (based on tactic) |
{{Threads}} | Thread count (uppercase alias) |
{{baseThreads}} | Base thread count |
Metadata Variables
| Variable | Description |
|---|---|
{{Version}} | Osmedeus version |
{{TaskDate}} | Task date |
{{TaskID}} | Unique task identifier |
{{TimeStamp}} | Unix timestamp |
{{CurrentTime}} | Current time |
{{Today}} | Current date (YYYY-MM-DD) |
{{RandomString}} | Random 6-character string |
{{ModuleName}} | Current module name |
{{FlowName}} | Parent flow name (empty if running module directly) |
{{RunUUID}} | Unique run identifier (UUID) |
{{DBRunID}} | Database run ID |
State File Variables
| Variable | Description |
|---|---|
{{StateExecutionLog}} | Path to execution log |
{{StateConsoleLog}} | Path to console log |
{{StateCompletedFile}} | Path to completion marker file |
{{StateFile}} | Path to state file |
{{StateWorkflowFile}} | Path to workflow state file |
{{StateWorkflowFolder}} | Path to workflow state folder |
Heuristic Variables
These variables are populated by automatic target analysis:| Variable | Description |
|---|---|
{{TargetType}} | Detected target type |
{{TargetRootDomain}} | Root domain extracted from target |
{{TargetTLD}} | Top-level domain |
{{TargetSLD}} | Second-level domain |
{{Org}} | Organization (if detected) |
{{TargetBaseURL}} | Base URL of target |
{{TargetRootURL}} | Root URL of target |
{{TargetHostname}} | Hostname from target URL |
{{TargetHost}} | Host from target |
{{TargetPort}} | Port from target URL |
{{TargetPath}} | Path from target URL |
{{TargetFileExt}} | File extension from target URL |
{{TargetScheme}} | URL scheme (http/https) |
{{TargetIsWildcard}} | Whether target is a wildcard |
{{TargetResolvedIP}} | Resolved IP address |
{{TargetStatusCode}} | HTTP status code from target |
{{TargetContentLength}} | Content length from target response |
{{HeuristicsCheck}} | Result of heuristics analysis |
Platform Variables
Automatically detected environment information:| Variable | Description |
|---|---|
{{PlatformOS}} | Operating system (linux, darwin, windows) |
{{PlatformArch}} | CPU architecture (amd64, arm64) |
{{PlatformInDocker}} | "true" if running inside a Docker container |
{{PlatformInKubernetes}} | "true" if running inside a Kubernetes pod |
{{PlatformCloudProvider}} | Cloud provider name (aws, gcp, azure, local) |
Event Variables
Available when a workflow is triggered by an event:| Variable | Description |
|---|---|
{{EventEnvelope}} | Full event envelope (JSON) |
{{EventTopic}} | Event topic (e.g., assets.new) |
{{EventSource}} | Source of the event |
{{EventDataType}} | Type of event data |
{{EventTimestamp}} | Event timestamp |
Chunk Variables
Used for parallel processing of large inputs:| Variable | Description |
|---|---|
{{ChunkIndex}} | Current chunk index |
{{ChunkSize}} | Size of each chunk |
{{TotalChunks}} | Total number of chunks |
{{ChunkStart}} | Start offset of current chunk |
{{ChunkEnd}} | End offset of current chunk |
Nested Variables
Variables can contain other variables:Generator Functions
Generate dynamic values for parameters using thegenerator field:
generator field is evaluated at workflow load time to produce the parameter value.
Available Generators
| Generator | Description | Example |
|---|---|---|
uuid() | UUID v4 | a1b2c3d4-... |
currentDate(format?) | Current date (default: YYYY-MM-DD) | 2026-02-17 |
currentTimestamp() | Unix timestamp | 1739808000 |
getEnvVar(key, default?) | Environment variable | getEnvVar('USER', 'unknown') |
concat(str1, str2, ...) | Concatenate strings | concat('scan-', 'target') |
randomInt(min?, max?) | Random integer (default: 0-100) | randomInt(1, 1000) |
randomString(length?) | Random alphanumeric string (default: 16) | randomString(8) |
execCmd(command) | Execute shell command | execCmd('whoami') |
toLower(str) | Convert to lowercase | toLower('ABC') |
toUpper(str) | Convert to uppercase | toUpper('abc') |
trim(str) | Trim whitespace | trim(' hello ') |
replace(str, old, new) | Replace occurrences | replace('a-b', '-', '_') |
split(str, delim, index?) | Split and get element | split('a,b,c', ',', 1) |
join(delim, str1, str2, ...) | Join strings with delimiter | join('-', 'a', 'b') |
Flow Variable Propagation
Flow to Module
Module Exports in Flow
Module exports are not automatically available to other modules. Use shared output files:Common Patterns
Chained Processing
Conditional on Export
Environment Variables
Best Practices
-
Use descriptive export names
-
Document parameter meanings
-
Provide sensible defaults
-
Use files for large data
Next Steps
- Control Flow - Using exports in conditions
- Templates - Template syntax
- Functions Reference - Available functions