A marketing agency with 15 clients was spending 6-8 hours every Monday writing performance reports. An account manager would open Google Ads, Meta Ads Manager, GA4, and a spreadsheet. Copy numbers. Write a summary. Format an email. Send it. Repeat 15 times.
I built an n8n workflow that does all of it in 90 seconds. Here's the exact architecture.
The Problem (In Detail)
The agency's reporting process looked like this:
- Open Google Ads → export last week's metrics (spend, clicks, impressions, conversions, CPA, ROAS)
- Open Meta Ads Manager → export the same metrics
- Open GA4 → export sessions, bounce rate, goal completions
- Open a spreadsheet → paste everything, calculate week-over-week deltas
- Write a narrative → "Spend increased 12% but CPA dropped 8%, suggesting the new creative is performing well..."
- Format an email → paste into a branded HTML template, add the client's logo
- Send → one email per client
- Repeat → 15 clients × 40 minutes each = 10 hours
The narrative was the worst part. Every week, the same person wrote 15 variations of "metrics went up/down, here's why." It was soul-crushing work that required just enough brainpower to be exhausting but not enough to be interesting.
The Solution: A 14-Node n8n Workflow
The workflow runs on a cron trigger every Monday at 8 AM. Here's the node-by-node breakdown:
Node 1: Cron Trigger
Fires every Monday at 08:00 UTC. Configurable per agency.
Node 2: Google Sheets — Read Client Config
Reads a "Clients" sheet with one row per client:
- Client name
- Email address
- Google Ads customer ID
- Meta Ad Account ID
- GA4 property ID
- Logo URL
- Report day (some clients want Tuesday)
This is the "database." Adding a new client = adding a row. No code changes.
Node 3: Split In Batches
Processes one client at a time. If one client's API call fails, the others still get their reports.
Node 4: HTTP Request — Google Ads API
Pulls last week's metrics: spend, clicks, impressions, conversions, CPA, ROAS. Uses the Google Ads API with a service account.
Node 5: HTTP Request — Meta Graph API
Pulls the same metrics from Meta. Uses a long-lived access token stored in n8n credentials.
Node 6: HTTP Request — GA4 Data API
Pulls sessions, bounce rate, and goal completions.
Node 7: Merge
Combines all three data sources into a single JSON object per client.
Node 8: Calculate Deltas
Computes week-over-week changes:
spend_delta = (this_week_spend - last_week_spend) / last_week_spend × 100
Same for clicks, conversions, CPA, ROAS.
Node 9: AI — Gemini Narrative Generation
This is the magic. Sends the metrics + deltas to Google Gemini with this prompt:
"You are a marketing analyst writing a weekly performance report for a client. Given the metrics below, write a 3-paragraph summary: (1) key wins, (2) areas of concern, (3) one specific, actionable recommendation for next week. Be concise, professional, and specific. Reference actual numbers. Do not use generic filler like 'overall performance was strong.' Metrics: {metrics_json}"
The AI writes something like:
"Google Ads spend increased 12% ($4,200 → $4,704) while CPA dropped 8% ($42 → $38.64), indicating the new responsive search ads are converting more efficiently. Meta's CPM rose 15% — likely due to increased auction competition in your vertical. Recommendation: shift 10-15% of Meta budget to Google Ads to capitalize on the efficiency gain, and test two new creative variants on Meta to combat rising CPMs."
Node 10: AI Confidence Check
Checks the Gemini response for:
- Length (must be 100-500 words)
- Presence of specific numbers (must reference at least 2 metrics)
- Absence of hallucination markers ("as an AI", "I cannot")
If confidence is low, the report is flagged for human review instead of being sent.
Node 11: Build HTML Email
Generates a branded HTML email with:
- Client's logo (from the config sheet)
- KPI cards (spend, clicks, conversions, ROAS) with green/red delta arrows
- The AI-written narrative
- A "Questions? Reply to this email" footer
Node 12: Gmail — Send
Sends the HTML email to the client's address.
Node 13: Google Sheets — Log
Logs the send: timestamp, client, status (sent/failed/flagged), email ID.
Node 14: Slack — Agency Recap
Posts a summary to the agency's Slack:
"✅ 14/15 client reports sent. ⚠️ 1 flagged for review (Client X — AI confidence below threshold). Total time: 87 seconds."
Error Handling (The Part Most Tutorials Skip)
Every external API call (Google Ads, Meta, GA4, Gemini, Gmail) has:
- 3× retry with exponential backoff (1s, 2s, 4s)
- Error branch → logs to a "Failed Reports" sheet + Slack alert
- Idempotency → the email ID is the dedup key; re-running the workflow won't double-send
If Gemini returns garbage, the confidence check catches it. If Gmail fails, the report goes to the "Failed" sheet for manual send. Nothing is silently dropped.
Real Results
| Metric | Before | After |
|---|---|---|
| Time per reporting cycle | 6-8 hours | 90 seconds |
| Reports sent per week | 15 (manual) | 15 (automatic) |
| Narrative quality | Generic, repetitive | Specific, data-driven |
| Error rate | Human typos | 0 (validated) |
| Cost per cycle | ~$200 in labor | ~$0.06 in API fees |
The agency owner's reaction: "I got my Mondays back."
The Stack
- n8n (self-hosted) — workflow orchestration
- Google Gemini — AI narrative (free tier handles ~500 reports/month)
- Google Ads API — paid search metrics
- Meta Graph API — social metrics
- GA4 Data API — web analytics
- Gmail API — email delivery
- Google Sheets API — client config + audit trail
- Slack API — agency recap
Total API cost: ~$0.06/week for 15 clients. The Gemini free tier covers most agencies.
Want This for Your Agency?
The full n8n workflow JSON is in my open-source portfolio:
→ github.com/Sasidhar-Sunkesula/n8n-workflow-showcase
It's workflow #05 (Automated Agency Client Reporting). Import the JSON, add your API keys, configure the client sheet, and you're running.
I have 14 other production workflows covering lead scoring, invoice extraction, customer onboarding, competitor monitoring, support triage, and more.
→ Live portfolio + ROI calculator
Done-For-You Option
If you'd rather not set it up yourself, I build these as a service:
- Setup: $500-800 (custom workflow for your data sources + branding + deployment)
- Monthly retainer: $200-300/mo (monitoring, updates, priority support)
Message me or reach out through the portfolio site. Happy to do a paid pilot before any ongoing arrangement.
I'm Sasidhar — a Full-Stack Developer specializing in production n8n automation. 15 workflows in production across 8 domains. I write about practical automation with real architectures, not theoretical AI.
Top comments (0)