danielgerlag / workflow-core

Lightweight workflow engine for .NET Standard
MIT License
5.4k stars 1.2k forks source link

Workflow steps not running after specifying input/output #1222

Open ihawn-cal opened 11 months ago

ihawn-cal commented 11 months ago

Describe the bug I can define a workflow like so:

public void Build(IWorkflowBuilder<DataClass> builder)
    {
        builder
            .StartWith<Step1>()
               .Output<string>(data => data.Payload, step => step.PayloadOutput)
            .Then<Step2>()
                .Input(step => step.PayloadInput, data => data.Payload);
    }

where Step1 and Step2 both inherit from StepBody and Step1 has property PayloadOutput, Step2 has property PauloadInput, and DataClass has property Payload. However, Step2, never gets executed - the workflow just stalls out and occasionally tries to rerun step 1.

In this instance, I registered Step1/Step2 via AddTransient and have Registered the workflow with the DataClass class.

Note that if I do not have the Output/Input pieces in the workflow definition, then Step2 does run

To Reproduce Create a workflow as shown above inside an Azure function using .NET 8

Expected behavior I would expect, my Step2.Run() to be executed and its PayloadInput string to be populated with the result of PayloadOutput from step 1.