danielgerlag / danielgerlag/workflow-core

Can't seem to progress Step with WaitForEvent

Open
#1,152 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
5.9k
Forks
1.3k
Avg merge
1d 1h
Merged PRs (30d)
5

Description

How do I correctly implement WaitFor in a step?

I've got the following step that waits for an event before completing.

`return ExecutionResult.WaitForEvent("Event", "0", DateTime.Now);`

and then a API call that uses:

`await _workflowController.PublishEvent("Event", "0", "", DateTime.Now);`

but this doesn't complete the step and move onto the next in the Workflow.

```
builder.UseDefaultErrorBehavior(WorkflowErrorHandling.Suspend)
.StartWith()
.Then()
.Then();
```

This always sits at the WaitFor step. What am I doing wrong?

The `executionpointer` table shows the pointerStatus as 5 (WaitingForEvent) but the `EventPublished` flag is set to true.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the WaitForEvent call and the workflowController.PublishEvent API, then inspect how the executionpointer row handles pointerStatus 5 and the EventPublished flag. Reproduce the workflow and trace whether the published event resumes WaitForStep; done means the pointer advances and EndStep executes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.