Skip to main content
This lesson walks through building a scheduled multi-agent research workflow in n8n that:
  • Searches the web for the latest AI news (via Perplexity),
  • Cross-checks results against a Google Sheets log to avoid duplicates,
  • Sends a daily summary email (via Gmail),
  • Appends new headlines to the log for future deduplication.
The workflow runs on a schedule (for example, every day at 9:00 AM) and forms a loop so every run compares new results against previously recorded headlines.
The image shows an n8n workflow interface for a "Daily AI News Research Agent," including nodes for scheduling, searching, checking, emailing, and logging tasks. The interface displays a sequence of connected tasks and options to execute the workflow.
Overview
  • Scheduled Trigger → Perplexity (Search) → News Checking Agent (OpenAI LLM) + Google Sheets (getRows) → Gmail (send) → Google Sheets (appendRow)
Quick workflow summary table: Why this pattern? Separating search, formatting/deduplication, and delivery makes the flow deterministic and auditable: the LLM formats content but the workflow node (Gmail) guarantees delivery every run. Step 1 — Scheduled Trigger
  • Add the Scheduled Trigger node to run automatically.
  • For a daily digest set:
    • Interval: Days
    • Days Between Triggers: 1
    • Hour: 9
    • Minute: 0
  • Use Execute Step to test the trigger and generate initial runtime variables.
The image shows a workflow scheduling interface with options to set trigger intervals, days between triggers, and specific trigger times. The interface includes buttons for executing steps and viewing or setting data.
Step 2 — Perplexity: Message a Model
  • Use the Perplexity node with the Message a Model operation to fetch and summarize recent AI news.
  • Create a Perplexity credential by copying your Perplexity API key into n8n (Perplexity dashboard → Settings → API Keys).
Perplexity may require enabling API billing and adding payment details before API keys are issued. Confirm account limits and billing to avoid unexpected failures during development.
Example console-style timestamp output you might see while testing:
Selecting a model and ordering messages
  • For concise, timely results choose a Sonar model (e.g., sonar-pro).
  • For deeper analysis use sonar-deep-research or sonar-reasoning-pro.
  • Perplexity expects a System message first, then a User message — ensure the system prompt is the first entry.
Example System Prompt (first message):
Example User Prompt (second message):
Tip: Use the workflow variable {{ $now }} so the model has a concrete time context. Perplexity also provides a recency filter — set it to “within the day” to restrict results to the most recent items. When you execute the Perplexity node, outputs include:
  • Natural-language summaries,
  • Citations and search_results metadata,
  • Search metrics.
During development, pin the node output in n8n to avoid repeated API calls.
The image shows a scheduling and automation interface with input parameters for a schedule trigger and settings for a Perplexity account operation. The screen displays timestamp details and message settings for interaction with a model.
Step 3 — News Checking Agent (OpenAI) + Google Sheets (getRows)
  • Add an LLM node (for example, OpenAI’s Message a Model) to act as a formatter and deduplicator. The LLM node will:
    • Receive Perplexity’s summarized content,
    • Cross-check headlines against a Google Sheet named Past AI News Log,
    • Remove duplicates,
    • Format the final digest (one- to two-sentence summaries with source URLs),
    • If everything is duplicate, output a clear “No notable AI development news in the past 24 hours” message.
Example System Prompt for the checking agent:
Example User Prompt (inject Perplexity output into the prompt):
Configuring Google Sheets as a tool inside the LLM node
  • Attach Google Sheets as a tool and set the tool’s Resource to the spreadsheet document and Operation to getRows. This allows the LLM to fetch existing rows and determine duplicates.
  • Create the spreadsheet Past AI News Log with these columns:
    • Date
    • Headlines
  • In the Google Sheets tool settings, select the Document and Sheet (e.g., Sheet1) so the checking agent can access existing rows.
Example assistant output from the LLM (formatted JSON for debugging):
The image shows a screenshot of a workflow setup in a tool called Marconi, with a schedule trigger set for July 29, 2025, and a parameter section for sending a message to a model called Sonar Pro.
Step 4 — Gmail node (Send a Message)
  • Add a Gmail node after the News Checking Agent to deliver the digest deterministically.
  • Configure fields using variables from the News Checking Agent output:
    • To: your recipient email(s)
    • Subject: Daily AI News Digest
    • MIME Type: text
    • Message: the content from the News Checking Agent, for example:
      • $('News Checking Agent').item.json.message.content
  • Optional: Disable automatic n8n attribution under Add Option → Append n8n Attribution if you prefer no footer.
Why not let the LLM call Gmail directly?
  • If the LLM has Gmail as an attached tool it may or may not choose to use it. Chaining Gmail as an explicit node guarantees delivery each run and improves observability in the workflow logs.
The image shows a computer screen with a news checking application. It includes AI-generated news, instructions for processing the news, and a detailed expression editor with a results panel displaying AI news updates.
Step 5 — Google Sheets: Append Row
  • After the Gmail node, append the formatted headlines into your Past AI News Log so future runs can deduplicate against them.
  • Google Sheets node settings:
    • Operation: Append Row
    • Document: select Past AI News Log
    • Sheet: e.g., Sheet1
  • Map the columns:
    • Date → {{ $today }}
    • Headlines → $('News Checking Agent').item.json.message.content
Example mapping values (YAML style shown in n8n UI):
Or as a JSON payload block:
When executed, the node appends the next available row so the log grows by one row per run containing new content.
The image depicts a workflow in the n8n automation platform, showing a series of nodes connected to automate tasks such as scheduling, using Perplexity, a news-checking agent, sending Gmail messages, and appending data to Google Sheets.
Resulting loop
  • Each day the Perplexity node fetches the latest AI news.
  • The News Checking Agent consults Past AI News Log to remove duplicates and formats a digest.
  • Gmail sends the digest to recipients.
  • Google Sheets appends the digest to the log for future deduplication.
Alternatives and extensions
  • Swap Perplexity for a different search agent or a scraper targeting curated source lists.
  • Replace OpenAI with other LLM providers for formatting and deduplication.
  • Replace Gmail with Slack, Telegram, or other delivery channels.
  • Store structured metadata columns in the sheet (e.g., URL, Company, Category) to enable richer deduplication and filtering.
Links and references
Tip: During development, pin outputs from nodes (Perplexity, News Checking Agent) to avoid repeatedly consuming API calls. Once satisfied, unpin and let the workflow run on schedule.
This completes the lesson on building a scheduled multi-agent AI research workflow using Perplexity for search and an LLM-based checking and formatting step.

Watch Video

Practice Lab