Skip to content

Multiple correlation fields #3440

@sfmskywalker

Description

@sfmskywalker

For certain scenarios it would be useful to have multiple lookup keys for a given workflow instance.

Currently, one can lookup a workflow instance by ID or correlation ID.
Correlation ID allows us to associate a workflow instance with business domain entities. For example, a document approval workflow could be correlated to a document ID, so that all workflows related to said document can be found and exectuted when relevant events happen.

In addition to having a single correlation ID field, we should have a lookup table by which a single workflow instance can be located.
An example use case is a Telnyx telephony workflow. Telnyx sends webhook events in response to actions being sent to it. This asynchronous message flow requires correlation of these events to a workflow. Using the correlation ID is good, but this also means the correlation ID can not be used for e.g. customer ID in case one wanted to correlate by customer as well.

A correlation lookup could be implemented by storing the following fields in a table/collection:

  • WorkflowInstanceId
  • CorrelationName (e.g. "CustomerId", "CallControlId", "DocumentId")
  • CorrelationId (the actual identifier)

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue relates to the core library

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions