Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ts/src/ExecutionConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const ExecutionConstants = {
SKIPPED_BY_CONDITION: "Skipped by condition evaluation.",
EXECUTION_STRATEGY_FAILED: "Execution strategy failed.",
WORKFLOW_CANCELLED: "Workflow cancelled.",
WORKFLOW_DEADLOCKED: "Workflow deadlocked: pending tasks remain with nothing running.",
};
6 changes: 5 additions & 1 deletion ts/src/WorkflowExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ export class WorkflowExecutor<TContext> {
}

// Ensure everything is accounted for (e.g. if loop exited early)
this.stateManager.cancelAllPending(ExecutionConstants.WORKFLOW_CANCELLED);
this.stateManager.cancelAllPending(
signal?.aborted
? ExecutionConstants.WORKFLOW_CANCELLED
: ExecutionConstants.WORKFLOW_DEADLOCKED,
);

const results = this.stateManager.getResults();
this.eventBus.emit("workflowEnd", { context: this.context, results });
Expand Down