Stop If Block

Conditional stop in Scout workflows based on evaluated conditions

The Stop If block is a control-flow component in Scout workflows that enables conditional execution. It evaluates a specified condition and halts the execution of subsequent blocks if the condition is met, allowing for dynamic control over workflow processes.

Configuration (Required)

condition
codeRequired

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 the execution of a workflow when a specific condition evaluates to true. This is useful for scenarios where certain steps should be skipped based on dynamic conditions.

Best Practices

  • Ensure the condition template correctly evaluates to a boolean value. This is crucial for the block to function as intended.
  • Use Jinja templating to dynamically construct the condition based on the workflow state. This allows for flexible and context-aware decision-making within your workflows.
  • Be cautious with the logic to avoid unintended workflow stoppages. Carefully design the condition to ensure it aligns with the desired workflow behavior.
Built with