elsa-workflows / elsa-workflows/elsa-core

Feature: Improved Handling of Faulted Activities

Open
#4,325 4 comments 5 reactions 0 assignees View on GitHub
core elsa 3 enhancement triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

### Problem:
Currently, if any activity within a workflow faults, the entire workflow instance transitions to the "Faulted" state. This all-or-nothing approach might not be suitable for all scenarios and use cases.

### Proposal:
1. **Introduce Incidents**: Instead of moving the entire workflow to a "Faulted" state upon an activity fault, the workflow should continue running but report "incidents" for the activities that have faults. This provides an overview of which activities failed while allowing the workflow to proceed.

2. **Configurable Behavior on Activity Fault**:
- **Option A**: Continue the workflow but report incidents (default behavior as proposed above).
- **Option B**: Transition the workflow to the "Faulted" state (existing behavior).
- This behavior should be configurable on a per-activity basis as well as a global default for the workflow.

3. **Retry Mechanism for Faulted Activities**: Introduce the ability to retry faulted activities, either manually or automatically based on a specified retry policy. This will allow users to handle transient faults effectively.

### Additional Suggestions:
4. **Incident Dashboard**: A dashboard or user interface component that provides an overview of all the incidents in a system. This can help administrators quickly identify problematic workflows or recurring issues.

5. **Custom Handlers for Faulted Activities**: Allow developers to attach custom error handlers to activities. These handlers could be used for logging, alerting, or other custom behaviors upon an activity fault.

6. **Incident Prioritization**: Classify incidents based on severity levels, allowing for prioritized handling and reporting.

7. **Fault Tolerance Patterns**: Introduce support for common fault tolerance patterns like Circuit Breaker, Timeout, and Fallback. This can make workflows more resilient to issues.

8. **Historical Incident Reporting**: Maintain a historical log of incidents for analysis, which can aid in identifying patterns or frequent issues.

9. **Notifications**: Provide the ability to send notifications (email, SMS, webhooks, etc.) when certain incidents occur. This can be crucial for mission-critical workflows.

### Summary:
With these enhancements, Elsa Workflows will be more resilient and flexible in handling activity faults, thereby providing users with more control and visibility over their workflows.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.