danielgerlag / workflow-core

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

Post workflow middleware can't catch cancelled workflow #1230

Open wakuflair opened 10 months ago

wakuflair commented 10 months ago

Describe the bug A cancelled workflow not be caught in a post workflow middleware.

To Reproduce

  1. Create a post workflow middleware following doc
  2. Start a workflow with a CancellationToken
  3. Cancel the workflow with token
  4. The middleware is not triggered

Expected behavior The post workflow middleware should be triggered with a "Terminated" status workflow.

Additional context

I am not sure if it is by design, if yes, how can I handle a cancelled workflow by using workflow middleware?