Update and reorg sessions page with propagation - #1830
Conversation
A run's sessions now automatically propagate into events created by that run (step.sendEvent, step.invoke, inngest.send, defer, and lifecycle events). Replace the "Sessions and steps" section — which documented the old non-inherited behavior — with a "Session propagation" section covering how propagation works, overriding and clearing propagated sessions, disabling propagation on the client, and runtime caveats. Split the unchanged step.waitForEvent behavior into its own section, add a middleware note, and update "Supported values" now that null is a valid value for clearing a session. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a "Sessions and batching" section distinguishing the run's own session association (union of all batch events' sessions, first 25 unique pairs) from propagated sessions (intersection across all batch events, limited to 5). Link the batched-function limit to the new section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Line-for-line moves only — review with --color-moved=dimmed-zebra. Move the dashboard and historical-search sections up after "Add sessions to an event", followed by "Choose a good session key" and the reference sections (Supported values, Limits), so propagation and other interactions come last. Move the SDK version callout next to the code sample it qualifies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Content changes on top of the pure-move reorder: split the high-cardinality callout and one-off-filtering paragraph into a "When not to use sessions" section, replacing the historical-lag callout it duplicated; rename "Use sessions for historical search" to a "Data freshness" subsection of the dashboard section; and note the 5-session limit alongside the send example. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Solid reorg overall; the main issue is the new middleware example at the end, which references a meta.propagated_sessions field that doesn't exist anywhere else in the doc — every other example (including the "overriding propagated sessions" section a few paragraphs above) treats propagated and manual sessions as merged into the single meta.sessions object. This will confuse readers about which field to actually read/write.
Re-review (2026-08-06): Only new commit since the last review fills in the SDK version placeholder (vX.Y.Z → inngest-js v4.18.0) for session propagation and removes the "Add in the releasing version" TODO comment. No functional or content issues introduced by this change.
| // Runs for `step.sendEvent()` and `inngest.send()`. | ||
| transformSendEvent(arg: Middleware.TransformSendEventArgs) { | ||
| for (const event of arg.events) { | ||
| delete event.meta?.propagated_sessions?.internal_trace_id; |
There was a problem hiding this comment.
This references event.meta?.propagated_sessions, but that field is never introduced anywhere else in the doc. Every other example in this page (including "Overriding propagated sessions" just above) treats propagated and manual sessions as living together in the single meta.sessions object (e.g. meta.sessions.conversation_id = null to override/clear). If propagated_sessions is a real distinct field on the wire, it needs to be documented; if not, this should be event.meta?.sessions?.internal_trace_id.
| transformStepInput(arg: Middleware.TransformStepInputArgs) { | ||
| if (arg.stepInfo.stepType === "invoke") { | ||
| const opts = arg.input[0] as { payload: { meta?: EventMeta } }; | ||
| delete opts.payload.meta?.propagated_sessions?.internal_trace_id; |
There was a problem hiding this comment.
Same propagated_sessions field used here as in the transformSendEvent example above — also, this casts arg.input[0] to { payload: { meta } }, but the step.invoke() example earlier in this same page passes meta as a top-level property alongside data/function, not nested under payload. Worth double-checking this snippet actually matches the real shape of input[0] for an invoke step before publishing.
|
|
||
| Good examples: | ||
| {/* Add in the releasing version */} | ||
| A run's sessions automatically propagate into events created by that run, starting in JS SDK vX.Y.Z. |
There was a problem hiding this comment.
Need to replace vX.Y.Z once we have the real version
There was a problem hiding this comment.
Added in the projected version, will reconfirm closer in
| ```tsx | ||
| const inngest = new Inngest({ | ||
| id: "my-app", | ||
| sessionPropagation: false, // disable propagation in this client for inngest.send, step.sendEvent, step.invoke, and defer |
There was a problem hiding this comment.
Are there any other parts of the docs we need to mention sessionPropagation? For example /typescript/v4/client/create.mdx
There was a problem hiding this comment.
Yes, pulled those into https://github.com/inngest/website/pull/1832/changes#diff-d21c2eefacb46157a333baa0231d7b07fe36eff832aa9e799a7a1cf185923279 - including create.mdx
Uh oh!
There was an error while loading. Please reload this page.