elsa-workflows / elsa-workflows/elsa-core
Inconsistent Workflow Cancellation Status Display
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
# Issue: Inconsistent Workflow Cancellation Status Display
## Reproduction Steps:
To reproduce the issue, follow these steps:
1. Identify a set of suspended workflow instances.
2. Review the status of these workflows.
3. Initiate cancellation for the selected workflows.
4. Verify the cancellation status in the overview and expect all to be cancelled.
Observed Outcome: After performing the above steps, it was found that 6 workflows were cancelled, while 4 remained in a suspended state.

Upon refreshing the overview page, the statuses updated correctly to reflect the cancellation of all workflows.

Furthermore, it was observed that the API returns the correct number of cancelled workflows, indicating that the backend processes the cancellation requests accurately.

## Observations and Proposed Enhancement
The primary issue observed is the inconsistency in the display of workflow cancellation statuses. This inconsistency may lead users to believe that not all selected workflows were successfully cancelled, despite the backend accurately processing all cancellation requests. This discrepancy is due to the immediate server response post-cancellation request, which does not wait for each workflow instance's cancellation process to complete.
### Proposed Solution: Introduction of an Interim State
To address this issue, we propose introducing a new `InterimState` field to the workflow instances, specifically for managing transitional states such as cancellation. When a cancellation request is issued, the `InterimState` for the affected workflow instances will be set to `Cancelling`. This state will remain until the cancellation process is fully completed for all workflows, at which point:
- The `InterimState` field needs to be explicitly cleared once a workflow enters the `Cancelled` state, ensuring the system accurately reflects the current state without any residual transitional states.
#### UI Considerations
- Upon executing the cancellation action (potentially in bulk), the UI should immediately reflect the `Cancelling` interim state for the affected workflows. It is not necessary for the UI to periodically or automatically refresh to update the state changes during the cancellation process.
- Ensuring that the UI displays the `Cancelling` state provides clear, immediate feedback to users that their request is being processed, without the need for them to manually refresh or question the current state of their workflows.
- A separate issue will be opened to address the need for the Workflow Instances List View to display up-to-date states of workflows, ensuring overall system usability and accuracy in state representation.
By implementing this solution, we aim to significantly improve the feedback and information provided to users during the workflow cancellation process, ensuring that the system's behavior aligns with user expectations and enhances overall usability.
Contributor guide
Assessment
This issue has not been assessed yet.