Pre-Conditions
Skip a step if a condition is false.Common Conditions
Condition Functions
| Function | Description |
|---|---|
fileExists(path) | True if file exists |
fileLength(path) | Number of non-empty lines |
dirLength(path) | Number of directory entries |
isEmpty(str) | True if string is empty |
contains(str, substr) | True if string contains substring |
Decision Routing
Jump to a different step based on conditions.Special Jump Targets
| Target | Description |
|---|---|
_end | End workflow immediately |
_next | Continue to next step (default) |
step-name | Jump to named step |
Success Handlers
Execute actions when a step succeeds.Available Actions
| Action | Description | Parameters |
|---|---|---|
log | Log a message | message |
export | Export a value | key, value |
run | Run a command | command |
notify | Send notification | message |
continue | Continue execution | - |
Error Handlers
Handle step failures.Error Action Types
| Action | Description |
|---|---|
log | Log error message |
abort | Stop workflow (default) |
continue | Continue to next step |
run | Run recovery command |
notify | Send error notification |
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