Conversation
Adds a practical how-to page for step metadata following Diataxis. Covers attaching metadata to steps, custom kinds, batching, explicit scoping, cross-run updates, external updates, and dashboard viewing. Explanation content folded inline as context rather than standalone. DEV-276
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
djfarrelly
left a comment
There was a problem hiding this comment.
Hey @Benanna2019 - I like a lot of parts about this and I actually think this could be the default guide in the main "Learn" side of the docs and the other guide should be in the "Reference" tab.
With that in mind, I'd love for the intro to kind of frame the problem a little bit more. I think with just a little bit of "what this is for" / "what problem am do I need solved" - this guide would hit home really hard for folks. There's lots to like here, but I think we could get it to "click" for readers a lot faster then the examples in this flow get them there really fast which is great for a how-to.
|
|
||
| export const description = "Practical guides for attaching metadata to steps and runs, using custom kinds, batching updates, and working with cross-run metadata."; | ||
|
|
||
| # Step metadata how-to <VersionBadge version="TypeScript only" /> |
There was a problem hiding this comment.
note: just an open question before this is added to the public docs if we call this "run metadata" "metadata" or "step metadata" - "step metadata" is our internal name and this feature more attaches metadata to runs, not steps.
|
|
||
| This page walks through common tasks with step metadata. For the full API surface, see the [step metadata reference](/docs/features/inngest-functions/steps-workflows/metadata). | ||
|
|
||
| ## Attach metadata to a step |
There was a problem hiding this comment.
thought: I don't think this attaches metadata "to a step" itself, but rather attaches metadata to a run itself, it just gets tracked within it's own step. When I read "to a step" it makes me think that it'd be attaching metadata to an existing step like "process-payment"
There was a problem hiding this comment.
thought: I think the key thing that is missing for me from this intro section is "why" would I use this? is it worth explaining why you'd do this? e.g. Attaching useful metadata about the run to help you debug or add extra context when looking at individual traces. Then sharing there are 2 key ways to add metadata, from within a step (inngest.metadata) and from anywhere with the function handler (step.metadata).
One meta thought on this is what's the goal of the guide, I know you mentioned diataxis the other day, and when thinking about this how-to guide and was wondering what the problem is that they're solving - even a little context above this could frame the user to saying "I'm adding metadata to my run for debugging - this is how you want to do it" (run level, add it this way, within a step, add it this way...)
| ); | ||
| ``` | ||
|
|
||
| In the dashboard, these show up as separate sections: "User Metadata (billing)" and "User Metadata (analytics)". This keeps things readable when a step has several categories of metadata. |
pages/docs/features/inngest-functions/steps-workflows/step-metadata-how-to.mdx
Show resolved
Hide resolved
- Rename from "Step metadata" to "Metadata" per team consensus - Add intro explaining why you'd use metadata (debugging, business context, annotating traces) - Reframe "Attach metadata to a step" as "Add metadata to a run" since step.metadata attaches to the run, tracked in its own step - Clarify both approaches: step.metadata for standalone updates, inngest.metadata for updates within an existing step DEV-276
Lead with metadata as a step method alongside step.run, step.sleep, step.waitForEvent. Rework intro and first section so the mental model is clear: step.metadata creates a step that attaches metadata to the run, the memoization ID works like any other step ID. DEV-276
Summary
Adds a practical how-to page for step metadata following the Diataxis framework. Each section is a discrete task with code and just enough context inline:
step.metadataandinngest.metadatainsidestep.run)Explanation content (batched vs API path, durability) is folded inline as context rather than a standalone section.
Companion to the reference page PR. Relates to DEV-276.
Requested reviewers
@AndyInternet @djfarrelly