Ciao,
I'm writing some workflows using Elsa Workflow .NET library. I'm using last stable version (v. 2.10.2.2).
I've wrote two workflows:
public class MyWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder.WorkflowBuilder
.HttpEndpoint(setup => setup.WithPath("myworkflow"))
.RunWorkflow<OtherWorkflow>(RunWorkflowMode.Blocking)
.Finish();
}
}
public class OtherWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder.WorkflowBuilder
.HttpEndpoint(setup => setup.WithPath("otherworkflow"))
.Finish();
}
}
And I've create a new instance of MyWorkflow with this HTTP request:
curl --location 'https://localhost:7236/myworkflow' \
--header 'X-Correlation-Id: document1.docx'
The sub-workflow OtherWorkflow has a new CorrelationId, like picture below:
I need that all sub-workflows inherit CorrelationId of parent, because I will have a lot of sub-workflows that needs to be correlated with it's parent.
How can I reach my goal programmatically?
Thanks
In case if anyone is still looking an answer for this, it can be done by providing
correlationId
as the value inCorrelation Id
field inAdvanced
tab ofRunWorkflow
activity.