blog: fix flow, add headless section, and tidy schemas in AI orchestration post#952
Conversation
…ration post - Move the workflow example above the install section so the concept comes first - Remove a duplicated lifecycle-events sentence and reorder the workflow explanation - Add a "Run it without a UI" section covering headless server-only runs - Reuse the editor agent output schema instead of redeclaring it inline - Export/import the workflow input/output schemas instead of re-declaring them in the React and orchestrator examples - Fix the yield* formatting mangled during the original merge - Remove the "What is still experimental?" section and merge the two closing sections into one
📝 WalkthroughWalkthroughThis PR updates the TanStack AI Workflows & Orchestrators blog post to refactor code examples around reusable schema exports, introduce headless execution patterns alongside React consumption, and restructure introductory guidance sections. ChangesAI Workflows & Orchestrators Blog Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/blog/tanstack-ai-orchestration.md`:
- Line 158: The paragraph starting "Why async generator workflows?" repeats the
phrase "You can" at the start of three consecutive sentences; reword the second
and third sentences to vary openings and improve flow (e.g., turn "You can build
a graph DSL" into "Build a graph DSL" or "Use a graph DSL", and change "You can
describe a DAG..." to "Describe a DAG..." or "Describe a DAG and ask the runtime
to interpret it"), keeping the original meaning and cadence so the explanation
of alternative workflow models remains clear.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7cbbb324-1813-4475-948b-42e6590a0e51
📒 Files selected for processing (1)
src/blog/tanstack-ai-orchestration.md
| The workflow body is just TypeScript. Use `if`, `for`, `while`, `try`, `await`, helper functions, and whatever domain code you already have. The orchestration runtime only cares about the things you `yield*`. | ||
|
|
||
| Each `yield* agents.someAgent(...)` becomes a typed step. The runtime can emit lifecycle events around it, stream text while it runs, validate the result, snapshot state, and resume the generator with the typed output. | ||
| Why async generator workflows? There are a lot of ways to model agent workflows. You can build a graph DSL. You can define nodes in JSON. You can describe a DAG and ask the runtime to interpret it. The reason we went with generator workflows is that whenever you yield the agent's step, it's streamed straight down to the client. The user sees everything in real time — tool calls, reasoning, whatever happens along the way — and by the end you just get the final output back. |
There was a problem hiding this comment.
Tighten repeated sentence openings in this paragraph.
Three consecutive sentences start with “You can,” which makes the flow feel repetitive in an otherwise strong section. A small reword here will read cleaner.
🧰 Tools
🪛 LanguageTool
[style] ~158-~158: Consider using a synonym to be more concise.
Context: ...hy async generator workflows? There are a lot of ways to model agent workflows. You can ...
(A_LOT_OF)
[style] ~158-~158: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...raph DSL. You can define nodes in JSON. You can describe a DAG and ask the runtime ...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/blog/tanstack-ai-orchestration.md` at line 158, The paragraph starting
"Why async generator workflows?" repeats the phrase "You can" at the start of
three consecutive sentences; reword the second and third sentences to vary
openings and improve flow (e.g., turn "You can build a graph DSL" into "Build a
graph DSL" or "Use a graph DSL", and change "You can describe a DAG..." to
"Describe a DAG..." or "Describe a DAG and ask the runtime to interpret it"),
keeping the original meaning and cadence so the explanation of alternative
workflow models remains clear.
What
Fixes and tightens the recently-merged Introducing Experimental Workflows and Orchestrators in TanStack AI blog post (
src/blog/tanstack-ai-orchestration.md, originally from #949).Changes
runWorkflowstream and reading the result viarunStore.getRunState(runId). Grounded in the PR-branch API docs, including the approval-pauses caveat.editoragent references a namedEditorReviewSchemainstead of redeclaring the same Zod object twice. The workflowinput/outputschemas are exported and imported in the React and orchestrator examples instead of being re-declared.yield*in the approval snippet (the original merge reformatted it into a brokenyield *).Docs/blog content only — no code or runtime changes.
Summary by CodeRabbit