1. What This Workflow Does
This workflow fetches Google Trends data focused on YouTube automatically.
It solves the problem of slow, manual copying and messy data from the web.
The result is a clean JSON file and a short summary emailed straight to users.
The workflow takes a URL for YouTube trends, pulls markdown data using Bright Data’s web unlocker, turns it into plain text, then extracts important topics and descriptions in JSON.
Then, it summarizes this data using Google Gemini AI and emails the summary with files saved locally.
2. Tools and Services Used
- n8n: Main automation platform to run the workflow.
- Bright Data Web Unlocker API: Scrapes Google Trends pages with bypass technology.
- Google Gemini AI (Palm API): Converts markdown to text, extracts structured data, and summarizes results.
- Gmail API: Sends the summary email to recipients.
- Local File System: Stores extracted JSON data for record keeping.
3. Workflow Inputs, Processing, and Outputs
Inputs
- Google Trends URL: Set to focus on YouTube trends by default.
- Bright Data API Key: Needed for web scraping requests.
- Google Palm API Key: Required for AI text processing.
- Gmail OAuth2 Credentials: Needed to send emails.
Processing Steps
- Send request to Bright Data: Fetch markdown data from Google Trends URL.
- Markdown to text conversion: Use AI to make plain readable text.
- Notify on text extraction: Send clean text to an external webhook for monitoring.
- Structured data extraction: AI parses text into JSON with topics and descriptions.
- Prepare binary data: Convert JSON to base64 for writing to disk.
- Write file to disk: Save the JSON file locally.
- Summarize data: AI creates a short summary of trends.
- Notify and email: Send summary to webhook and via Gmail.
Outputs
- JSON file: Stored locally with extracted trend data.
- Email summary: Sent directly to specified email address.
- Webhook notifications: Sent at key steps for logging or alerts.
4. Beginner Step-by-Step: How to Use this Workflow in n8n
Import and Setup
- Download the workflow file using the Download button on this page.
- Open the n8n editor and select “Import from File” from the menu.
- Choose the downloaded workflow file to import it into n8n.
- After import, open the credentials section and add:
- Bright Data API Key with HTTP Header Authentication.
- Google Palm API credentials for Google Gemini AI.
- Gmail OAuth2 credentials for sending emails.
- Open the node Set URL and Bright Data Zone.
Update the Google Trends URL if needed or keep the default YouTube trends URL.
Confirm the Bright Data zone is correct. - Check the email recipient in the Send Summary to Gmail node and change the address if needed.
Testing and Activation
- Click “Execute Node” on the manual trigger node named When clicking ‘Test workflow’ to start the workflow.
- Confirm the workflow runs without errors and the JSON file is saved locally.
- Check email for the summary message.
- If the test is successful, activate the workflow by setting it to active in n8n.
- Optionally, set up a schedule trigger or external event trigger for automatic runs.
For users running self-host n8n, ensure n8n has file write permission and internet access to APIs.
5. Customizations and Tips
- Change Target URL: In the Set URL and Bright Data Zone node, swap the URL to get trends from other Google Trend categories or locales.
- Adjust Data Schema: Edit the JSON schema in the Structured Data Extractor node to include extra fields like traffic or timestamps.
- Webhook URLs: Replace the current HTTP webhook URLs with own services or Slack webhooks to get notifications.
- Email Recipients: Add multiple email addresses in the Send Summary to Gmail node for group reporting.
- File Storage Path: Change the file path in the Write the file to disk node to fit system environment.
6. Common Issues and Troubleshooting
401 Unauthorized on Bright Data Web Request
This usually means the Bright Data API Key is wrong or expired.
Check and update HTTP Header Auth credentials with valid API Key.
Unexpected output from Markdown to Textual Data Extractor
This happens if AI prompt is unclear or markdown data is missing or invalid.
Try refining the prompt or ensure the Bright Data node returns fresh markdown.
Local file not written
Could be lack of write permission or wrong file path in Write the file to disk.
Make sure file system allows write and path is valid for the machine running n8n.
7. Final Thoughts and Results
The workflow turns complex manual work into simple automated steps.
It produces structured Google Trends data in JSON and concise email summaries without manual copying.
✓ Saves 3-4 hours weekly.
✓ Generates error-free data.
✓ Delivers fresh trend summaries by email fast.
✓ Stores local files for audit.
→ Easy to update for other trends or notifications.
→ Makes YouTube-focused trend insights quick and reliable.

