How to Use n8n with ._Template 103 Deep Research Agent Relatorio Pdf

Your team runs deep research the slow way: someone opens fifteen browser tabs, copies passages into a doc, loses track of which source said what, and three hours later hands you a summary that's alrea

How to Use n8n with ._Template 103 Deep Research Agent Relatorio Pdf

Your team runs deep research the slow way: someone opens fifteen browser tabs, copies passages into a doc, loses track of which source said what, and three hours later hands you a summary that's already stale. When the same question comes up next week, the whole ritual repeats. The knowledge doesn't compound, the citations rot, and the person doing it is your most expensive analyst instead of a machine. The ._Template 103 Deep Research Agent Relatorio Pdf workflow for n8n exists to kill that ritual — it takes a research prompt, fans out across live web sources, verifies and synthesizes what it finds, and returns a formatted PDF report you can drop straight into a stakeholder's inbox.

The problem: research is human-bottlenecked and unrepeatable

Manual deep research fails in three specific ways. First, it doesn't scale — every report needs a human to run the same search-read-summarize loop from scratch. Second, it's inconsistent: two analysts researching the same question return different sources, different depth, and different confidence. Third, the output is trapped in someone's head or a half-finished Google Doc, so it can't be scheduled, audited, or reused.

For a busy founder or ops lead, the real cost isn't the three hours. It's that you can't ask "give me a competitive brief on X every Monday" without dedicating a person to it. Research that can't be automated can't become a routine, and anything that isn't a routine eventually gets skipped. What you actually want is a pipeline: prompt in, cited PDF out, on a schedule, with a paper trail of exactly which sources fed each conclusion.

The solution: a multi-stage research agent in n8n

Template 103 models deep research as a directed pipeline rather than a single LLM call. That distinction matters — a one-shot "research this for me" prompt hallucinates sources and can't verify itself. The template breaks the job into stages that each do one thing well:

  • Decompose — turn the broad question into 4–6 specific sub-queries.
  • Retrieve — run each sub-query against a real search API and collect URLs.
  • Read & extract — fetch each page and pull the relevant passages with their source.
  • Verify — cross-check claims that appear in only one source before trusting them.
  • Synthesize — merge the extracts into a structured report with inline citations.
  • Render — convert the report to a clean PDF (the Relatorio Pdf step) and deliver it.

Because each stage is a discrete n8n node, you can inspect the intermediate output, cache expensive steps, and swap any component — a different search provider, a different model, a different PDF renderer — without rewriting the workflow.

Step-by-step setup in n8n

1. Trigger. Start with a Webhook node for on-demand runs, or a Schedule Trigger if you want a weekly brief. The trigger carries one field: query, the research question. For a Slack-driven version, front it with the Slack Trigger and pass the message text through.

2. Query decomposition. Add an AI Agent node (or a plain Message a Model node) wired to the Anthropic Chat Model — use claude-opus-4-8 for the reasoning-heavy planning step. Prompt it to return a JSON array of sub-queries. Follow it with a Structured Output Parser so downstream nodes get clean data instead of prose. Set the system prompt to: "Break this question into 4–6 non-overlapping search queries. Return only JSON: {\"queries\": [...]}."

3. Fan out the searches. Feed the parsed array into a Split Out node so each sub-query becomes its own item, then a Loop Over Items (batch size 1) wrapping an HTTP Request node pointed at your search API — Tavily, Brave Search, or SerpAPI all work. In the HTTP node, set the method to GET, add your API key under Header Auth credentials (never hardcode it in the URL), and map the query with an expression: {{ $json.query }}. Enable Retry On Fail with 3 attempts and a 2-second wait — search APIs rate-limit under burst.

4. Fetch and extract. For each returned URL, use a second HTTP Request node to pull the page, then an HTML (Extract) node or a small Code node to strip boilerplate down to readable text. Pass that text to another Anthropic model call that extracts only the passages relevant to the sub-query, each tagged with its source URL. Keep this model call cheap and fast — this is a high-volume step.

5. Verify and synthesize. Aggregate all extracts with a Merge or Aggregate node so the synthesis model sees the full evidence set at once. Then one more AI Agent call with claude-opus-4-8 writes the report. Instruct it explicitly: "Every factual claim must cite a source URL. If a claim appears in only one source, flag it as unverified." This is what separates a real research agent from a confident guess.

6. Render the PDF. Have the synthesis node emit HTML, then convert it. The simplest path is an HTTP Request to a rendering service (a headless-Chrome or Gotenberg endpoint) that returns a PDF binary. Alternatively, run a Code node with a library like Puppeteer if you self-host n8n. Finish with a delivery node — Gmail, Slack, or Google Drive — attaching the binary from the previous node's data field.

Benefits: compounding, auditable research

Once this runs, three things change. Research becomes a routine: schedule the trigger and a competitive brief lands in your inbox every Monday with zero human effort. It becomes auditable: because every claim carries its source URL, anyone can trace a conclusion back to the page it came from — no more "where did this number come from?" It becomes consistent: the same query produces the same depth and structure every time, so reports are comparable week over week.

The economic shift is the point. You're moving your most expensive people off a mechanical loop and onto judgment. The agent does the fetching and drafting; your analyst reviews a finished, cited PDF and adds the strategic read. Ten reports a week costs the same operator attention as one used to.

Common pitfalls and how to avoid them

Skipping the verification stage. The single biggest failure is letting one model call "research and write" in a single prompt. It will fabricate plausible sources. Always separate retrieval from synthesis, and always require inline citations — then spot-check them.

No rate-limit handling. Fanning out 6 sub-queries into 40 page fetches will trip API limits fast. Use Loop Over Items with small batches, enable Retry On Fail, and add a Wait node if your provider is strict. Without this, the workflow fails silently on the third run.

Unbounded token cost. Feeding full page HTML into your synthesis model burns money and blows the context window. Extract and trim aggressively in step 4 so the final call sees clean passages, not raw markup. Cap the number of sources per sub-query to keep runs predictable.

Hardcoded credentials. Put every API key — search, Anthropic, delivery — in n8n's Credentials store, not in node parameters or URLs. Keys pasted into HTTP nodes leak into execution logs and exported workflows.

No error branch. A dead URL or a malformed JSON response shouldn't kill the whole report. Add an Error Trigger workflow or set failing nodes to Continue On Fail, so one bad source degrades gracefully instead of aborting the run. Log the skip so you know your coverage wasn't complete.

Start with the on-demand webhook version, run it against a question you already know the answer to, and check the citations by hand. Once you trust the output, flip the trigger to a schedule and let it compound.