elsa-workflows / elsa-workflows/elsa-core

Feature: History Tracking for Workflow Variable Mutations

Open
#4,351 2 comments 0 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

### Summary:
Introduce the ability for Elsa 3 to maintain and track a history of workflow variable mutations.

### Background:
Elsa currently supports defining and using workflow variables, but once an activity modifies a variable, the previous state/value of the variable is lost. For debugging, audit, and data analysis purposes, it would be invaluable to have a traceable history of how a variable has changed over time throughout the workflow execution.

### Feature Description:
1. **History Object**: Whenever a workflow variable is mutated (e.g., updated, deleted), capture:
- The previous value of the variable
- The new value of the variable
- The timestamp of mutation
- The activity ID/name that initiated the mutation

2. **Accessible via API**: Expose an API endpoint that allows users to query the history of a variable by workflow instance or variable name.

3. **UI Integration**: In Elsa's dashboard, under each workflow instance, provide a section/tab dedicated to showcasing the history of variable mutations in a timeline or tabular format.

4. **Configurability**: Allow users to turn on/off this feature at the workflow or global level to cater to performance and storage considerations.

### Use Case:
Consider a workflow where variable `X` starts with the value `10`, is updated to `20` by `Activity A`, and then changed to `30` by `Activity B`. With this feature, a user can trace back the mutations, understanding which activity modified the variable and when.

### Potential Benefits:
- Enhanced debugging: Easily trace back the sources of unexpected variable values.
- Auditing: Maintain a clear record of how data changes throughout the workflow execution.
- Data Analysis: Analyze patterns of data mutations for insights and improvements.

Would love to hear thoughts on the feasibility, and any additional requirements or concerns associated with implementing this feature.

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.