Overview
Workflow steps can be configured to execute conditionally.
Conditional execution allows a step to run only when a specific condition is met. This is useful when downstream steps depend on.
If the condition evaluates to true, the step executes.
If the condition evaluates to false, the step is skipped.
Common Use Cases
Conditional execution is often used to:
- Run a step only when a required parameter exists
- Skip optional processing steps
- Execute logic only when a previous step produced a result
- Control behavior based on environment variables or runtime properties
Conditions make workflows adaptable without modifying the underlying flows.
Configure Conditional Execution
To configure conditional execution:
- Select the workflow step.
- Open the Child Flow parameters panel.
- Enter a script in the Condition field.
The script must evaluate to a boolean value.
The step executes only when the condition evaluates to true.
Condition Script
The condition is written as a small script using JavaScript or Python.
The script must set the variable value in the last line to either true or false.
Example:
value = true;If value is set to true, the step executes.
If value is false, the step is skipped.
Available Variables
The condition script can access the following objects during execution.
| Name | Class name / JavaDoc |
|---|---|
| etlConfig | com.toolsverse.etl.core.config.EtlConfig |
| scenario | com.toolsverse.etl.core.engine.Scenario |
Summary
Conditional execution allows workflows to control whether a step runs based on runtime conditions.
Key points:
- Conditions are defined in the Condition field of a workflow step.
- The script must set the variable value to true or false.
- If the condition evaluates to true, the step executes. If it evaluates to false, the step is skipped.
Conditional execution makes workflows adaptable to runtime data and execution results.