Daily news aggregation with Perplexity AI & MongoDB storage
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Workflow: Daily News Aggregator & MongoDB Storage This workflow is designed to run seamlessly in the background, aut...
Template notes
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
Workflow: Daily News Aggregator & MongoDB Storage
This workflow is designed to run seamlessly in the background, automating the full cycle of news aggregation, storage, and reporting with precision and reliability.
1. Daily Trigger (Cron Node) The process kicks off every morning at 8:00 AM UTC. This scheduling ensures that fresh global news is captured consistently at the start of each day.
2. Perplexity Node At the heart of the workflow, a Perplexity node queries the latest global news. The prompt specifies both the type of news and the JSON structure required, guaranteeing the output is ready for structured storage. The result is a clean feed of headlines, timestamps, sources, and URLs.
3. Data Formatting (Code Node) Since Perplexity’s response is a string, the workflow includes a custom JavaScript function to clean and parse it into a valid JSON array. Each news item is then transformed into its own object, ready for iteration.
4. MongoDB Insertion (Loop Node) Each news article is inserted into the dailynews collection in MongoDB. The workflow ensures that fields such as headline, timestamp, source, URL, and category are stored neatly, with additional metadata available for future filtering and analysis.
5. Aggregation & Notification Prep (Code Node) Once all items are stored, the workflow aggregates the day’s results. This step prepares a digest of what was successfully processed, ensuring visibility into the pipeline’s performance.