Correlate Activity

Purpose: Set the CorrelationId of the workflow to a given value. The correlation ID is used to group related workflow instances together.

Input Properties

CorrelationId

An expression that evaluates to the value to store as the correlation ID.

Type: string

Required: Yes

Note: Can be a literal string, expression, or variable reference. Supports all Elsa expression syntaxes.

Output Properties

This activity has no output properties.

Usage Example

Scenario: Correlate workflow instances by order ID

Configuration:
- CorrelationId: "{{ Variables.OrderId }}"

Result:
- The workflow instance's CorrelationId is set to the OrderId value
- All workflow instances with the same OrderId can be found together
- Useful for grouping related workflow executions

Important Notes

  • The correlation ID is set immediately when this activity executes
  • Correlation IDs are used to group related workflow instances
  • Useful for finding all workflows related to a specific entity (e.g., order, customer, document)
  • You can set the correlation ID multiple times during workflow execution
  • The correlation ID is stored with the workflow instance and persists
  • Use expressions to create dynamic correlation IDs based on workflow state
  • Correlation IDs are often used in workflow queries and filtering

Related Activities