workflow 5.2.3 → 5.4.0

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.
Files changed (48) hide show
  1. package/dist/api.d.ts +1 -1
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +1 -1
  4. package/dist/internal/errors.d.ts +1 -1
  5. package/dist/internal/errors.d.ts.map +1 -1
  6. package/dist/internal/errors.js +2 -2
  7. package/docs/api-reference/workflow/create-hook.mdx +8 -0
  8. package/docs/api-reference/workflow/create-webhook.mdx +1 -1
  9. package/docs/api-reference/workflow/fetch.mdx +2 -0
  10. package/docs/api-reference/workflow-api/get-hook-by-token.mdx +5 -1
  11. package/docs/api-reference/workflow-api/get-run.mdx +4 -0
  12. package/docs/api-reference/workflow-api/resume-hook.mdx +58 -2
  13. package/docs/api-reference/workflow-api/start.mdx +70 -3
  14. package/docs/api-reference/workflow-errors/hook-conflict-error.mdx +6 -3
  15. package/docs/api-reference/workflow-errors/in-band-superseded-error.mdx +68 -0
  16. package/docs/api-reference/workflow-errors/index.mdx +6 -0
  17. package/docs/api-reference/workflow-errors/meta.json +2 -0
  18. package/docs/api-reference/workflow-errors/precondition-failed-error.mdx +2 -0
  19. package/docs/api-reference/workflow-errors/workflow-start-error.mdx +58 -0
  20. package/docs/api-reference/workflow-errors/workflow-world-error.mdx +12 -1
  21. package/docs/api-reference/workflow-runtime/world/storage.mdx +1 -1
  22. package/docs/changelog/eager-processing.mdx +4 -0
  23. package/docs/changelog/index.mdx +1 -0
  24. package/docs/changelog/lazy-event-creation.md +1 -1
  25. package/docs/changelog/meta.json +1 -0
  26. package/docs/changelog/spec-9.mdx +4019 -0
  27. package/docs/changelog/turbo-mode.md +4 -0
  28. package/docs/configuration/cli-and-web-ui.mdx +4 -2
  29. package/docs/configuration/runtime-tuning.mdx +68 -2
  30. package/docs/configuration/worlds.mdx +13 -1
  31. package/docs/cookbook/advanced/child-workflows.mdx +127 -187
  32. package/docs/cookbook/common-patterns/batching.mdx +3 -1
  33. package/docs/cookbook/common-patterns/idempotency.mdx +11 -12
  34. package/docs/cookbook/common-patterns/sequential-and-parallel.mdx +1 -1
  35. package/docs/cookbook/common-patterns/workflow-composition.mdx +5 -5
  36. package/docs/errors/fetch-in-workflow.mdx +15 -29
  37. package/docs/foundations/errors-and-retries.mdx +6 -0
  38. package/docs/foundations/hooks.mdx +3 -1
  39. package/docs/foundations/idempotency.mdx +190 -60
  40. package/docs/foundations/starting-workflows.mdx +3 -7
  41. package/docs/how-it-works/event-sourcing.mdx +6 -0
  42. package/docs/whats-new.mdx +3 -1
  43. package/docs/worlds/building-a-world.mdx +28 -3
  44. package/docs/worlds/local.mdx +6 -0
  45. package/docs/worlds/postgres.mdx +208 -146
  46. package/docs/worlds/upgrading-to-v5.mdx +7 -1
  47. package/docs/worlds/vercel.mdx +9 -7
  48. package/package.json +11 -11
@@ -89,7 +89,7 @@ A follow-up builds two more latency wins on top of lazy inline start. Both are c
89
89
 
90
90
  Previously the owned-inline path ran **exactly one** step inline per suspension and queued the rest. For a `Promise.all([stepA(), stepB(), stepC()])` fan-out that meant one branch ran inline while the others paid a queue round-trip each before making any progress.
91
91
 
92
- The suspension handler now defers `step_created` for up to **`WORKFLOW_MAX_INLINE_STEPS` (default 3)** steps and returns them as `lazyInlineSteps`. The runtime runs that batch inline **in parallel** (`Promise.all`), each via its own lazy `step_started`, and queues only the steps beyond the cap.
92
+ The suspension handler now defers `step_created` for up to **`WORKFLOW_MAX_INLINE_STEPS` (default 3)** steps and returns them as `lazyInlineSteps`. The runtime runs that batch inline **in parallel**, each via its own lazy `step_started`, and queues only the steps beyond the cap. With [`WORKFLOW_INLINE_EARLY_ADVANCE`](/docs/configuration/runtime-tuning#workflow_inline_early_advance) the runtime replays as soon as one step of the batch settles, so steps still running hold their slots and a later suspension gets fewer.
93
93
 
94
94
  - **Selection:** the first N uncreated steps, matching the previous single-step inline candidate. Steps beyond N keep their eager `step_created` and are queued exactly as before.
95
95
  - **Result aggregation:** `retry` steps (whose `step_started` succeeded, so the step exists) are re-queued per-step as background steps with their own delay. `throttled` steps are different: a throttle rejects the lazy `step_started` on the create-claim, so the step was *never created* and has no recoverable input. Re-queuing it as an input-less background step would make the world reject the bare `step_started` with "Step not found" and redeliver until it fails. Any throttle instead **defers redelivery of the orchestrator** (by the longest throttle backoff in the batch), which re-runs the throttled step inline *with its input* on replay. The runtime only loops back to replay in-process once every inline step has reached a terminal state.
@@ -2,6 +2,7 @@
2
2
  "title": "Changelog",
3
3
  "pages": [
4
4
  "index",
5
+ "spec-9",
5
6
  "lazy-hook-resume",
6
7
  "eager-processing",
7
8
  "resilient-resume",