Return
Synopsis
Finalizes processing and prevents further pipeline execution.
Schema
- return:
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
Field | Required | Default | Description |
---|---|---|---|
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if operation fails |
ignore_missing | N | false | Skip processing if referenced field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
Terminates pipeline execution immediately, preventing any subsequent processors from running. This processor is used to implement early termination logic, conditional exit points, and optimization paths that skip unnecessary processing.
When the return processor executes, it stops the current pipeline and marks the processing as complete. The data processed up to this point is preserved and passed to the next stage.
The return processor immediately stops pipeline execution. Any processors defined after a return statement will not be executed unless the return is conditional and the condition is not met.
This processor is commonly used for implementing business logic that requires early exit conditions, such as filtering logic, error handling, or optimization scenarios.
Return processors with success/failure chains will execute those chains before terminating the pipeline. This allows for cleanup operations or additional processing before exit.
Examples
Basic Early Exit
Stopping pipeline execution early... |
|
skips remaining processors: |
|
Conditional Return
Exiting based on field conditions... |
|
returns early when condition matches: |
|
Error Handling Return
Using return for error scenarios... |
|
exits pipeline on validation failure: |
|
Return with Cleanup
Performing cleanup before exit... |
|
executes cleanup before termination: |
|
Performance Optimization
Optimizing pipeline for specific data types... |
|
skips expensive processing for debug logs: |
|
Multi-Path Exit Strategy
Different exit points for different scenarios... |
|
exits at different points based on priority: |
|