@workflow/core 5.1.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/global.d.ts +10 -0
- package/dist/global.d.ts.map +1 -1
- package/dist/global.js +11 -1
- package/dist/private.d.ts +11 -0
- package/dist/private.d.ts.map +1 -1
- package/dist/private.js +13 -2
- package/dist/runtime/constants.d.ts +36 -8
- package/dist/runtime/constants.d.ts.map +1 -1
- package/dist/runtime/constants.js +37 -9
- package/dist/runtime/lifecycle-hooks.d.ts +10 -6
- package/dist/runtime/lifecycle-hooks.d.ts.map +1 -1
- package/dist/runtime/lifecycle-hooks.js +54 -15
- package/dist/runtime/out-of-band-observation.d.ts +159 -0
- package/dist/runtime/out-of-band-observation.d.ts.map +1 -0
- package/dist/runtime/out-of-band-observation.js +44 -0
- package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -1
- package/dist/runtime/quickjs-entrypoint.js +24 -12
- package/dist/runtime/start.d.ts +16 -0
- package/dist/runtime/start.d.ts.map +1 -1
- package/dist/runtime/start.js +14 -7
- package/dist/runtime/step-executor.d.ts.map +1 -1
- package/dist/runtime/step-executor.js +14 -1
- package/dist/runtime/suspension-handler.d.ts.map +1 -1
- package/dist/runtime/suspension-handler.js +9 -7
- package/dist/runtime/vm-mode.d.ts +28 -4
- package/dist/runtime/vm-mode.d.ts.map +1 -1
- package/dist/runtime/vm-mode.js +40 -6
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +69 -1
- package/dist/serialization/client.d.ts.map +1 -1
- package/dist/serialization/client.js +4 -2
- package/dist/serialization/compression.d.ts +14 -3
- package/dist/serialization/compression.d.ts.map +1 -1
- package/dist/serialization/compression.js +17 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +2 -2
- package/dist/workflow/hook.d.ts.map +1 -1
- package/dist/workflow/hook.js +72 -24
- package/dist/workflow.js +2 -1
- package/docs/foundations/hooks.mdx +43 -0
- package/docs/foundations/serialization.mdx +15 -0
- package/docs/foundations/starting-workflows.mdx +8 -0
- package/docs/foundations/streaming.mdx +8 -0
- package/docs/foundations/versioning.mdx +3 -2
- package/docs/how-it-works/event-sourcing.mdx +9 -1
- package/package.json +6 -6
|
@@ -81,7 +81,8 @@ This keeps the version boundary visible. The old run ends as canceled or failed,
|
|
|
81
81
|
# Inspect affected runs and copy the exact workflowName value.
|
|
82
82
|
npx workflow inspect runs \
|
|
83
83
|
--backend vercel \
|
|
84
|
-
--status running
|
|
84
|
+
--status running \
|
|
85
|
+
--json
|
|
85
86
|
|
|
86
87
|
# Cancel one run.
|
|
87
88
|
npx workflow cancel <run-id> \
|
|
@@ -94,7 +95,7 @@ npx workflow cancel \
|
|
|
94
95
|
--backend vercel
|
|
95
96
|
```
|
|
96
97
|
|
|
97
|
-
The
|
|
98
|
+
The `workflow cancel --workflowName` filter expects the generated workflow ID, not only the exported function's short name. Copy the `workflowName` value from `workflow inspect runs --json`, since the runs table shows the short name, and use [`parseWorkflowName()`](/docs/api-reference/workflow-observability/parse-workflow-name) when you need display-friendly names.
|
|
98
99
|
|
|
99
100
|
In the [observability UI](/docs/observability), use **Rerun on latest** to enqueue the workflow again with the same inputs against the latest deployment.
|
|
100
101
|
|
|
@@ -207,7 +207,7 @@ Events are categorized by the entity type they affect. Each event contains metad
|
|
|
207
207
|
|
|
208
208
|
Counting the events above is how you size a run. A step that succeeds on the first attempt contributes three events; a retry adds another `step_started`, preceded by a `step_retrying` when the World emits one; a sleep contributes two, and a hook at least two.
|
|
209
209
|
|
|
210
|
-
A run's log is capped — the [Vercel World](/worlds/vercel#per-run-limits) fails anything past its ceiling with `MAX_EVENTS_EXCEEDED`. Replay reads the whole log, so a run gets slower as it grows and is worth splitting well before it fails: split into [child workflows](/cookbook/advanced/child-workflows) once a run would grow past a few thousand events.
|
|
210
|
+
A run's log is capped — the [Vercel World](/worlds/vercel#per-run-limits) fails anything past its ceiling with `MAX_EVENTS_EXCEEDED`. Replay reads the whole log, so a run gets slower as it grows and is worth splitting well before it fails: split into [child workflows](/cookbook/advanced/child-workflows) once a run would grow past a few thousand events. How much the growth costs depends on how often the run replays; [Steps and long runs](/docs/performance#steps-and-long-runs) shows how step-to-step overhead changes through a 1,020-step run.
|
|
211
211
|
|
|
212
212
|
## Terminal states
|
|
213
213
|
|
|
@@ -373,3 +373,11 @@ An event ID is a **slot number**: the event's 1-based position in the run's even
|
|
|
373
373
|
Density is what lets a reader tell a complete log from an incomplete one by its length alone. A replay that loads a log with a position missing below the highest one it can see cannot tell an event that was never written from one it failed to read, so it fails the run with [`CORRUPTED_EVENT_LOG`](/docs/errors/corrupted-event-log) rather than replay across the hole. See [`WORKFLOW_SLOT_GAP_CHECK`](/docs/configuration/runtime-tuning#workflow_slot_gap_check).
|
|
374
374
|
|
|
375
375
|
A slot ID carries no timestamp. Zero-padded decimal digits are a subset of the ULID alphabet, so a slot ID passes ULID validation and sorts correctly, but decoding its first 48 bits yields the Unix epoch instead of a creation time. Read `createdAt` on the event when you need to know when it was written, and don't decode the time from an `evnt_` ID you get back from an API, a log line, or a cursor.
|
|
376
|
+
|
|
377
|
+
## Performance
|
|
378
|
+
|
|
379
|
+
Step-to-step overhead (STSO) measures the time the runtime adds between two steps: from one step finishing until the next one starts, which covers recording the step's result, resuming the workflow, and starting the next step. The work inside each step isn't counted. The animation shows where that gap starts and stops.
|
|
380
|
+
|
|
381
|
+
<MetricVideo metric="stso" />
|
|
382
|
+
|
|
383
|
+
See [Step-to-step overhead](/docs/performance#step-to-step-overhead-stso) on the Performance page for how it's measured and the latest results.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow/core",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "Core runtime and engine for Workflow SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"@standard-schema/spec": "1.0.0",
|
|
90
90
|
"@types/ms": "2.1.0",
|
|
91
91
|
"@vercel/functions": "^3.8.0",
|
|
92
|
-
"@workflow/errors": "5.0.
|
|
92
|
+
"@workflow/errors": "5.0.4",
|
|
93
93
|
"@workflow/serde": "5.0.0",
|
|
94
|
-
"@workflow/utils": "5.0.
|
|
95
|
-
"@workflow/world": "5.0.
|
|
96
|
-
"@workflow/world-local": "5.
|
|
97
|
-
"@workflow/world-vercel": "5.1
|
|
94
|
+
"@workflow/utils": "5.0.2",
|
|
95
|
+
"@workflow/world": "5.0.4",
|
|
96
|
+
"@workflow/world-local": "5.1.1",
|
|
97
|
+
"@workflow/world-vercel": "5.2.1",
|
|
98
98
|
"acorn": "8.15.0",
|
|
99
99
|
"debug": "4.4.3",
|
|
100
100
|
"devalue": "5.9.2",
|