# How To Be An Expert In Anything

Source: https://www.youtube.com/watch?v=jAEG5RMxvNQ
Recap page: https://rapidrecap.app/video/jAEG5RMxvNQ
Generated: 2025-10-29T20:32:54.015+00:00

---
## Quick Overview

The video demonstrates how to build an automated workflow using n8n that pulls unread emails from a specific Gmail account, aggregates the HTML content of those emails, summarizes the content using the Google Gemini Chat Model, converts the summary to Markdown, and then emails the final summary back to the user's main inbox daily at 5 PM.

**Key Points:**
- The automation workflow is built in n8n using a Schedule Trigger set to run daily at 5 PM.
- The 'Get many messages' Gmail node retrieves all unread emails from the dedicated 'mattsnewsletter915@gmail.com' account.
- An Aggregate node combines the HTML content of the 29 unread emails into a single large text document named 'combinedNewsletters'.
- The AI Agent node uses the Google Gemini Chat Model to process the aggregated HTML, following a detailed system prompt to generate a summarized, bulleted list of news, ranked by perceived popularity, and including URLs.
- A Markdown node converts the AI-generated summary from Markdown/HTML format back into clean HTML for readability.
- The final 'Send a message' Gmail node emails the resulting summarized digest to the user's primary email address ('matts.newsletter@hstgr.cloud').
- The process requires setting up a Google OAuth 2.0 credential in the n8n 'Get many messages' node and enabling the Gmail API in the Google Cloud Console, including adding the self-hosting domain ('hstgr.cloud') to the Authorized Domains list.

![Screenshot at 00:10: The visual representation of the n8n workflow showing the sequence of nodes: Schedule Trigger -\> Get many messages -\> Aggregate -\> AI Agent \(with Google Gemini Chat Model\) -\> Markdown -\> Send a message, illustrating the entire automated process.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-00-10.png)

**Context:** The creator is demonstrating a complex automation workflow built in n8n, an open-source workflow automation platform, designed to manage excessive email volume, specifically from newsletters. The goal is to use AI (Google Gemini) to process many daily emails in a niche (finance newsletters) and distill them into a single, manageable daily digest, thus solving the problem of information overload.

## Detailed Analysis

The tutorial details the creation of an automated workflow in n8n to consolidate multiple daily finance newsletters into a single, summarized email digest. The workflow begins with a Schedule Trigger set to run daily at 5 PM. The next node, 'Get many messages' (using a newly created Gmail OAuth 2 credential), fetches all unread emails from the 'mattsnewsletter915@gmail.com' account. The subsequent Aggregate node combines the HTML content of all 29 retrieved emails into one large text field called 'combinedNewsletters'. This massive text block is fed into the AI Agent node, which is configured to use the Google Gemini Chat Model. The AI Agent receives a detailed system prompt instructing it to summarize the content, provide a bulleted list, rank items by perceived popularity, include URLs, and exclude any additional context or sponsor mentions, outputting the result in HTML format. The Markdown node then converts this AI-generated Markdown/HTML summary back into clean HTML. Finally, the 'Send a message' Gmail node emails this consolidated, summarized digest to the user's main email address, 'matt@futuretools.io'. The video also briefly touches on the necessary Google Cloud setup, including enabling the Gmail API and authorizing the self-hosting domain ('hstgr.cloud') in the OAuth consent screen.

### Workflow Setup

- Schedule Trigger runs daily at 5 PM
- Get many messages retrieves 29 unread emails
- Aggregate combines HTML content into 'combinedNewsletters'
- AI Agent processes data using Google Gemini
- Markdown converts output to HTML
- Send a message emails the result to 'matt@futuretools.io'.

### Gmail Credential Setup

- Requires creating a new Gmail OAuth 2 credential in n8n, using the provided Redirect URL, and inputting Client ID/Secret from Google Cloud.

### Google Cloud Configuration

- Involves creating a Google Cloud project, enabling the Gmail API, configuring the OAuth consent screen (setting Audience to External or Internal, and adding the domain 'hstgr.cloud' under Authorized Domains), and obtaining API credentials.

### AI Agent Prompting

- The System Message instructs Gemini to summarize all news from the combined input, prioritize based on perceived popularity, include URLs, output in HTML format, and exclude self-promotional content or sponsors.

### Final Steps & Verification

- The workflow marks the processed emails as read using a separate Gmail node connected to the 'Get many messages' output, ensuring the emails aren't processed again.

![Screenshot at 00:00: Creator speaking directly to the camera, introducing the topic of managing newsletter overload.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-00-00.png)
![Screenshot at 00:04: Visual representation of numerous Gmail icons flooding the screen, symbolizing inbox overload.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-00-04.png)
![Screenshot at 00:11: The n8n workflow diagram showing the initial steps: Schedule Trigger -\> Get many messages -\> Aggregate -\> AI Agent.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-00-11.png)
![Screenshot at 00:41: Screenshot of the Google Account creation page, an early prerequisite step for API access.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-00-41.png)
![Screenshot at 01:55: Close-up on the 'Get many messages' node settings, showing the 'Unread emails only' filter applied.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-01-55.png)
![Screenshot at 03:27: Visual display of the n8n node for 'n8n' automation software, which is the tool used to build the workflow.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-03-27.png)
![Screenshot at 04:53: Hostinger pricing comparison showing the KVM 2 plan selected, highlighting the Black Friday deal.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-04-53.png)
![Screenshot at 06:25: Setting the Schedule Trigger to run every 1 day at 5 PM \(17:00\).](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-06-25.png)
![Screenshot at 07:27: Configuring the 'Get many messages' node, selecting the newly created Gmail account credential.](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-07-27.png)
![Screenshot at 08:08: Navigating the Google Cloud Console to the API Library to enable necessary APIs for Gmail access, with the project dropdown highlighted \(showing 'n8n-newsletters'\).](https://ss.rapidrecap.app/screens/jAEG5RMxvNQ/00-08-08.png)
