CHAPTERS
- 0:00 – 3:38
Why n8n stands out: workflows + AI agents in one tool
Pawel and Aakash frame n8n as a uniquely powerful automation platform because it spans classic automations and modern AI-agent systems. They preview practical outcomes: chatbots, competitor monitoring, inbox actions, and multi-agent research.
- •n8n combines traditional workflow automation with AI agents/multi-agent systems
- •Positioned as flexible and full-powered vs. simplified automation tools
- •Real-world promise: save time by automating repeatable information work
- •Episode will teach by building, not theory
- 3:38 – 6:27
Competitor monitoring workflow setup: triggers and pulling a competitor list
They begin building a weekly competitor monitoring workflow, starting with a manual trigger for easy testing. The first real step is reading competitor names from Google Sheets and validating the data flow.
- •Different start modes: manual, scheduled, webhook/event-driven
- •Google Sheets node: connect credentials and “Get rows” from a sheet
- •Test execution step-by-step to confirm outputs
- •Acknowledge n8n’s initial complexity as a ‘power user’ tradeoff
- 6:27 – 7:06
Development speed hack: pinning data to avoid repeated API calls
Pawel shows how to pin node output so the workflow can be iterated on without re-querying Google Sheets or paying for repeated external calls. This becomes a recurring best practice for fast, cheap development.
- •Pin outputs to reuse data during workflow development
- •Avoid re-running expensive/slow steps while iterating
- •Can edit pinned data to simulate changes
- •Improves speed, reduces cost while debugging
- 7:06 – 8:44
Gathering competitor updates with Perplexity: prompts, variables, and scale
They add Perplexity as a research step, using each row (competitor) as an input variable so n8n automatically runs the node per item. Pawel explains prompt structure: what to look for, how to format results, and how to handle “no updates.”
- •Per-competitor Perplexity calls using sheet rows as variables
- •Prompt focuses on launches, pricing, partnerships, complaints, etc.
- •n8n iterates automatically over collections—no explicit loops required
- •Formatting requirements added upfront for clean downstream reporting
- 8:44 – 9:24
Cost reality: free n8n, cheap Perplexity API calls, and why it’s affordable
Aakash asks about paid plans; Pawel clarifies Perplexity requires an API key (card attached), but calls are inexpensive at scale. He also confirms the workflow is built on the free n8n version.
- •Perplexity API key required; subscription not required
- •Hundreds of calls can cost around $1–$2 depending on model
- •Free n8n is sufficient for building and running the workflow
- •Weekly runs are typically negligible cost
- 9:24 – 14:23
Token optimization: compressing Perplexity output with a Code node
Perplexity returns lots of metadata that would waste tokens if passed to an LLM. Pawel demonstrates extracting only the ‘content’ summary and ‘citations’ via a Code node, emphasizing context compression as a practical cost-control technique.
- •Perplexity output includes excess fields (snippets, titles, etc.)
- •Use Code node to keep only content + citations
- •Leverage ChatGPT to generate the code/extraction logic
- •Context compression reduces token burn and improves reliability
- 14:23 – 20:35
Assembling a clean email report: aggregate, JSON stringify, LLM formatting
They aggregate multiple competitor items into one object for a single LLM call, then send it to OpenAI to format a structured report. Pawel highlights key n8n expressions like converting objects into JSON strings so LLMs can interpret the data.
- •Aggregate multiple items into one payload for summarization
- •OpenAI “message a model” to generate a structured competitor report
- •Critical expression: convert structured objects to JSON string for LLM input
- •Prompting tactics: formatting rules, link replacement via citations, examples
- 20:35 – 22:43
Delivering the report: Markdown→HTML conversion and Gmail send
To avoid spending tokens on HTML generation, they keep the report in Markdown and convert it to HTML using a dedicated node. The final step sends the HTML email via Gmail, proving the workflow works end-to-end with minimal hallucination risk.
- •Generate Markdown (cheaper) and convert to HTML via node
- •Gmail node sends HTML email to the recipient
- •Pinning again avoids rerunning upstream steps during tweaks
- •Result: scannable competitor report with sources
- 22:43 – 23:22
Traditional workflow vs agentic workflow: what changes and why it costs more
Aakash notes the initial build is complex; Pawel explains it’s optimized for reliability and token efficiency. They then introduce the ‘agentic workflow’ approach—letting an AI Agent decide prompts/tool usage—while warning that it increases time and token cost.
- •Classic workflow is more deterministic and token-efficient
- •Agentic workflow introduces flexibility but more token usage and latency
- •Some manual nodes (markdown conversion, email) still kept for efficiency
- •‘Workflow with LLM’ ≠ true agent; agency exists on a spectrum
- 23:22 – 30:20
Building an agentic workflow: AI Agent with tools, system prompt, max iterations
They create an AI Agent node powered by OpenAI, attach tools (Google Sheets + Perplexity), and define a detailed system prompt with step-by-step reasoning instructions. Pawel introduces max iterations (e.g., 30) to prevent premature stopping during tool use.
- •AI Agent requires an LLM ‘brain’ plus tools
- •Tools added: Google Sheets (competitors) and Perplexity (research)
- •System prompt includes explicit reasoning steps and formatting guidance
- •Max iterations setting prevents agents from stopping too early
- 30:20 – 35:48
Agentic workflow results: logs, parallelism, and the token/time trade-off
They inspect agent logs showing tool calls and note Perplexity calls can run in parallel in this setup. Pawel compares costs: the agentic version takes longer and uses substantially more tokens than the deterministic workflow, illustrating why optimization matters.
- •Agent logs show tool selection, inputs, and outputs step-by-step
- •Perplexity calls can execute in parallel (in this configuration)
- •Comparison: ~5k tokens vs ~12k tokens; ~30–40s vs ~1.5 min (approx.)
- •More agency increases cost and potential error surface
- 35:48 – 40:31
True agent build: minimal instructions, add email tool, best output—highest cost
They move from ‘coding in English’ to a ‘true agent’ by giving a high-level objective and the necessary tools (including sending email) and letting the model decide the process. The resulting email is the best formatted yet, but token usage spikes dramatically.
- •True agent = objective + tools, minimal step-by-step constraints
- •Add Gmail send tool so the agent completes the full loop
- •Sequential vs parallel tool calling may depend on tool descriptions/limits
- •Result quality improves, but cost jumps (e.g., ~90k tokens)
- 40:31 – 45:29
n8n operational best practices: error workflows, retries, tool descriptions, From AI
Pawel lists practical production best practices: dedicated error workflows, retries on failure, increasing max iterations, and improving tool descriptions so agents use tools correctly (including parallelism guidance). He also shows the ‘From AI’ expression for parameters when the sparkle UI isn’t available.
- •Create an error workflow to notify via email/Slack on failures
- •Use retry-on-fail to handle transient model/tool outages
- •Write strong tool descriptions with examples and pitfalls
- •Use ‘From AI’ expression to let the agent fill parameters when needed
- 45:29 – 48:57
Multi-agent research system demo: orchestrator + sub-agents + report generation
Pawel demonstrates a more advanced n8n setup inspired by Anthropic’s multi-agent research architecture. A lead agent clarifies the query, delegates tasks to multiple sub-agents running in parallel, compresses sources, and produces a report saved to Google Drive.
- •Lead ‘orchestrator’ agent decomposes tasks and coordinates sub-agents
- •Sub-agents browse/search (e.g., Brave), extract content, compress context
- •Parallel execution across many agents for faster scoped research
- •Outputs stored as files in Google Drive; can generate long-form reports
- 48:57 – 58:53
PM automation use cases + free-plan hacks (history retention, global vars, backups)
They close with practical product-management automations (email triage, PRDs, Slack/Drive search) and how to stretch the free plan. Pawel shares workarounds: self-hosting for better history retention, using data tables as global variables, and an n8n workflow that exports workflows daily to Drive for version history.
- •PM use cases: email summarization/drafting, competitor research, PRDs, ops syncs
- •Free plan constraints: limited execution history and no built-in version history
- •Hack 1: self-host n8n (e.g., low-cost VM) to remove retention limits
- •Hack 2: data tables emulate global variables/secrets
- •Hack 3: automated daily workflow export to Drive = DIY version history
