Skip to main content
Agent Flows let you compose typed nodes into a graph that runs as a real LangGraph agent: pull from the knowledge graph, research the web, call MCP tools, classify and route, fan out work in parallel, pause for human review, and generate documents — then let the chat agent launch the whole thing as a background sub-agent, or run it from the canvas. This cookbook is a set of example flows that have been run end-to-end and validated, the reusable patterns behind them, and step-by-step instructions for building each in the admin canvas (AI & Agents → Agent Flows).
Every example below was built, published, run, and checked against its real output (knowledge-graph rows, live web results, generated .docx files, MCP calls). Where a flow uses a question, point it at data you actually have — the demo knowledge graph contains Project and Deliverable data, so “list our projects” / “what deliverables exist” return real results.
Looking for what a specific block does, its settings, and which one to pick? See the Flow Blocks Reference — a plain-language guide to every node type, with decision helpers (classify vs extract vs generate, Map vs Loop, KG Query vs research agents, and more).

The node palette at a glance

How data flows: an edge sets execution order; the data flows through each node’s input bindings. Connecting two nodes auto-wires compatible ports, and you can drag port-to-port to wire a specific value. To feed the user’s request into a node, bind the input to Chat message ($.params.message) — the chat agent forwards it when it launches the flow. To pass one node’s output to another, bind to $.nodes.<id>.outputs.<port>.Execution order also takes those reads into account: a value read from another node — whether through an input binding or a {{ nodes.<id>.outputs.<port> }} reference in a prompt — counts as a dependency, not just the edges you drew. That’s a safety net, not a substitute for wiring: when a node reads from a node that isn’t upstream of it, publishing isn’t blocked — and the read can resolve to nothing, so the node runs on an empty input and still reports success. Adding that edge is the reliable fix.

Recipe 1 — Answer from the knowledge graph

Use it for: grounded Q&A over your own data (projects, deliverables, contracts, people…).
  • Knowledge Graph Query: set Output mode = report (returns a written, cited answer, not just rows). Bind its query input to Chat message so the user’s question drives it.
  • end: bind result ← Knowledge Graph Query.text.
How to build: New flow → drag Knowledge Graph Query from DATA → connect start → KG → end → select the KG node → Output mode = report → wire its query input to Chat message → wire end.result to the KG text output → Publish → enable the Sub-agent toggle and write a description so the chat agent can launch it (or use the Run tab). Validated: returns real Project/Deliverable rows with an evidence-cited narrative.

Recipe 2 — Research the web

Use it for: current, externally-sourced answers with citations.
  • Web research agent: set the goal to your question (it supports {{ params.message }} to use the chat message). It runs multiple live searches and returns a sourced report on its text output.
  • end: result ← Web research agent.text.
Validated: ran live Tavily searches and produced a sourced brief (e.g. a Python 3.13 summary citing the official “What’s New” page).

Recipe 3 — Combine the graph and the web into one cited answer

Use it for: “answer using what we know internally plus what’s current on the web,” with [KG] / [Web] attribution.
  • The two sources run in parallel; LLM generate waits for both (a node with two incoming edges auto-defers until both finish).
  • LLM generate prompt fuses both: reference {{ nodes.web_research.outputs.text }} and bind its context input to the KG node’s text; instruct it to tag claims [KG] vs [Web](url), note agreements/conflicts, and end with a Sources list.
  • end: result ← LLM generate.text.
Don’t use Merge + Knowledge Graph Query (report mode) to “combine” the two sources — Merge is for Condition fan-outs (it forwards one branch), and Knowledge Graph Query (report mode) only writes from a knowledge-graph retrieval handoff. The general writer for fusing arbitrary sources is LLM generate.

Recipe 4 — Classify, then route

Use it for: sending different question types down different paths.
  • LLM classify labels the input (e.g. technical | general); Condition routes on that label; the unused branch is skipped; Merge converges the chosen branch to end.
Validated: a technical question classified technical, routed to the technical branch (general branch correctly skipped), and produced a grounded answer.

Recipe 5 — Research → write a report → Word document

Use it for: turning a research request into a polished, downloadable deliverable.
  • Web research agent gathers sourced findings → LLM generate writes a structured report from them → Generate DOCX renders it to a .docx artifact you can download.
Validated: produced a 40 KB Word document (54 paragraphs) from a live web research pass.
Give the Web research agent a reasonable budget (≈12+ model calls). Very small budgets can exhaust mid-investigation.

Recipe 6 — Knowledge graph → structured extraction → document

  • Pull grounded data from the graph, LLM extract it into a typed structure (e.g. a list of {name, …} objects), then render a document.
Validated: KG returned 39 rows (MATCH (p:Project)-[:HAS_DELIVERABLE]->(d:Deliverable)), extracted structured names, and produced a 90-paragraph .docx.

Recipe 7 — Let an orchestrator decide

Use it for: open-ended requests where you can’t predict which sources are needed; the agent picks and iterates.
  • Give the Orchestrator a goal and a set of allowed tools (other nodes become its tools). At runtime it decides whether to query the graph, research the web, generate a document, or combine them — and writes the final answer itself.
When to prefer it: open-ended/iterative tasks. For always-run-both-in-parallel with a fixed shape, prefer Recipe 3 (deterministic, predictable cost).

Recipe 8 — MCP action (call external tools)

Use it for: taking actions or fetching data through a configured MCP server.
  • Point MCP action at a configured MCP server (admin MCP Servers) and whitelist the tools it may use.
Validated: a live run against the time-mcp server returned the real current UTC time.
Servers that need OAuth (Google, Slack, HubSpot…) must be connected first. No-auth servers (e.g. time, sequential-thinking) work immediately.

Recipe 9 — Human-in-the-loop (review & approve)

Use it for: anything that needs sign-off before it finalizes.
  • Human review pauses the run and surfaces the draft in the conversation’s flow-run panel (and, for staff, the Agent Inbox); a reviewer approves (or rejects with feedback). On approval the flow resumes; on rejection you can loop back to revise.
If your flow can pause on two reviews at once (parallel branches), every pending question is listed together and the reviewer can answer them in any order, without waiting between them — an answer given while the run is still applying the previous one is held and submitted automatically. See Several questions at once.
Feed the reviewer’s note into the revise step. The review card lets the reviewer add a note — optional on approve, required on reject. Bind it into the revise step’s prompt so the feedback actually drives the rewrite:
Route the loop on {{ nodes.<review_id>.outputs.decision }} ("approved" / "rejected") — or the boolean {{ nodes.<review_id>.outputs.approved }} — so a rejection goes back to LLM generate (revise) with the note applied, and an approval finishes the run. See the Human review node for the full list of outputs.
If a document step follows the review, bind it to the review’s content, not to the draft. The reviewer can edit what they were shown, and content is the port that carries the edited version (it is simply what they saw when they didn’t edit, so binding it is always correct). A DOCX step still bound to $.nodes.<draft_id>.outputs.text accepts the reviewer’s edit and then silently ships the unedited draft, reporting success. See Human review.
Validated: the run paused at Human review, resumed on approval, and the revise step produced the final answer.

Recipe 10 — Fan out work in parallel (map / join)

Use it for: doing the same step over many items at once (e.g. author each section of a document).
  • Map fans the list out to parallel branches (one per item), Join collects them, and a final node assembles the pieces. Bind the assembling node to the Join’s results_by_name rather than results — that port keys each branch’s result by the map item it came from — and fan the Map out over a list of distinct item names so the results key cleanly.
  • Put a Condition on the Join’s ok in front of the assembling node and route false into a revise lane: failed_indexes is built from the branch count, so a Map that fanned out over an empty list leaves it empty and the assembling node would otherwise produce a document with nothing in it. See Join for the port detail.
Validated: a 3-item list fanned to 3 parallel branches; Join collected all three; the summary combined them coherently. (This is the same engine the RFP Response Pipeline template uses to author 17 sections in parallel.)

Flagship templates

Two ready-made templates combine many of the above (start them from Agent Flows → Templates → Use template):
  • Grunley Scope Merge — upload scope documents → index → LLM merge of the uploaded documents → human review → Merged Scope of Work .docx (the DOCX binds the review’s content, so an edit made at the gate reaches the delivered file, and rejecting the merged scope ends the run as a failure with no document rather than quietly completing). (Validated: two uploaded scope docs → a consolidated, cited SOW grouped by project.)
  • RFP Response Pipeline — upload an RFP → extract requirements → route (standard/bespoke) → compliance matrix → human review → parallel section authoring (orchestrator + map) → assemble → final review → RFP response .docx (the DOCX binds the final review’s content, so a reviewer’s edits reach the delivered file). The chain hides two loops: rejecting the compliance matrix sends the run back to re-extract the requirements with the reviewer’s note instead of walking on into section authoring, and once those attempts run out it goes ahead with the matrix it has; the drafted sections have to pass a quality gate before assembly, and a rejection at the final review — or a draft that fails that gate — re-authors just the sections that need it through a second authoring lane and re-assembles, and when that loop runs out the run ends with no document and is reported as failed rather than delivering a .docx. The assembly step is handed the names of the sections the draft stage held back or could not produce at all, so any of them a later pass didn’t re-author surfaces in the assembled document under its planned heading with an explicit not-included note instead of vanishing. (Validated: a full proposal grounded in the RFP brief.)

Recipe 11 — Ask the copilot

Use it for: building or fixing a flow by describing it, instead of assembling it node by node. The Admin Copilot is docked on both the flows list and the editor (Copilot button in the admin header, or ⌘J/Ctrl+J). It proposes changes as a card; you review and apply them — nothing is saved or published for you. A few things it’s good for:
  • “Build a flow that pulls RFP requirements from an upload, drafts a response, and has someone review it before it’s sent.” On the list page, this produces a New-flow proposal already wired up; apply it and the editor opens with the draft in place.
  • “This flow’s llm.extract node keeps producing garbled JSON in the sections field.” On the editor, the copilot reads the open definition, recognizes an untyped array in the extraction schema (lint L3), and proposes the fix as a small, targeted edit rather than rewriting the whole flow.
  • “Why did run a1b2c3d4 fail?” It reads that run’s content-free diagnostics — the failed node, the error shape, timings and tokens — and explains what happened, without ever seeing the values your flow actually produced.
  • “Add a review gate before the document gets generated.” It proposes inserting a human.review node ahead of the document step and rewiring the binding so the reviewed (possibly edited) content is what the document node actually renders — the same “bind to content, not the draft” rule from Recipe 9 above, which trips up hand-built flows too.

Building a flow in the admin — the short version

  1. AI & Agents → Agent Flows → New flow, give it a name (the system handles the internal id).
  2. Drag nodes from the palette onto the canvas; connect them (start → … → end). Connecting auto-wires compatible data; drag port-to-port for a specific value, or use Fix wiring to complete required inputs.
  3. Select a node to configure it (Inspect panel); bind inputs to Chat message ($.params.message), to another node’s output ($.nodes.<id>.outputs.<port>), or to an uploaded file slot.
  4. Validate, then Publish (publishing snapshots an immutable version).
  5. Run it from the Run tab (provide params/files), or enable the Sub-agent toggle (and write a good description) so the chat agent can launch it during a conversation.
Edit as JSON: the canvas toolbar has an Edit as JSON action to export the flow definition (copy/download) and paste an edited definition back. Applying runs the same validation as the canvas, so a malformed definition is rejected before it loads — handy for copying a flow between environments or making bulk edits.

Tips

  • Feed the user’s question in by binding the entry node’s query/context to Chat message — don’t rely on a hard-coded value.
  • Parallel + converge: a node with two incoming edges waits for both — no explicit Join needed for simple fan-in (use Join when you fanned out with Map).
  • Pick the right writer: LLM generate for fusing arbitrary sources; Knowledge Graph Query (report mode) for graph-grounded answers; LLM extract for structured data.
  • Budgets: give research/orchestrator nodes enough model-call budget for the task.

On the roadmap

A natural-language flow builder now exists — see Recipe 11 above and the Admin Copilot — but it proposes, it doesn’t replace your judgment. This cookbook and the templates remain the fastest way to see the patterns it’s drawing from, and the best way to check its work.