elsa-workflows / elsa-workflows/elsa-core
Input and correlation id is not propagated to child workflow
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
Input and correlation id is not propagated to child workflow from parent workflow. Neither Execute Workflow nor Dispatch Workflow work.

The only thing that work is patched ExecuteWorkflow activity, which explicitly propagates those values:
```
/* original */
var input = Input.GetOrDefault(context) ?? new Dictionary();
/* fix */
var input = context.WorkflowExecutionContext.Input;
```
The workflow is using all three variants to show the point.
When listed, only the instance with fix has correlation is set

## Steps to Reproduce
Workflow definition is located in the attached archive in Workflows folder. Trigger the workflow with the cUrl command.
1. **Detailed Steps**: Import the workflow into studio and run it.
2. **Code Snippets**:
```
curl --location 'http://localhost:5001/elsa/api/workflow-definitions/935880ecd531809f/execute' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey 00000000-0000-0000-0000-000000000000' \
--data '{
"input": {
"DaysExpiresAfter": 10,
"AggregateId": "3c969eca-c12f-4dbc-8489-46ceb41d3fd7"
}
}'
```
3. **Attachments**:
- **Workflow JSON**: Inside the attached archive.
- **Sample Project**: [ElsaServer.zip](https://github.com/user-attachments/files/20585915/ElsaServer.zip) project with sqlite database and the fixed.
4. **Reproduction Rate**: Every time
## Expected Behavior
I expect the input to parent workflow and correlation id to be propagated to child workflow.
## Actual Behavior
The input to parent workflow and correlation id is not propagated to child workflow.
## Environment
- **Elsa Package Version**: 3.5.0-rc1
- **Operating System**: Windows 10
## Troubleshooting Attempts
Only fixed the ExecuteWorkflow activity.
Contributor guide
Assessment
This issue has not been assessed yet.