Skip to content

Preserve ConvexError data across workflow steps and replay - #316

Open
ianmacartney wants to merge 4 commits into
mainfrom
issue-315
Open

ianmacartney wants to merge 4 commits into
mainfrom
issue-315

Conversation

@ianmacartney

@ianmacartney ianmacartney commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

A ConvexError thrown by a workflow step currently reaches the workflow as a plain Error, losing its structured .data. Preserve that data for inline steps and workflow-handler failures, and reconstruct ConvexError when resolving failed steps from the journal. Queued functions and nested workflows carry the same payload through completion callbacks. Historical failures without structured data remain ordinary errors.

Measure the complete serialized failure, including its message/stack and error data, against the existing 800 KiB result budget. Oversized failures become a bounded diagnostic without structured data. Apply the guard before inline/handler failures cross into the component, and when the component processes completion results, so failed steps can be journaled and caught through replay.

Fixes #315. Uses released @convex-dev/workpool 0.4.16, including convex/workpool#257. The peer minimum is ^0.4.16; the changeset requests a minor release for this increased requirement.

Validation:

  • Build and all 155 tests, typecheck, and formatting pass. Lint has no errors and three existing filter warnings.
  • Native E2E workflows pass on an isolated local backend. Eight additional native error/replay checks pass: all five function execution modes, nested workflows, and oversized inline queries/mutations. Small bigint/byte payloads retain their ConvexError identity and data; oversized failures remain catchable through replay.
  • Regression tests cover falsy structured data, exact size boundaries, combined message/data size, oversized messages, and bounded persisted journal failures.

@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: 56ff1f2

@ianmacartney
ianmacartney marked this pull request as ready for review November 11, 2026 03:16

@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 14 files

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

Re-trigger cubic

Comment thread package.json Resolved
Comment thread src/client/step.ts Resolved
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

3 participants