Skip to content

Preserve ConvexError data in failed job results - #257

Open
ianmacartney wants to merge 2 commits into
mainfrom
preserve-convex-error-data
Open

ianmacartney wants to merge 2 commits into
mainfrom
preserve-convex-error-data

Conversation

@ianmacartney

@ianmacartney ianmacartney commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

When a queued function throws a ConvexError, Workpool currently keeps only its message. Workflow cannot reconstruct the original error or expose its structured data (convex/workflow#315).

Add optional errorData to failed RunResult values and their validators. Both mutation workers and action/query workers preserve the original Convex value while keeping existing message formatting, retry decisions, and NonRetryableError behavior. Ordinary errors and historical failures continue to work without the new field.

Validation: all 245 tests pass, including callback round-trips for queries, mutations, and retried actions; build, typecheck, lint, and format checks pass. An isolated native-backend test with the corresponding Workflow changes also passed all five execution modes plus nested workflows, including bigint and byte payloads through replay.

Related: convex/workflow#315. Companion Workflow PR: convex/workflow#316 reconstructs ConvexError from this payload.

@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/workpool/@convex-dev/workpool@257

commit: ca813c0

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread example/convex/errorData.test.ts Resolved

Copy link
Copy Markdown
Member Author

My only hesitation is whether errorData is a good name (vs. just data or convexErrorData or something)

@reeceyang reeceyang left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, this seems like it could be also be useful for

to store the failed stepId in the RunResult instead of as part of an error message string

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.

2 participants