* Statically inject workflow world target
* Fix static world injection in host bundles
* Fix static world injection gaps
* Fix Vite Nitro server startup
* Fix Nitro pg-native aliasing
* Fix static world target CI gaps
* Fix static world dev rebuild gaps
* Avoid broad runtime alias in Nitro
* Refresh Next dev route for step HMR
* Externalize Nest target world
* Use canary HMR rediscovery timeout
* Bundle local world in Nest builds
* Dedupe world target helpers and fix SvelteKit chunk patch guard
The test server's flow handler awaited flowPOST before incrementing the
invocation counter, which races with the test polling getRun() to see
the completed status. When the workflow completed inside flowPOST and
flushed the run to the DB, the test could observe the completed state
and immediately query /_flow-invocations before the counter was bumped,
yielding a flaky 'expected 0 to be 1' assertion.
Increment the counter before awaiting flowPOST so the count is
observable as soon as the run transitions to completed.
## 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
* Remove "workflow/internal/serialization" export
Was only being used in these two e2e test files and the data being passed in those tests don't rely on any specialized data types, so just use JSON there.
* Fix: Removing the `workflow/internal/serialization` export from package.json breaks 5 files in `packages/world-testing` that still import `hydrateWorkflowReturnValue` from that path.
Co-authored-by: TooTallNate <n@n8.io>
* lockfile
---------
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
The `idempotency` test was running **110 concurrent steps** (10 + 100), with each step requiring multiple filesystem operations in the local world:
1. **Step creation** - writes step JSON file
2. **Step update** - reads and overwrites step JSON file
3. **Event creation** - writes event JSON file
That's ~3-4 file operations per step × 110 steps = **330-440 total file operations**.
On Windows, this is especially slow because:
- **NTFS** is slower than ext4/APFS for small file writes
- **Windows Defender** real-time scanning adds latency to new file creation
- The **atomic write pattern** (write temp file → rename) is slower on Windows
Reduced the number of steps from **110 to 20** (5 + 15 instead of 10 + 100):
**`workflows/noop.ts`**:
- First batch: 10 → 5 steps
- Second batch: 100 → 15 steps
**`src/idempotency.mts`**:
- Updated assertion to expect 20 numbers instead of 110
This is ~5.5x fewer file operations while still testing the same concurrent step execution and idempotency behavior. The test should now complete well within the 60-second timeout even on slow Windows CI machines.
* postgres: use non-deprecated drizzle signatures
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* postgres: store metadata in the hook
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* core: do not rely on module cache for world config. instead, use a global and a symbol.
this makes sure that streamers can use in-memory event emitters and that it won't be compiled away into the different flow.js and step.js files.
this was figured out when i was adding a hooks tests to world-testing.
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* add postgres world to all workbench packages
we try to run them with the postgres world but it's not installed
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* Replace jsonb with cbor because zero byte does not work in jsonb :(
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* fix error handling: attempts start at 0 now, and not 1 like when we released. so initial attempt in postgres should reflect that.
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* drain stuff
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* fallback metadata to metadataJson
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* Make code more readable
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
* apply Vade fix
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
---------
Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>