Dispatch Workflow Activity
Using Code
using Elsa.Workflows;
using Elsa.Workflows.Activities;
using Elsa.Workflows.Runtime.Activities;
public class ParentWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
var childOutput = builder.WithVariable<IDictionary<string, object>>();
builder.Root = new Sequence
{
Activities =
{
new DispatchWorkflow
{
WorkflowDefinitionId = new(nameof(ChildWorkflow)),
Input = new(new Dictionary<string, object>
{
["ParentMessage"] = "Hello from parent!"
}),
WaitForCompletion = new(true),
Result = new(childOutput)
},
new WriteLine(context => $"Child finished executing and said: {childOutput.Get(context)!["ChildMessage"]}")
}
};
}
}Using Elsa Studio
Last updated