Skip to content

Preserve ConvexError data across workflow steps and replay - #316

Draft
ianmacartney wants to merge 1 commit into
mainfrom
issue-315
Draft

ianmacartney wants to merge 1 commit into
mainfrom
issue-315

Conversation

@ianmacartney

Copy link
Copy Markdown
Member

A ConvexError thrown by a step currently reaches the workflow as a plain Error, so instanceof ConvexError is false and .data is lost. Preserve structured error data for inline steps and workflow-handler failures, then reconstruct ConvexError when replaying failed steps. Queued queries, mutations, and actions use the corresponding Workpool transport change. Nested workflows preserve the same payload through completion callbacks.

Fixes #315.

Ordinary errors keep their recorded messages, and historical failures without structured data remain ordinary errors. Tests cover all five function execution modes, recovery after replay, nested workflows, falsy error data, bigint and byte payloads, and ordinary-error compatibility.

Dependency: convex/workpool#257. This draft pins its immutable commit build for development and CI. Before merging, release that Workpool change and replace the development pin with the released version. The peer minimum anticipates 0.4.16; adjust it to the actual release if needed.

Validation:

  • Clean npm ci, build, all 143 tests, typecheck, and formatting pass. Lint has no errors and three existing filter warnings.
  • All six native-backend cases pass against an isolated local deployment: inline queries/mutations, queued queries/mutations/actions, and nested workflows. Bigint and byte payloads survive execution and replay.
  • The six regression cases fail on origin/main, even with the Workpool transport change installed.

Related investigation: merged #218 (ian/error-line-numbers) improves stack reporting but does not preserve error data. No existing implementation was found in the local branches or PR search.

@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/workflow@316

commit: 50e760a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A ConvexError thrown from a step and caught in a workflow is not a ConvexError like elsewhere in Convex

1 participant