Skip to content

Fresh-runtime workflow poll can defect after queued cancellation #6180

@schickling-assistant

Description

@schickling-assistant

I found a case where queued cancellation resolves cleanly for the external task and for a long-lived worker-side projection, but a fresh-runtime pollWorkflow(...) call for the same execution fails with a RuntimeException defect.

Reproduction

https://github.com/schickling-repros/2026-04-effect-workflow-poll-after-cancel

npm install
npm run repro

The repro uses:

  • a temporary local Postgres instance
  • a long-lived workflow worker
  • a generic external task service with queued task submission and cancellation

Expected

After queued cancellation, a fresh-runtime pollWorkflow(...) call should resolve to the same terminal success that the worker-side projection sees.

Actual

The external task reaches terminal canceled, and the worker-side projection resolves the execution as terminal success with finalState: "canceled", but a fresh-runtime pollWorkflow(...) call for the same execution returns a failed result whose defect contains RuntimeException.

Versions

  • effect: 3.21.0
  • @effect/workflow: 0.18.0
  • @effect/cluster: 0.58.0
  • @effect/sql-pg: 0.52.1
  • Node: v24.14.0
  • OS: darwin-arm64

Filed by an AI assistant on behalf of @schickling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions