Commit Graph

682 Commits

Author SHA1 Message Date
Vercel Release Bot 6930e3c763 Version Packages (beta) (#1154)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.1.0-beta.61
2026-02-26 17:38:07 -08:00
Casey Gowrie b06e491a47 New queue version (#1188)
* New queue package

* Update null messageId

* add comment

* changeset

* Update queue

* token

* queue proxy URL

* fix proxy URL

* update

* name

* comment
2026-02-26 16:49:45 -08:00
Pranay Prakash 40f54cf323 Add preview deployment badge with clipboard safety guard (#1202)
* feat: add PreviewBadge component and integrate into home page

Slack-Thread: https://vercel.slack.com/archives/C09G3EQAL84/p1772085714762119?thread_ts=1772085714.762119&cid=C09G3EQAL84
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* feat: enhance clipboard copy error handling in preview-badge component

Slack-Thread: https://vercel.slack.com/archives/C09G3EQAL84/p1772085714762119?thread_ts=1772085714.762119&cid=C09G3EQAL84
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

---------

Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
2026-02-26 16:14:19 -08:00
Nathan Rajlich b224521cb0 [world-vercel] Move event ref resolution from server-side to client-side (#1189) 2026-02-26 13:27:24 -08:00
Peter Wielander 49d1b6d57e [world-vercel] Expose total blob and stream storage bytes on run entity (#1196) 2026-02-26 13:13:50 -08:00
Nathan Colosimo 339c343922 [next] Avoid package.json resolver failures in loader dep tracking (#1192)
Signed-off-by: nathancolosimo <nathancolosimo@gmail.com>
2026-02-26 13:01:12 -08:00
Michael Han 71d09c57f2 [ai] Strip OpenAI itemId from providerMetadata to fix Responses API tool call errors (#889) 2026-02-26 10:53:35 -08:00
Pranay Prakash 2838fb9de0 Render structured error stack traces as readable text across all error views (#1201)
* fix: render error stack as readable text in attribute-panel

Update 'error' display to show stack trace as '<pre>' text.

Slack-Thread: https://vercel.slack.com/archives/C09G3EQAL84/p1772083947691689?thread_ts=1772083947.691689&cid=C09G3EQAL84
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* feat: create new changeset for PR updates

Add new changeset following format and style guidelines.

Slack-Thread: https://vercel.slack.com/archives/C09G3EQAL84/p1772083947691689?thread_ts=1772083947.691689&cid=C09G3EQAL84
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* feat: enhance tab state and accessibility

Add shared 'TabbedContainer' and fix ARIA roles/keyboard nav; reset tab state on error change.

Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* feat: render error stack traces as readable text and add copy button

Slack-Thread: https://vercel.slack.com/archives/C09G3EQAL84/p1772083947691689?thread_ts=1772083947.691689&cid=C09G3EQAL84
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* feat: render structured error stack traces in multiple UI components

Slack-Thread: https://vercel.slack.com/archives/C09G3EQAL84/p1772083947691689?thread_ts=1772083947.691689&cid=C09G3EQAL84
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* fix: resolve TypeScript type and import errors

Remove unnecessary type cast and add missing toast import.

Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

---------

Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
2026-02-26 07:58:14 -08:00
Nathan Rajlich c6144564ea Pass teamId to the run-key endpoint (#1183) 2026-02-25 00:49:29 +00:00
Karthik Kalyan f0823dc79b [web-shared][web] Fix trace viewer pagination issues (#1182)
* [web-shared] Fix trace viewer pagination issue

* [web-shared] Fix trace viewer pagination issue

* [web-shared] Fix trace viewer pagination issue

* [workflow o11y] bump package and fix trace viewer pagination issue

* [workflow o11y] bump package and fix trace viewer pagination issue
2026-02-24 16:04:20 -08:00
Ali Waleed a0b99c8ec8 [web] Decompose workflow-api-client.ts into focused modules and add unit tests (#1070) 2026-02-24 15:34:53 -08:00
Nathan Rajlich 70223a9091 Don't enforce client-side generated runId in start() for v1Compat (#1178) 2026-02-24 08:11:41 +00:00
Pranay Prakash 45800b474b Fix OG image routing under i18n (#1176)
* Fix og route handling in i18n middleware

* Add docs CI smoke test for OG and sitemap

* Run docs OG checks against Vercel preview

* Refactor docs CI checks and rename smoke test

* Use docs Vercel token for preview checks

* Expand docs OG smoke coverage

* Check docs HTML OG metadata
2026-02-23 23:40:46 -08:00
Nathan Rajlich e1a2f475aa [world-vercel] Handle null key response from run-key API endpoint (#1174)
* [@workflow/world-vercel] Handle null key response from run-key API endpoint

The API endpoint now returns { key: null } instead of a 404 when a
deployment has no encryption key. Update fetchRunKey to accept the
nullable response and return undefined, signaling that encryption
is disabled for that workflow run.

* [@workflow/world-vercel] Add changeset for null run-key handling

* Address review feedback: improve error message and fix test mock cleanup

- Include Zod error details in the validation error message for better debugging
- Move fetch mock restoration to afterEach to prevent mock leakage on test failure
2026-02-23 22:51:20 -08:00
Nathan Rajlich 81a883bc9b ci: don't cancel in-progress CI runs on main branch (#1166)
* fix: use types.isNativeError() for cross-VM Error serialization

FatalError was not properly serialized when passed from workflow code into a step function because the Error reducer checked `value instanceof global.Error` where `global` is the VM's globalThis. Errors created in the host context (like FatalError from @workflow/errors) have a different Error prototype than the VM context, so the instanceof check returned false and the error was silently dropped.

Replaced with `types.isNativeError()` from `node:util` which uses V8's internal type tag and works across VM context boundaries.

* ci: don't cancel in-progress CI runs on main branch
2026-02-24 06:50:59 +00:00
Robert Vollmer 79a730aa68 [world-postgres] Hide also "info" logs from Graphile Worker by default (#1171)
Signed-off-by: Robert Vollmer <rovo89@users.noreply.github.com>
2026-02-23 17:17:44 -08:00
Nathan Rajlich a78af46f0e Configure Release job for OIDC trusted publishing (#1138) 2026-02-23 16:47:34 -08:00
Peter Wielander 2b7e7daca0 [ci] Add code owners file (#1173) 2026-02-23 16:14:26 -08:00
Robert Vollmer c8c98fe463 [ai] Pass optional request metadata through WorkflowChatTransport (#1023)
Signed-off-by: Robert Vollmer <rovo89@users.noreply.github.com>
2026-02-23 15:23:10 -08:00
Robert Vollmer 0735b2a55b [world-postgres] Fix race conditions in Postgres streamer (#1002)
Signed-off-by: Robert Vollmer <rovo89@users.noreply.github.com>
2026-02-23 15:17:43 -08:00
Peter Wielander dda67421cf [world-postgres] [cli] Skip graphile logs for CLI json mode, observe DEBUG env (#1167) 2026-02-23 22:25:02 +00:00
Nathan Rajlich d99ca9cfed fix: use types.isNativeError() for cross-VM Error serialization (#1164)
FatalError was not properly serialized when passed from workflow code into a step function because the Error reducer checked `value instanceof global.Error` where `global` is the VM's globalThis. Errors created in the host context (like FatalError from @workflow/errors) have a different Error prototype than the VM context, so the instanceof check returned false and the error was silently dropped.

Replaced with `types.isNativeError()` from `node:util` which uses V8's internal type tag and works across VM context boundaries.
2026-02-23 20:07:58 +00:00
Karthik Kalyan bf3e75f7c3 [web-shared] Traceviewer Sidepanel improvements/bugfixes (#1162)
* Bring back sitemap

* Bring back sitemap

* Add pre commit hooks for sitemap

* Add pre commit hooks for sitemap

* Fix failing queue test

* Revert queue test failure

* Add unit tests

* Fix sleep state in side panel

* Side panel improvements

* Side panel improvements

* Side panel improvements

* Side panel improvements

* Side panel improvements
2026-02-23 11:29:54 -08:00
Ben Smith f5ea16fbf5 Fix: Update devalue to resolve alerts (#1135)
* Update devalue
Fix security warnings from devalue 5.6.0 by updating to 5.6.3.

* Create cyan-apes-fry.md

Signed-off-by: Nathan Rajlich <n@n8.io>

---------

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
2026-02-23 09:32:40 -08:00
Peter Wielander c9186f9870 [world-postgres] Add migrations from pg-boss to graphile-worker queue (#1126) 2026-02-20 18:25:08 -08:00
Kevin 1f9a67c759 [world-postgres] Replace pg-boss with graphile-worker (#1124) 2026-02-20 16:24:21 -08:00
Vercel Release Bot be3c555ad8 Version Packages (beta) (#1153) workflow@4.1.0-beta.60 2026-02-20 16:22:14 -08:00
Peter Wielander c1cd9a3bc7 Handle 410s gracefully for run completion/failure (#1147) 2026-02-20 16:09:14 -08:00
Vercel Release Bot 339c44fe1a Version Packages (beta) (#1131) workflow@4.1.0-beta.59 2026-02-20 15:17:31 -08:00
Nathan Rajlich b65bb072b5 Add AES-256-GCM encryption primitives and HKDF key derivation (#956)
* Add browser-compatible AES-GCM to core and HKDF key derivation to world-vercel

* update changeset

* Move HKDF key derivation server-side: API returns per-run derived key

* Refactor encrypt/decrypt to accept CryptoKey, export importKey for callers to import once per run

* Pass WorkflowRun entity to getEncryptionKeyForRun where available (avoids redundant lookup)

* .

* Refactor handleSuspension to accept WorkflowRun, pass run entity to getEncryptionKeyForRun

* Overload getEncryptionKeyForRun: accept context for start(), fetch WorkflowRun in resume-hook

* Split changeset into per-package descriptions for world, world-vercel, and core

* Remove unnecessary Uint8Array.from() wrapper around Buffer.from()

* Use zod to parse Vercel API response

* Address peter's comment
2026-02-20 22:47:54 +00:00
Peter Wielander c75de973fd Handle 409 errors gracefully for step_completed/failed/retrying (#1120) 2026-02-20 14:43:04 -08:00
Karthik Kalyan 289fc46a1c Add back sitemap code and add docs unit test (#1136)
* Bring back sitemap

* Bring back sitemap

* Add pre commit hooks for sitemap

* Add pre commit hooks for sitemap

* Fix failing queue test

* Revert queue test failure

* Add unit tests
2026-02-20 12:52:43 -08:00
Karthik Kalyan e82142f522 Fix failing queue test (#1139)
* Fix world-vercel queue header-injection tests.

Align mocked sendMessage assertions with the current QueueClient call shape and restore the shared setup helper so the new header tests run reliably in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add unit tests

* Update .changeset/chubby-symbols-return.md

Signed-off-by: Nathan Rajlich <n@n8.io>

---------

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
2026-02-20 11:09:51 -08:00
John Lindquist f63a944a6b docs(skills): add workflow-init skill (#1129)
Adds a workflow-init skill that guides users through setting up Vercel
Workflow DevKit. Auto-detects the user's framework from package.json,
then directs the agent to fetch the official getting-started guide from
useworkflow.dev. After setup, hands off to the /workflow skill.
2026-02-19 18:23:26 -08:00
Pranay Prakash ae6b81c412 Add tests for auto-injected VQS workflow/step ID headers (#1099)
Tests cover:
- Workflow payload -> x-workflow-run-id header
- Step payload -> x-workflow-run-id + x-workflow-step-id headers
- Health check payload -> no workflow headers
- Caller headers override auto-injected headers
- Delayed re-enqueue inherits headers for both payload types

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 18:06:17 -08:00
Pranay Prakash 14863bf622 fix(workflow): improve runtime API stub error message and fix SKILL.md streaming docs (#1077)
* fix(workflow): improve error message for runtime API usage in workflow context and fix SKILL.md streaming docs

The workflow stub error now tells users to move calls to a step function or outside the workflow context. Also corrects the SKILL.md streaming section which incorrectly stated getWritable() only works in steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: add changeset

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(skill): address PR feedback on SKILL.md

- Remove `npx workflow start` from debugging section (args can't easily be passed via CLI)
- Mention --json and --help flags for CLI inspection
- Add reminder to check AI docs for DurableAgent details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(skill): fix SKILL.md debugging section CLI commands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* other improvements

* fix(skill): address Copilot PR feedback on streaming examples

- Add missing imports and define all referenced variables
- Wrap writer.releaseLock() in finally blocks for safety
- Remove undefined `data`/`agent`/`messages` references
- Simplify examples to be self-contained and copy-pasteable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(skill): bump SKILL.md version to 1.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add skill version bump rule to CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: John Lindquist <johnlindquist@gmail.com>
2026-02-19 15:17:04 -08:00
Vercel Release Bot f4d168b012 Version Packages (beta) (#1045) workflow@4.1.0-beta.58 2026-02-19 15:16:28 -08:00
Casey Gowrie 29347b79ea New vercel queue client with v2beta consumers (#1096) 2026-02-19 22:24:15 +00:00
Peter Wielander 852e3f1788 Do not re-throw error when multiple workflow invocations race to complete/fail the workflow (#1118) 2026-02-18 14:00:47 -08:00
Nathan Rajlich ea3254e7ce Fix projectConfig.projectId containing project name instead of ID (#999)
* Fix projectConfig.projectId containing project name instead of ID

* add changeset

* Address review: fix changeset description, normalize slug-based project IDs, add clarifying comments
2026-02-18 02:03:31 -08:00
Nathan Rajlich 6e72b295e7 Add World.getEncryptionKeyForRun and thread encryption key through serialization (#979)
## Summary

- Adds `World.getEncryptionKeyForRun(run)` returning `Uint8Array | undefined` as the interface for retrieving per-run encryption keys
- Updates all 8 dehydrate/hydrate serialization functions to accept `key: Uint8Array | undefined`
- Updates runtime callers, CLI, and tests to thread the key parameter through
2026-02-18 00:53:49 -08:00
Nathan Rajlich 0d5323c0a7 Make serialization functions async (#978)
## Summary

- Makes all 8 dehydrate/hydrate serialization functions in `@workflow/core` async (returning `Promise<...>`)
- Updates all call sites across runtime, CLI, and test code to `await` the results
- Pure mechanical refactor — no functional changes, prerequisite for encryption support

Part 1 of the end-to-end encryption PR stack.
2026-02-17 23:18:44 -08:00
Karthik Kalyan 323da45b14 [web-shared] Minor perf hardening to minimize renders (#1104)
* [web-shared] reduce redundant render

* [web-shared] add changeset
2026-02-17 18:44:16 -08:00
Pranay Prakash 704661078f Auto-inject workflow run/step ID VQS headers from queue payload (#1098)
Move `x-workflow-run-id` and `x-workflow-step-id` header injection into
`world-vercel` queue implementation so callers don't need to set them
manually. The headers are extracted from the queue payload itself.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 21:44:06 +00:00
Karthik Kalyan 8a03a93b62 [web-shared] Improve liveness updates and fix bugs in Trace Viewer (#1086)
* [workflow o11y] Fix traceviewer bugs

* [workflow o11y] Fix traceviewer bugs - add changeset

* [workflow o11y] Fix react inspector state for open/close items

* [workflow o11y] Fix react inspector state for open/close items
2026-02-17 10:04:40 -08:00
Nathan Rajlich 54879835f3 Fix pages router default args: use empty array instead of [42] (#1081) 2026-02-17 01:47:48 -08:00
Nathan Rajlich 262ef3a21a Fix CLI missing specVersion in "run_cancelled" event payload (#1078)
The CLI's `cancelRun` in `packages/cli/src/lib/inspect/run.ts` sent `{ eventType: 'run_cancelled' }` without `specVersion`, causing the Vercel API's `/v2/runs/{id}/events` endpoint to reject the request with a 400 error. The core runtime's `cancelRun` already handled this correctly, so the fix removes the redundant CLI wrapper and calls the core implementation directly.

The bug was introduced in 4966b72 ("implement event-sourced architecture (#621)") which changed the CLI cancel from `world.runs.cancel(runId)` to `world.events.create(runId, ...)` but omitted `specVersion` from the payload. The same commit correctly included it in `Run#cancel()` in core — it was simply missed in the CLI path. A later commit (86a7930) added v1Compat branching but still never added specVersion. The final merged state in a2b688d (PR #894) still omits it.

Also adds a CLI cancel e2e test that starts a long-running workflow, cancels it via the CLI command, and verifies the run status.
2026-02-16 18:16:06 -08:00
JJ Kasper b733e2a173 Unlock canary Next.js version in tests and bump min deferred version (#1088)
* Unlock canary Next.js version

* bump min version
2026-02-16 17:27:16 -08:00
yao bcbdd024ef [nest] Support CommonJS compilation for NestJS projects (#982)
Signed-off-by: yao <zhangyaoruo@outlook.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-16 17:18:45 -08:00
Pranay Prakash 5e06a7c833 Materialize waits as entities to prevent duplicate wait_completed events (#1057)
* Handle 409 conflict when completing waits that were already completed

When multiple concurrent workflow invocations race to complete the same
wait, the server returns 409 (conflict) for duplicates. This change
handles the 409 gracefully in both runtime.ts (sleep elapsed check) and
runs.ts (wakeUpRun), preventing crashes and treating already-completed
waits as successful.

Also updates event-sourcing docs to reflect that waits are now
materialized as entities in storage with atomic completion guarantees.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Point e2e tests at workflow-server preview for wait materialization branch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Materialize waits as entities in local and postgres worlds to prevent duplicate wait_completed events

Adds Wait type/schema to the shared world package and implements wait entity
materialization in both local (filesystem) and postgres world implementations,
matching the DynamoDB behavior. wait_created creates a wait entity with status
'waiting', and wait_completed transitions it to 'completed' with guards that
reject duplicates (409).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix waitId to use composite key for consistency with postgres world

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clean up wait entities on terminal run states and register waits migration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clear WORKFLOW_SERVER_URL_OVERRIDE for merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update changeset for all affected packages and restore server URL override

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clear WORKFLOW_SERVER_URL_OVERRIDE now that server PR is merged

The server-side changes (vercel/workflow-server#265) have been merged to main
and deployed to production, so we no longer need to point at the preview URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:46:49 -08:00