Send weekly Meta Ads performance PDF reports with Gemini and Gmail
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (7)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - Gmail
n8n-nodes-base.gmail
What it does
Quick overview This workflow runs weekly to pull Meta Ads campaign and ad-level insights from the Meta Graph API, summarizes performance, generates charts with QuickChart, asks Google Gemini for written analysis, converts the resulting HTML report to a PDF via PDFShift, and emails it through Gmail. How it works 1. Runs every Monday at 8:00 AM using a schedule trigger. 2. Builds the reporting date range (last 7/14/30 days based on your schedule setting) and loads the Meta Ads account ID, access token, company name, and report recipient email. 3. Calls the Meta Graph API to fetch ad account details plus daily campaign-level insights for the selected period. 4. Aggregates campaign metrics (spend, impressions, clicks, CTR, CPC, CPM, results, revenue/ROAS) and prepares daily totals used for reporting. 5. Pulls the top ads by spend from the Meta Graph API and fetches each ad’s creative details (thumbnail, body, title) to enrich the ad performance data. 6. Generates chart image URLs with QuickChart, sends a structured performance summary to Google Gemini for narrative insights and next steps, and builds a branded HTML report. 7. Converts the HTML to a PDF using PDFShift and emails the PDF report to the configured recipient via Gmail. Setup 1. Create or obtain a Meta access token with adsread permissions and set your Meta Ads Account ID (without the act prefix) and token in the workflow’s configuration values. 2. Add Google Gemini (PaLM) API credentials for the model call. 3. Add PDFShift HTTP Basic Auth credentials (API key) for the PDF conversion request. 4. Connect a Gmail OAuth2 account and set the recipient email address that should receive the weekly PDF report. 5. (Optional) Update the schedule trigger timing and the reporting schedule setting (Weekly, Biweekly, Monthly) to control when and how far back the report pulls data.