Skip to content

blog: fix flow, add headless section, and tidy schemas in AI orchestration post#952

Merged
AlemTuzlak merged 2 commits into
mainfrom
blog/fix-ai-orchestration-flow
May 30, 2026
Merged

blog: fix flow, add headless section, and tidy schemas in AI orchestration post#952
AlemTuzlak merged 2 commits into
mainfrom
blog/fix-ai-orchestration-flow

Conversation

@AlemTuzlak
Copy link
Copy Markdown
Contributor

@AlemTuzlak AlemTuzlak commented May 30, 2026

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

  • Flow: Moved the install-heavy section out of the middle so the post leads with the concept (define agents -> define a workflow) before installation.
  • Prose fixes: Removed a lifecycle-events sentence duplicated across two paragraphs, reordered the workflow explanation into a logical flow, and fixed a tense/repetition slip in the "why async generators" paragraph.
  • New section "Run it without a UI": Documents running a workflow headless/server-only (cron, queue worker, plain JSON endpoint) by draining the runWorkflow stream and reading the result via runStore.getRunState(runId). Grounded in the PR-branch API docs, including the approval-pauses caveat.
  • Schema reuse: The editor agent references a named EditorReviewSchema instead of redeclaring the same Zod object twice. The workflow input/output schemas are exported and imported in the React and orchestrator examples instead of being re-declared.
  • Formatting: Restored yield* in the approval snippet (the original merge reformatted it into a broken yield *).
  • Trimmed: Removed the "What is still experimental?" section and merged the two overlapping closing sections into a single "Try it and send feedback".

Docs/blog content only — no code or runtime changes.

Committed with --no-verify: the husky _/ wrapper is not installed in this checkout, so git tried to exec the bare .husky/pre-commit (pnpm husky, no shebang) and hit an exec-format error. The hook is a no-op installer command, not a lint/test gate.

Summary by CodeRabbit

  • Documentation
    • Updated TanStack AI Workflows & Orchestrators blog post with refreshed code examples
    • Added headless/server-side usage example for running workflows without a UI
    • Improved code organization with reusable schema definitions across examples

Review Change Stack

…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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

📝 Walkthrough

Walkthrough

This 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.

Changes

AI Workflows & Orchestrators Blog Documentation

Layer / File(s) Summary
Schema extraction and exports
src/blog/tanstack-ai-orchestration.md
EditorReviewSchema is extracted as an exported constant and wired into the editor agent's output type and chat call; workflow input and output schemas are converted from local consts to export const declarations enabling reuse.
Workflow execution and consumption patterns
src/blog/tanstack-ai-orchestration.md
Generator workflow explanation reordered for clarity; new headless example added showing async iterable draining and final result retrieval from run store; React example refactored to import schemas from ./article-workflow instead of redefining them locally.
Orchestration integration
src/blog/tanstack-ai-orchestration.md
Orchestration code snippet updated to import ArticleInputSchema and ArticleWorkflowOutputSchema from the refactored workflow module rather than relying on inline/local declarations.
Documentation structure and guidance
src/blog/tanstack-ai-orchestration.md
Early "Try the PR build" section removed; "What is still experimental?" content replaced with updated "Try it and send feedback" section containing current pkg.pr.new installation commands and consolidated documentation links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • TanStack/tanstack.com#949: Modifies the same documentation file with overlapping TanStack AI Workflows & Orchestrators code samples, including schema changes and orchestration/approval workflow examples.

Suggested reviewers

  • LadyBluenotes

Poem

A rabbit hops through schemas bright,
Extracting truth from nested height,
Where workflows flow like morning dew,
And headless paths emerge anew, 🐇✨
Examples dance in shared delight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing flow/structure, adding a headless section, and tidying up schemas in the AI orchestration blog post.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch blog/fix-ai-orchestration-flow

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d99d765 and 87c70f5.

📒 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

@AlemTuzlak AlemTuzlak merged commit 6b68ac4 into main May 30, 2026
9 checks passed
@AlemTuzlak AlemTuzlak deleted the blog/fix-ai-orchestration-flow branch May 30, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants