Stop If Block
Conditional stopping in Scout workflows
The Stop If block enables conditional stopping within a Scout workflow. It evaluates a specified condition using Jinja templating and halts the workflow if the condition is true, allowing for dynamic control over workflow processes.
Configuration (Required)
condition
Template that should evaluate to True or False. This input uses Jinja templating to dynamically assess conditions based on the current state of the workflow.
See Workflow Logic & State > State Management for details on using dynamic variables in this block.
Outputs
The Stop If block outputs a JSON object containing:
- evaluated_condition: A boolean indicating whether the condition evaluated to true.
- details: Includes metadata such as the execution time in milliseconds.
Usage Context
Use this block to conditionally stop a workflow based on dynamic data. It is particularly useful in scenarios where certain conditions need to be met to halt further processing.
Best Practices
- Ensure the condition template is correctly formatted to evaluate to a boolean value. This is crucial for the block to function as intended.
- Utilize Jinja templating to dynamically evaluate conditions based on workflow state. This allows for flexible and context-aware decision-making within your workflows.
- Test conditions thoroughly to avoid unintended workflow stops. Proper testing ensures that the workflow behaves as expected under various conditions.