Flow Control
slug: step-exitImmediately terminates pipeline execution with an optional message. Provides a controlled way to stop processing based on conditions or at specific points in the workflow.
message (string) - Custom message to display when exiting
"script ended."Returns a special control structure:
_ypl_exit - Boolean flag (true) signaling terminationmessage - The exit message (prefixed with "EXIT: ")Note: This output does not follow the standard data contract format as it's a control flow directive.
exit:
message: "Processing complete - no further steps needed"
executeIf:
condition: "freq == 0"
then:
- exit:
message: "No records found matching criteria"
- load:
file: "input.csv"
- filter:
keep_if: "revenue > 0"
- executeIf:
condition: "freq == 0"
then:
- exit:
message: "All records filtered out - invalid data"
- cube:
dimensions: [region]
measures: [revenue]
- load:
file: "data.csv"
- calculate:
new_column: "total_sales * 1.1"
- exit:
message: "DEBUG: Stopping after calculations to inspect data"
- chart: # This step will not execute
type: "bar"
When the exit step executes, the message appears as:
EXIT: [your message here]
For example, with message: "No data to process", the output would be:
EXIT: No data to process
executeIf for conditional exits based on data conditions- load:
file: "transactions.csv"
- executeIf:
condition: "freq < 100"
then:
- exit:
message: "Insufficient records - need at least 100 transactions"
- freq:
column: "status"
- executeIf:
condition: "status == 'error' AND freq > 0"
then:
- exit:
message: "Error records detected - halting pipeline"
- load:
file: "config.yaml"
- executeIf:
condition: "process_mode == 'validate_only'"
then:
- print:
title: "Validation Complete"
- exit:
message: "Validation mode - no processing performed"