tzengjames-TW opened a new issue, #7654:
URL: https://github.com/apache/hop/issues/7654
### What would you like to happen?
## Title
Enhancement Request: Allow Repeat Action to Continue Execution When Child
Pipeline Fails
## Description
### Background
Currently, when a Repeat action executes a pipeline directly and the
pipeline fails (for example, due to a database connection interruption in a
Database Lookup transform), the pipeline returns a failure status to the Repeat
action.
As a result:
- The pipeline execution fails.
- The Repeat action stops immediately.
- The parent workflow is marked as failed.
- Subsequent workflow actions are not executed.
This behavior is understandable from an error propagation perspective.
However, it creates a different behavior compared to executing the same
pipeline through a Child Workflow.
## Current Behavior
Example:
```
Start
|
Repeat
|
Pipeline
```
When the database connection is lost:
```
Database Lookup
↓
Pipeline Failure
↓
Repeat Failure
↓
Workflow Failure
```
The workflow terminates immediately.
## Alternative Implementation Using Child Workflow
The following design behaves differently:
```
Start
|
Repeat
|
Child Workflow
|
Pipeline
```
The Child Workflow can catch the pipeline failure through a failure hop, set
variables, perform logging, and finally return Success.
Example:
```
Pipeline
|
Failure Hop
|
Set Variables
|
Success
```
As a result:
```
Pipeline Failure
↓
Handled by Child Workflow
↓
Child Workflow Success
↓
Repeat Continues
```
This allows users to implement retry loops, wait-and-retry mechanisms,
monitoring workflows, or graceful degradation strategies.
## Enhancement Proposal
Consider adding an optional setting to the Repeat action, such as:
```
[ ] Continue repeating when child pipeline returns failure
or
[ ] Ignore pipeline execution failure
or
Failure handling:
( ) Stop Repeat
( ) Continue Repeat
( ) Follow failure hop
```
This option would allow users to decide how failure events should be handled.
## Benefits
- More consistent behavior between direct Pipeline execution and Child
Workflow execution.
- Easier implementation of retry mechanisms for temporary failures.
- Better support for unstable external systems such as databases, APIs, and
message queues.
- Reduces the need to create additional Child Workflows solely for error
handling purposes.
- Improves workflow design flexibility while maintaining backward
compatibility.
## Expected Behavior
When enabled:
```
Repeat
|
Pipeline
```
If the pipeline fails due to a temporary database outage:
```
Pipeline Failure
↓
Repeat continues
↓
User-defined stop condition checked
↓
Next iteration
```
or
```
Pipeline Failure
↓
Failure branch executed
↓
Workflow continues
```
depending on the selected configuration.
## Additional Notes
This request is not intended to change the default behavior of Repeat.
The current behavior can remain unchanged for backward compatibility.
The proposal is to introduce an optional failure-handling mode that gives
users more control over how Repeat reacts to pipeline execution failures.
Thank you for considering this enhancement.
### Issue Priority
Priority: 2
### Issue Component
Component: Actions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]