Skip to content

[Bug]: Deadlocked workflows report as 'Cancelled' #77

@thalesraymond

Description

@thalesraymond

Description

In WorkflowExecutor, there is a safety check loop (lines 75-80) that breaks if no tasks are running but pending tasks remain.

When this break occurs, the code falls through to cancelAllPending("Workflow cancelled."). This is misleading because the workflow wasn't cancelled by the user; it stopped because the runner couldn't proceed (effectively a deadlock or unreachable dependency state).

Reproduction Steps

  1. Manually construct a graph that passes validation but has a logic issue preventing a task from becoming ready (hard to do if validator is correct, but possible with runtime condition anomalies or manual manipulation).
  2. Alternatively, modify processLoop to artificially not pick up a ready task.
  3. Observe that the result status for remaining tasks is cancelled and the message says "Workflow cancelled.", confusing it with a user-initiated abort.

Expected Behavior

The runner should throw an error or mark the tasks with a specific status like deadlocked or unreachable, with a clear message: "Workflow stopped: pending tasks exist but none can be executed."

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions