elsa-workflows / elsa-workflows/elsa-core
Child workflow is not dispatched
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
The child workflow is not dispatched using `DispatchWorkflow` is used.
## Steps to Reproduce
1. **Detailed Steps**: Just run the attached project.
2. **Code Snippets**:
This is the parent workflow
```
public class DispatchAndWaitWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
builder.WithDefinitionId(nameof(DispatchAndWaitWorkflow));
builder.Root = new Sequence
{
Activities =
[
new WriteLine("*** >>> Hello from Parent!"),
new DispatchWorkflow
{
WorkflowDefinitionId = new(nameof(ChildWorkflow)),
WaitForCompletion = new (true)
},
new WriteLine("*** <<< Bye from Parent!")
]
};
}
}
```
and the child workflow
```
public class ChildWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
builder.WithDefinitionId(nameof(ChildWorkflow));
builder.Root = new Sequence
{
Activities =
[
new WriteLine(ctx => "*** >> Hello from Child!"), /* set breakpoint here, it is never hit */
new Delay(TimeSpan.FromMilliseconds(250)),
new WriteLine("*** >> Bye from Child!"),
]
};
}
}
```
3. **Attachments**: The minimal project is attached - [workflows.zip](https://github.com/user-attachments/files/19868997/workflows.zip)
4. **Reproduction Rate**: Every time
## Expected Behavior
I expect the child workflow to be dispatched and executed.
## Actual Behavior
Child workflow is not dispatched and executed.
## Environment
- **Elsa Package Version**: 3.3.5
- **Operating System**: Windows 10
## Log Output
Log does not show anything, since the child workflow is not executed.
Contributor guide
Assessment
This issue has not been assessed yet.