Pre-Conditions
Skip a step if a condition is false.Common Conditions
Condition Functions
Step Dependencies (DAG Execution)
Steps can declare dependencies on other steps using thedepends_on field. This enables:
- Parallel execution of independent steps
- Automatic ordering based on dependencies
- DAG (Directed Acyclic Graph) execution
Basic Dependencies
subfinderandamassrun in parallel (no dependencies)merge-resultswaits for both to complete before executing
DAG Execution
The executor builds a dependency graph and uses topological sorting (Kahn’s algorithm) to determine execution order:Multiple Dependencies
Cascade Failure
If a dependency fails:- The dependent step is marked as failed (not executed)
- All downstream steps are also marked as failed
- Independent branches continue execution
Dependencies vs Sequential Execution
Withoutdepends_on, steps execute sequentially in order:
depends_on, steps can run in parallel:
Linter Validation
The workflow linter validates dependencies:Flow Module Dependencies
Flows also supportdepends_on for modules:
Decision Routing
Route to different steps based on variable values using switch/case syntax.Decision Syntax
switch: Template variable evaluated at runtime (exact string match)cases: Map of string values to goto targetsdefault: Fallback when no case matches (optional)goto: Target step name or_endto terminate
Inline Execution in Cases
Cases support running commands or functions inline, not justgoto:
DecisionCase supports:
Condition-Based Decision Routing
In addition to switch/case, decisions supportconditions — an array of JavaScript expressions evaluated at runtime. All matching conditions execute (no short-circuit):
Condition Fields
All matching conditions in the array are executed — there is no short-circuit behavior. If you need exclusive routing, use switch/case instead.
Special Goto Targets
Success Handlers
Execute actions when a step succeeds.Available Actions
Error Handlers
Handle step failures.Error Action Types
Combined Example
Flow-Level Conditions
Conditional module execution in flows:Branching Patterns
If-Then-Else
Early Exit
Loop with Retry
Best Practices
-
Always check file existence before processing
-
Use meaningful log messages
-
Handle errors gracefully
-
Use decision routing for complex logic
-
End workflows cleanly
Next Steps
- Step Types - All step types
- Variables - Exports and conditions
- Functions Reference - Condition functions
