Add TSDoc for stepName field and document world.steps API#1451
Conversation
Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1773936163539109?thread_ts=1773936163.539109&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (56 failed)mongodb (3 failed):
redis (2 failed):
turso (51 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
There was a problem hiding this comment.
Pull request overview
This PR improves developer-facing documentation around the stepName field and the world.steps API surfaced via getWorld(), to make it easier to build progress UIs without hardcoding step labels.
Changes:
- Added TSDoc for
stepNameon theStepschema in@workflow/world. - Added
getWorld()documentation examples for listing steps and fetching a single step, highlightingstep.stepName.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/world/src/steps.ts | Adds TSDoc explaining the intent of stepName on the Step schema. |
| docs/content/docs/api-reference/workflow-api/get-world.mdx | Adds examples demonstrating world.steps.list and world.steps.get, including stepName usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…eStepName/parseWorkflowName utilities - Split step examples into two: one with resolveData: 'none' for efficient listing without data, and one showing how to hydrate input/output with observabilityRevivers - Add TSDoc to stepName and workflowName fields explaining the machine-readable format and how to use parse utilities - Document parseStepName() and parseWorkflowName() from @workflow/utils/parse-name for extracting shortName and moduleSpecifier for UI display - Add Callout explaining the naming format
| import { // [!code highlight] | ||
| hydrateResourceIO, // [!code highlight] | ||
| observabilityRevivers, // [!code highlight] | ||
| } from "@workflow/core/serialization-format"; // [!code highlight] |
There was a problem hiding this comment.
@karthikscale3 this i why we need to just hydrate it automatically in the world I think instead of asking people to import these
or at the lease, we should re-export these from a more user friendly place (probably @workflow/world or workflow/api) and rename + document them so they're much friendlier to use
happy to ship this for now so it's at least useful for for people and agents to have a way to query this data and we can ITG on the workflow observability APIs
There was a problem hiding this comment.
yea agreed! I will take a stab at this and also will do a general audit of the entire CLI.
The
stepNamefield from PR #1285 was already wired through to theStepentity schema returned bygetWorld(), but it lacked documentation.What changed
stepNamefield inpackages/world/src/steps.tsexplaining it's the human-readable step function name useful for progress UIsgetWorld()docs showing how to list steps and get a single step, demonstrating usage ofstep.stepNamefor building progress tracking UIsThis addresses Lucas's feedback about needing to hardcode step-index-to-label mappings - the
stepNamefield is now clearly documented as the way to get human-readable step names.