Context: CodeRabbit feedback on upstream PR coleam00#1875 surfaced a likely-valid pending-row bug in our fork.
Problem:
- packages/workflows/src/executor.ts creates a workflow run and then awaits onWorkflowRunCreated.
- If createWorkflowRun succeeds but onWorkflowRunCreated throws, the catch path reports a DB creation failure and leaves the created run pending.
Impact:
- P1. Orphaned pending workflow runs can confuse status, locks, and follow-up workflow dispatch.
Acceptance criteria:
- Separate createWorkflowRun failure handling from onWorkflowRunCreated failure handling.
- If the startup hook fails after the run exists, mark that workflow run failed/cancelled with a clear reason before returning.
- Log hook failure with workflowRunId.
- Add a regression test for hook failure after successful run creation.
Reference:
Context: CodeRabbit feedback on upstream PR coleam00#1875 surfaced a likely-valid pending-row bug in our fork.
Problem:
Impact:
Acceptance criteria:
Reference: