Skip to content

Feature: History Tracking for Workflow Variable Mutations #4351

@sfmskywalker

Description

@sfmskywalker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue relates to the core libraryelsa 3This issue is specific to Elsa 3enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions