Weekly AI News Digest Generator (Perplexity & Gmail) - n8n Workflow

Use this powerful n8n workflow to automatically generate a weekly AI news digest using Perplexity AI, formatting the results into a professional HTML email delivered via Gmail. These n8n templates help you stay informed.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Researchers and Academics: Need weekly updates on AI breakthroughs and papers.
AI Enthusiasts & Developers: Want a curated summary of new models, technologies, and practical tips.
Busy Professionals: Require a quick, automated digest delivered directly to their inbox.
n8n Users Seeking practical examples of complex API integration and HTML email generation within an n8n workflow.

Overview

Staying updated in the fast-paced world of Artificial Intelligence is challenging. This sophisticated n8n workflow solves the problem of information overload by fully automating the knowledge acquisition process. Instead of manually scanning dozens of sources, this n8n solution leverages the searching and summarization capabilities of Perplexity AI to aggregate key weekly developments, categorize them (e.g., 'New Tech', 'AI Security'), and transform the output into a clean, professional HTML newsletter.

This n8n template demonstrates advanced data manipulation using the Code n8n node to generate production-ready email content before dispatching it via Gmail, ensuring you receive a high-quality, actionable digest every Monday morning. By utilizing this recurring n8n trigger, you guarantee consistent delivery of crucial industry intelligence.

How it Works

This automation functions on a set schedule, ensuring a timely delivery of curated information. The complete n8n workflow proceeds through these five distinct stages:


  1. Weekly Trigger Activation: The n8n trigger, configured as a Schedule n8n node, initiates the execution every Monday morning at 8:00 AM.

  2. Date Context Setting: The Set n8n node prepares dynamic variables, specifically capturing the current date and the date from one week prior, which are then used in the AI search query and email subject line.

  3. Perplexity AI Search: An HTTP Request n8n node calls the Perplexity API. The request is specifically engineered to search for and summarize the top AI news from the last week, dividing the results into targeted categories like 'New Tech' and 'AI Security'. This provides the raw structured news data.

  4. HTML Formatting (Code n8n node): The subsequent Code n8n node is the core processing engine. It takes the raw JSON response from Perplexity, parses the content, and dynamically builds a complete, visually appealing HTML email body, including citations and a professional header.

  5. Email Delivery: Finally, the Gmail n8n node uses the generated emailHtml and emailSubject variables to send the weekly AI news digest to the designated recipient, completing the scheduled n8n workflow.

Installation Guide

To deploy and run this powerful n8n workflow successfully, follow these setup steps:


  1. Import the n8n template: Copy the provided JSON code and import it directly into your n8n instance.

  2. Perplexity AI Credentials: Locate the 'Perplexity AI News Search' n8n node (HTTP Request). You must update the Authorization header parameter with your actual Perplexity API key (Bearer XXX-XXXXX).

  3. Gmail/Email Credentials: Configure the 'Gmail' n8n node with your required credentials. If you are using Gmail, ensure your OAuth2 credentials are set up. This n8n node requires permissions to send emails.

  4. Customize Recipient: In the 'Gmail' n8n node, update the sendTo parameter with the email address(es) where you wish to receive the weekly digest.

  5. Adjust Schedule (Optional): Modify the 'Daily Trigger' n8n trigger if you prefer a different day or time for the weekly execution.

  6. Test Execution: Run the n8n workflow manually to ensure all API calls and the HTML generation process function correctly before activating the recurring n8n trigger.

Node Details

This n8n workflow relies on a precise sequence of specialized n8n nodes:

Daily Trigger (Schedule Trigger n8n node):
Function: Serves as the primary n8n trigger, initiating the automation on a fixed schedule.
Key Configuration: Configured to run every week on Monday (triggerAtDay: [1]) at 8 AM.
Set Dates (Set n8n node):
Function: Creates helper variables for date management.
Key Configuration: Generates currentDate and lastweekDate for use in subsequent n8n nodes, ensuring accurate data context.
Perplexity AI News Search (HTTP Request n8n node):
Function: Communicates with the Perplexity API to execute a comprehensive AI news search and summarization.
Key Configuration: Uses the sonar model, specifies searchrecencyfilter: "week", and includes a detailed prompt instructing the AI to categorize the news into 'New Tech', 'AI Security', 'Top Stories', and 'Trending Topics'.
Format Email Content (Code n8n node):
Function: Transforms the raw AI response into a polished, mobile-friendly HTML email structure, including styling for headers and list items.
Key Configuration: Contains custom JavaScript logic to extract content, handle citations, format Markdown elements into HTML, and provide robust error handling with a fallback email template.
Gmail (Gmail n8n node):
Function: Sends the finalized HTML email digest.
* Key Configuration: Uses dynamic expressions (={{ $json.emailHtml }}) sourced from the Code n8n node for the message body and subject.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Derek Schatz
Derek Schatz

Featured*