Perplexity to MongoDB, daily news archive + Gmail
Your “daily news roundup” process usually starts with good intentions and ends in tabs. You copy headlines into a doc, paste links into Slack, lose the source, then redo it all tomorrow. That’s why Perplexity MongoDB automation is so useful: it stops news tracking from becoming a second job.
This hits marketing leads who need fast angles for campaigns, but agency owners and ops folks running client monitoring feel it too. You get a searchable archive in MongoDB plus a reliable Gmail digest every morning, without babysitting the process.
Below, you’ll see how the workflow runs at 8:00 AM UTC, how it turns Perplexity’s response into clean structured data, and how it stores everything so your next brief is built on sources you can actually find.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: Perplexity to MongoDB, daily news archive + Gmail
flowchart LR
subgraph sg0["Scheduled Automation Start Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Scheduled Automation Start", pos: "b", h: 48 }
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/perplexity.dark.svg' width='40' height='40' /></div><br/>Perplexity News Fetch"]
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Parse News Payload"]
n3@{ icon: "mdi:swap-vertical", form: "rounded", label: "Iterate News Batches", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Aggregate News Results"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/mongodb.svg' width='40' height='40' /></div><br/>Store News in MongoDB"]
n6@{ icon: "mdi:message-outline", form: "rounded", label: "Dispatch Confirmation Email", pos: "b", h: 48 }
n4 --> n6
n5 --> n3
n1 --> n2
n3 --> n4
n3 --> n5
n0 --> n1
n2 --> n3
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n5 database
class n2,n4 code
classDef customIcon fill:none,stroke:none
class n1,n2,n4,n5 customIcon
The Challenge: Daily news tracking that never becomes a system
Keeping up with news is easy. Keeping it organized is the brutal part. You might read an article in the morning, paste the link into a note, then realize later you also need the timestamp, the source name, and the category for reporting. Next week, someone asks, “Did we see this story already?” and you’re stuck searching email threads and old docs. Honestly, the worst part is the mental load: you’re doing research while also trying to act like a database.
It adds up fast. Here’s where the routine usually breaks down.
- Headlines get saved without consistent fields, so filtering by source or topic becomes guesswork.
- Links end up scattered across docs, chat, and bookmarks, which means you can’t build a reliable archive.
- Manual copying invites errors, and a single wrong URL is enough to kill trust in the whole roundup.
- Daily digests get skipped when the day gets busy, so the “system” only works on calm days.
The Fix: Perplexity pulls news, MongoDB stores it, Gmail confirms it
This workflow runs quietly in the background and turns daily news into structured, reusable information. Every morning at 8:00 AM UTC, n8n triggers a Perplexity query that requests the latest global news in a predefined JSON structure. Because Perplexity returns the payload as a string, the workflow cleans and parses it with a small JavaScript step, then converts each headline into a consistent “news item” object (headline, timestamp, source, URL, category). From there, n8n loops through the items and inserts them into a MongoDB collection named daily_news. Once the inserts are done, it aggregates a quick summary and sends a Gmail message so you know the pipeline ran and what it captured.
The workflow starts on a schedule, not when you remember. Perplexity generates the day’s feed, the data is normalized into clean JSON, and MongoDB becomes your long-term archive. Gmail then delivers the short digest you’ll actually read.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you track about 20 headlines each morning. Manually, you spend maybe 3 minutes per item capturing headline, link, source, and a quick category, plus another 20 minutes writing and sending a digest. That’s roughly 1.5 to 2 hours per day when you include re-checking and fixing mistakes. With this workflow, the “work” is basically zero: it runs at 8:00 AM UTC, stores everything automatically, and sends a Gmail summary in minutes. You get your morning back, and you keep the archive.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Perplexity to fetch structured daily news results
- MongoDB for a searchable daily_news archive
- Gmail to send the daily confirmation digest
- Perplexity API key (get it from your Perplexity account settings)
- MongoDB connection string (get it from your MongoDB cluster setup)
Skill level: Intermediate. You’ll connect accounts, set credentials, and be comfortable editing a small parsing script.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
A daily schedule starts it. At 8:00 AM UTC, the cron trigger runs automatically, so you don’t rely on someone remembering to “do the roundup.”
Perplexity fetches the news in a strict format. The Perplexity node requests global news and asks for a specific JSON structure (headline, timestamp, source, URL, category), which makes the data easier to store and reuse.
The response gets cleaned and split into items. A code step parses Perplexity’s string output into valid JSON, then n8n uses a batching loop to handle each article one-by-one without choking on a big payload.
MongoDB becomes the archive, and Gmail becomes the receipt. Each item is inserted into the daily_news collection, then another code step aggregates a short summary and sends a confirmation email through Gmail.
You can easily modify the Perplexity prompt to focus on your industry instead of “global news” based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule Trigger
This workflow starts daily on a schedule to pull the latest news automatically.
- Add the Scheduled Automation Start node as your trigger.
- Set the schedule rule to run at
triggerAtHour: 8(found under rule → interval). - Leave other trigger settings at their defaults unless you want a different schedule.
Step 2: Connect Perplexity for News Retrieval
The workflow uses Perplexity to fetch and format breaking news.
- Add Perplexity News Fetch and connect it to Scheduled Automation Start.
- Credential Required: Connect your perplexityApi credentials.
- Set Model to
sonar-pro. - Under Options, set Search Recency to
day. - Use the provided prompt text in Messages to ensure the response is a JSON array with the required fields.
Step 3: Parse and Batch the News Payload
These nodes clean the JSON response and process each news item individually.
- Add Parse News Payload and connect it to Perplexity News Fetch.
- Paste the provided JavaScript into jsCode (it strips backticks and parses the JSON array).
- Add Iterate News Batches and connect it to Parse News Payload.
- Keep Iterate News Batches options at default; reset should remain
false.
Step 4: Configure Database Storage
Each news item is inserted into MongoDB before the final aggregation.
- Add Store News in MongoDB and connect it to the second output of Iterate News Batches.
- Credential Required: Connect your mongoDb credentials.
- Set Operation to
insert. - Set Collection to
news. - Set Fields to
=headline,timestamp,source,summary,url,category,language,metadata. - In Options → dateFields, set the value to
{{ $json.headline }},{{ $json.timestamp }},{{ $json.source }},{{ $json.summary }},{{ $json.url }},{{ $json.category }},{{ $json.language }},{{ $json.metadata }}.
Step 5: Aggregate Results and Send Confirmation
After batch inserts, the workflow aggregates all items and sends a confirmation email.
- Add Aggregate News Results and connect it to the first output of Iterate News Batches.
- Paste the provided JavaScript into jsCode to build a
noticiasarray from all items. - Add Dispatch Confirmation Email and connect it to Aggregate News Results.
- Credential Required: Connect your gmailOAuth2 credentials.
- Set Send To to
[YOUR_EMAIL]. - Set Subject to
=[ News ] Record of all news items. - Set Message to the HTML content beginning with
=<!DOCTYPE html>to keep the formatted email.
Step 6: Test and Activate Your Workflow
Run a manual test to validate news retrieval, parsing, database inserts, and email delivery.
- Click Execute Workflow to run a manual test from Scheduled Automation Start.
- Verify that Perplexity News Fetch returns a JSON array and that Parse News Payload outputs individual items.
- Check MongoDB to confirm documents were inserted into the
newscollection. - Confirm the email arrives from Dispatch Confirmation Email with the HTML formatting intact.
- Once verified, toggle the workflow to Active to enable daily runs.
Watch Out For
- Perplexity credentials can expire or need specific permissions. If things break, check the Perplexity API key settings in your account first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Common Questions
About an hour if you already have your Perplexity, MongoDB, and Gmail credentials ready.
Yes, but you’ll want someone comfortable pasting credentials and testing a few sample runs. The only “techy” part is verifying the JSON parsing step behaves with your Perplexity output.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Perplexity API usage and any MongoDB hosting costs.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Start by changing the prompt in the Perplexity News Fetch node so it targets your niche (competitors, regulations, product launches, local coverage). If you want extra enrichment, add fields in Edit Fields (Set) after parsing, then store them in MongoDB too. Common customizations include adding a “company” tag, splitting categories into multiple labels, or routing different digests to different Gmail recipients.
Usually it’s an invalid or expired API key, so regenerate it in Perplexity and update the credential in n8n. It can also fail when the prompt returns text that isn’t valid JSON, which breaks the Parse News Payload code step. Less common, but real: rate limits or temporary upstream outages, especially if you run it many times during testing.
On self-hosted n8n, capacity mainly depends on your server and how many headlines you fetch per run. On n8n Cloud, your monthly execution limit depends on your plan, and this workflow typically uses one execution per daily run plus the internal item processing. Practically, most teams can store dozens of headlines per day without thinking about scale. If you start pulling hundreds of items or multiple topics, you’ll want to watch MongoDB indexing and Perplexity usage costs.
Often, yes, because the parsing + looping + database insert pattern is where no-code tools start to feel clunky. n8n handles batching, code-based cleanup, and more complex logic without turning every extra step into an extra bill. Zapier or Make can still work if you keep it very simple and skip MongoDB, but then you lose the real archive. If you need this to run daily for months, reliability matters more than “quick setup.” Talk to an automation expert if you want help choosing.
Once this is running, your news tracking stops being a daily scramble and becomes a dependable asset. The workflow handles the repetitive capture and filing so you can focus on decisions, briefs, and messaging.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.