1. Clear the comment backlog in one batch (map-reduce, 2 agents)
Comments get read at midnight on a phone, thumb-scrolling a feed that never ends. The genuinely useful ones — a correction, a repeated question, a collab offer, someone reporting a broken link — are buried between hundreds of emoji replies, and the same question gets answered twice because nobody remembers answering it the first time.
Trigger: Webhook (comment export from the platform API via Tool/MCP — daily or post-upload)
How the workflow runs
- Trigger
The day's comments arrive. A scheduled Webhook fires with the batch reference; a Tool (MCP) node pulls the comment list from the platform's own API. YouTube has no first-party connector — it is reached via Webhook + Tool (MCP), never pretended otherwise.
- Loop
Map: one cheap pass per comment. A Loop node fans an economy-tier triage agent across every comment — isolated context per item, so a 40-comment day and a 4,000-comment launch day are handled identically.
- Agent
Triage + draft, never post. The triage agent returns strict JSON per comment (bucket: QUESTION / CORRECTION / BUSINESS / SUPPORT / ABUSE / NOISE, sentiment, needs_reply) and, for QUESTION/SUPPORT, a draft reply written from the channel FAQ and tone guide in Knowledge. It drafts. It never publishes.
- Knowledge
Answer from what you already said. A Knowledge node holds the channel FAQ, pinned-comment answers, past scripts and the tone guide — so a repeated question gets the answer you already gave, in your phrasing, instead of a fresh invention.
- Agent
Reduce: the daily digest. A reducer agent rolls the validated items into one brief: the top repeated questions (candidates for a pinned comment), corrections worth acknowledging on-camera, business/collab enquiries pulled out to the top, and anything flagged for moderation.
- Approval
You approve the replies. An Approval node holds the drafted replies as a single review list — approve, edit, or drop each one. Nothing is posted to your channel without that click.
- Output
Post approved + file the digest. A Tool (MCP) node posts only the approved replies back through the platform API; the digest goes to Email or Telegram so it can be read once, in the morning, instead of scrolled at midnight.
Channels & connectors
- Webhook
- Tool (MCP → YouTube Data API)
- Knowledge base
- Approval / HITL
- Telegram
Outcome
The whole comment backlog is bucketed, deduped and drafted in one run, and the creator spends their time approving replies and reading one digest instead of scrolling a feed.
Why it helps
Map-reduce turns an unbounded scroll into cheap per-comment passes plus one synthesis. The mechanism that matters: repeat questions are grouped so the same answer is written once, and business enquiries stop being lost between emoji replies — with the creator still the only one who can post.
Build spec
2 agents — 1 triage/draft agent (runs once per comment via the Loop node) + 1 reducer (runs once). Loop, Knowledge and Approval are workflow nodes. · Pattern: Map-reduce: Loop (map, economy tier) → reducer (reduce) → creator approves every reply
System prompt (paste-ready)
(Triage) Handle ONE comment on {{channel}}. Return strict JSON {bucket (QUESTION|CORRECTION|BUSINESS|SUPPORT|ABUSE|NOISE), sentiment, needs_reply (bool), duplicate_of (id|null), draft_reply (string|null)}. Write draft_reply ONLY for QUESTION or SUPPORT, and ONLY from the FAQ, pinned answers, past scripts and tone guide in Knowledge — match the creator's voice, never invent a fact, a date, a product claim or a promise about future uploads. If the answer is not in Knowledge, set draft_reply=null and needs_reply=true so a human writes it. Route BUSINESS to the enquiry list, never reply to it. Never post anything; you only draft.Agent roles & model tiers
Comment triage + draft (per comment) — Economy tier — fast and cheap; it runs N times, so this single choice dominates the whole workflow's cost. Fallback model configured so one provider hiccup does not stall the batch
Bucket ONE comment into schema-valid JSON and, for questions only, draft a reply grounded strictly in the channel's own Knowledge. Null instead of a guess. Never publish.
Digest reducer (once) — Standard tier — reasoning over the batch
Aggregate the validated comment results into one morning brief: repeated questions ranked by frequency (pinned-comment candidates), corrections worth an on-camera acknowledgement, business/collab enquiries lifted to the top, moderation flags. Cite real counts from the batch; never estimate.
MCP connectors
- YouTube Data API (comment list + reply post) — via a Tool (MCP) node; no first-party connector exists
- Email / Telegram — the digest delivery channel (both first-party)
Built-in tools
- knowledge_search (channel FAQ, pinned answers, past scripts, tone guide)
- http_request (pull the comment batch; post only approved replies)
- user-defined tool comment_priority (SpEL): input.bucket == 'BUSINESS' ? 100 : (input.bucket == 'CORRECTION' ? 80 : (input.needsReply ? (input.likeCount >= input.pinThreshold ? 60 : 30) : 0)) — a tenant-authored SpEL expression over the tool's JSON input: a data-transform formula, sandboxed by construction (no method calls, no constructors, no bean or type references, and no loop in the grammar), NOT a scripting engine. The creator encodes their own idea of what matters once, and every comment in every future batch is scored against it automatically
Guardrails
- The agent drafts, the creator approves — every reply passes the Approval node before a single character reaches the channel; nothing auto-posts
- Voice stays the creator's: drafts are grounded only in the channel's own Knowledge (FAQ, pinned answers, past scripts, tone guide). No invented facts, dates, product claims or upload promises — if the answer is not in Knowledge, the agent returns null and asks for a human
- Schema validation per comment — a malformed item is dropped from the reduce and surfaced in the digest, never silently answered
- ABUSE-bucketed items are only ever flagged for the creator's own moderation decision; the agent never issues a strike, block or removal itself
- Idempotent per comment id, so re-running the batch cannot double-reply to the same person
Cost strategy
Cost is linear and easy to reason about: N × (economy-tier, hard-capped triage agent) + ONE standard-tier reduce. Because triage runs across the entire comment volume — the largest item count in a creator's whole operation — it MUST sit on the economy tier; that is the dominant lever, and premium models belong nowhere near it. Run the map in Parallel batches for wall-clock speed without changing per-item cost, and set a per-run token cap so a viral video cannot produce a surprise bill.
Output & delivery
Loop maps the cheap triage agent over every comment → the reducer writes one morning digest → the creator approves, edits or drops each drafted reply at the Approval node → a Tool (MCP) node posts only the approved replies through the platform API and the digest lands on Email or Telegram. Unapproved drafts stay drafts.