CORTEXFLOW · FREE FOREVER

Automation

Agency Ad Report Automation — Meta + Google Ads + GA4 Weekly Client Reports

↓ Download workflow JSON

Import in n8n: Workflows → ⋯ → Import from file, then add your credentials. Free download with a free account.

How it works

Your Monday-morning reporting assistant: every Monday at 8 AM it pulls last week’s numbers from Meta Ads, Google Ads, and GA4, computes blended totals, has an AI analyst write a plain-language client summary, emails a branded HTML report to the client, and drops a digest in your Telegram — with every stage logged to Google Sheets:

  1. STEP 1 — Monday trigger + config — Weekly Monday 8AM Trigger fires, CONFIG — Report supplies the client name, sheet ID, client email, Telegram chat ID, and brand color, and Sheets — Log RUN_STARTED opens the audit trail.
  2. STEP 2 — Pull three platforms in parallel — CONFIG — API Access holds every token and ID as PASTE_YOUR_* placeholders, feeding three HTTP requests: Meta Ads — Pull Insights (Graph API: impressions, clicks, spend, actions), Google Ads — Pull GAQL (campaign cost, clicks, conversions), and GA4 — Pull Conversions (Data API: conversions and revenue by channel).
  3. STEP 3 — Blend + sanity check — Merge — Ads Platforms and Merge — All Channels combine the three responses, then IF — Any Data? verifies at least one platform returned rows. Empty data takes the failure branch: Sheets — Log REPORT_FAILED records it and Telegram — Failure Alert pings you, so a silent miss never happens.
  4. STEP 4 — Totals + AI summary — Compute Totals blends everything into total spend, clicks, impressions, conversions, revenue, ROAS, CTR, and CPA, and the sheet flips to DATA_FETCHED. AI Agent — Write Ad Summary (gpt-4o-mini with Structured Output Parser — Summary) returns standout_metric, risk, recommendation, and a 60-second summary, and the sheet flips to SUMMARY_GENERATED.
  5. STEP 5 — Report + delivery — Build Report HTML assembles the branded email, the sheet flips to REPORT_SENT, Gmail — Send Client Report emails the client, and Telegram — Run Digest posts the totals plus the AI take to the agency.

Status flow in Sheets: RUN_STARTED → DATA_FETCHED → SUMMARY_GENERATED → REPORT_SENT (or REPORT_FAILED on empty data)

Set up steps

You’ll need:

Steps:

  1. Import the workflow — in n8n, Workflows → Import from File → select agency-ad-report-automation.json.
  2. CONFIG — Report — open the Set node and fill in:
    • client_name — e.g. Acme Corp (used in the report header and emails)
    • gsheet_id — paste your Google Sheet ID
    • sheet_tab — the log tab name (default Report Log)
    • client_email — where the HTML report is sent
    • telegram_chat_id — your agency chat for the run digest
    • brand_color — hex for the report header (default #FF4D00)
    • lookback_days — reporting window (default 7)
  3. Report Log sheet — create a Google Sheet with a tab named Report Log and headers: timestamp | client_name | stage | detail. The five Sheets nodes (Sheets — Log RUN_STARTED, DATA_FETCHED, SUMMARY_GENERATED, REPORT_SENT, REPORT_FAILED) read gsheet_id and sheet_tab from CONFIG — Report; select your Google Sheets OAuth2 credential in each one.
  4. CONFIG — API Access — paste the six values: meta_access_token, meta_ad_account_id, google_ads_customer_id, google_ads_developer_token, google_oauth_token, ga4_property_id.
  5. CONFIG — AI — the model is gpt-4o-mini by default; select your OpenAI credential in OpenAI Chat Model — Summary.
  6. Connect Gmail + Telegram — select your Gmail OAuth2 credential in Gmail — Send Client Report, and your Telegram Bot API credential in Telegram — Run Digest and Telegram — Failure Alert.
  7. Test, then activate — run once manually, confirm the sheet shows RUN_STARTED → DATA_FETCHED → SUMMARY_GENERATED → REPORT_SENT, check the client email renders, then activate the workflow.

Note: the template authenticates Google Ads and GA4 with a plain OAuth access-token placeholder (google_oauth_token). Google access tokens expire after about an hour, so for production either refresh the token before each run (an n8n Google OAuth2 credential plus a token-refresh step) or wire the two nodes to your own OAuth flow. Meta tokens are long-lived by comparison — generate a long-lived user token in the App Dashboard. GA4 totalRevenue only populates if purchase events are firing on the property.

Customize it

  • Multi-client loop — keep a Clients sheet (name, IDs, emails) and wrap the flow in a Split In Batches loop so one run reports for every retainer client.
  • Week-over-week deltas — store each week’s totals in a second tab and add a Code node that computes spend/ROAS deltas before the AI step; the summary gets much sharper with a trend to react to.
  • Add TikTok or LinkedIn Ads — duplicate one HTTP pull node, extend Compute Totals with the new platform’s fields, and add a row to the report table.
  • PDF attachment — add an HTML-to-PDF step (e.g. a Convert to File or an external API) between Build Report HTML and Gmail for clients who file reports.
  • Slack instead of Telegram — swap the two Telegram nodes for Slack nodes; the digest text works unchanged.
  • Client Q&A — add a Gmail Trigger + a second AI Agent so clients can reply to the report with questions and get answers from the same week’s data.

Workflow nodes

This workflow is built from 23 nodes. Here's what each one does:

#NodeTypeWhat it does
1 Weekly Monday 8AM Trigger Schedule Trigger Starts the workflow automatically on a schedule.
2 CONFIG — Report Set Holds editable configuration values — fill in your own settings here before activating.
3 Sheets — Log RUN_STARTED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
4 CONFIG — API Access Set Holds editable configuration values — fill in your own settings here before activating.
5 Meta Ads — Pull Insights HTTP Request Calls an external API or webhook endpoint.
6 Google Ads — Pull GAQL HTTP Request Calls an external API or webhook endpoint.
7 GA4 — Pull Conversions HTTP Request Calls an external API or webhook endpoint.
8 Merge — Ads Platforms Merge Combines the outputs of two or more branches back into one flow.
9 Merge — All Channels Merge Combines the outputs of two or more branches back into one flow.
10 IF — Any Data? IF Splits the flow into branches based on a condition.
11 Compute Totals Code Runs custom JavaScript to transform, filter, or compute data between steps.
12 Sheets — Log DATA_FETCHED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
13 CONFIG — AI Set Holds editable configuration values — fill in your own settings here before activating.
14 AI Agent — Write Ad Summary AI Agent The AI brain — reasons over the task and calls tools to get it done.
15 OpenAI Chat Model — Summary OpenAI Chat Model The language model powering the AI agent.
16 Structured Output Parser — Summary Structured Output Parser Forces the AI to return clean, structured JSON instead of free text.
17 Sheets — Log SUMMARY_GENERATED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
18 Build Report HTML Set Holds editable configuration values — fill in your own settings here before activating.
19 Sheets — Log REPORT_SENT Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
20 Gmail — Send Client Report Gmail Sends or reads email through your Gmail account.
21 Telegram — Run Digest Telegram Sends you a Telegram message or alert.
22 Sheets — Log REPORT_FAILED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
23 Telegram — Failure Alert Telegram Sends you a Telegram message or alert.

Setup instructions

1. Add your credentials

In n8n go to Credentials → New, create each credential below, then open the named node and select it:

NodeCredential to add
Sheets — Log RUN_STARTED Google Sheets OAuth2
Sheets — Log DATA_FETCHED Google Sheets OAuth2
OpenAI Chat Model — Summary OpenAI API
Sheets — Log SUMMARY_GENERATED Google Sheets OAuth2
Sheets — Log REPORT_SENT Google Sheets OAuth2
Gmail — Send Client Report Gmail OAuth2
Telegram — Run Digest Telegram Bot API
Sheets — Log REPORT_FAILED Google Sheets OAuth2
Telegram — Failure Alert Telegram Bot API

2. Fill in your config values

Open the config node listed below and replace each placeholder with your own value before activating the workflow:

NodeFieldWhat to paste
CONFIG — Report gsheet_id PASTE_YOUR_GSHEET_ID
Your gsheet id
CONFIG — Report client_email PASTE_YOUR_CLIENT_EMAIL
Your client email
CONFIG — Report telegram_chat_id PASTE_YOUR_TELEGRAM_CHAT_ID
Your telegram chat id
CONFIG — API Access meta_access_token PASTE_YOUR_META_ACCESS_TOKEN
Your meta access token
CONFIG — API Access meta_ad_account_id PASTE_YOUR_META_AD_ACCOUNT_ID
Your meta ad account id
CONFIG — API Access google_ads_customer_id PASTE_YOUR_GOOGLE_ADS_CUSTOMER_ID
Your google ads customer id
CONFIG — API Access google_ads_developer_token PASTE_YOUR_GOOGLE_ADS_DEVELOPER_TOKEN
Your google ads developer token
CONFIG — API Access google_oauth_token PASTE_YOUR_GOOGLE_OAUTH_ACCESS_TOKEN
Your google oauth access token
CONFIG — API Access ga4_property_id PASTE_YOUR_GA4_PROPERTY_ID
Your ga4 property id

How this workflow starts

  • Schedule Trigger: Runs every weeks.

Use cases

Every Monday at 8 AM, this workflow pulls last week's numbers from Meta Ads, Google Ads, and GA4 in parallel, blends them into spend, clicks, impressions, conversions, revenue, ROAS, CTR, and CPA, has an AI analyst write a plain-language client summary, emails a branded HTML report to the client, and drops a digest in the agency's Telegram. Every stage is logged to Google Sheets (RUN_STARTED → DATA_FETCHED → SUMMARY_GENERATED → REPORT_SENT). It is built for small agencies and freelancers whose Monday mornings disappear into screenshots and spreadsheet math.

The 3-person agency with 12 retainer clients

A boutique paid-media shop runs ads for a dozen local and DTC clients, and each account manager burns three hours every Monday pulling numbers into a slide deck. With this template, the Weekly Monday 8AM Trigger fires once and the three pull nodes (Meta Ads — Pull Insights, Google Ads — Pull GAQL, GA4 — Pull Conversions) run in parallel. Merge — Ads Platforms and Merge — All Channels combine the responses, Compute Totals blends everything, and AI Agent — Write Ad Summary (gpt-4o-mini with Structured Output Parser — Summary) returns a standout metric, a risk, a recommendation, and a 60-second summary. Build Report HTML assembles the branded email using the brand color from CONFIG — Report, Gmail — Send Client Report delivers it, and Telegram — Run Digest posts the totals plus the AI take to the team. Practical variation: keep a Clients sheet with names, IDs, and emails, and wrap the flow in a Split In Batches loop so a single Monday run reports for every retainer client.

The solo freelancer defending retainer value

A freelance media buyer manages seven accounts and constantly fields the question "what am I paying for?" from clients who never log into ad dashboards. The Sheets audit trail is the answer: the Report Log tab shows RUN_STARTED through REPORT_SENT, proving the report went out on schedule every week. More valuable is the structured AI output: the risk field surfaces a creeping CPA and the recommendation field gives the freelancer a concrete talking point for the monthly call. CONFIG — Report holds client name, client email, and brand color per copy, so each client gets a report that looks made just for them. Practical tip: store each week's totals in a second sheet tab and add a Code node computing week-over-week spend and ROAS deltas before the AI step — the summary gets noticeably sharper with a trend to react to.

The in-house marketer reporting to a non-technical founder

A sole marketer at a DTC brand spends Friday afternoons translating dashboards for a founder who ignores every chart. The plain-language 60-second summary from AI Agent — Write Ad Summary is the whole product: one paragraph the founder will actually read, anchored by a standout metric and one recommendation. Build Report HTML renders it in a branded layout so it reads like a briefing, not a spreadsheet. For TikTok or LinkedIn spend, duplicate one HTTP pull node, extend Compute Totals with the new platform's fields, and add a row to the report table. Practical tip: set the lookback window in CONFIG — Report to 30 days once a month for a monthly rollup edition without building a second workflow.

The lead-gen agency that needs early warnings

A lead-gen agency for home-services businesses once discovered broken conversion tracking three weeks late, after the client had already noticed. Two features of this workflow exist for exactly that failure mode. First, IF — Any Data? verifies at least one platform returned rows; empty data takes the failure branch — Sheets — Log REPORT_FAILED records it and Telegram — Failure Alert pings the team — so a silent miss never happens. Second, the AI's risk field is prompted to flag anomalies like sudden conversion drops. Practical variation: add an extra condition that treats zero conversions as a failure even when spend data exists, so a tracking break triggers the alert branch instead of a cheerful report about impressions.

The consultant packaging reporting as a productized service

A marketing consultant wants to sell "weekly ad reporting" as a fixed-price add-on without hiring anyone. This template is the delivery mechanism: import one copy per client, fill in CONFIG — Report and the six CONFIG — API Access placeholders, and the service runs itself. For clients who file reports, add an HTML-to-PDF step between Build Report HTML and Gmail so the email carries an attachment. If the team lives in Slack rather than Telegram, swap the two Telegram nodes for Slack nodes — the digest text works unchanged. Practical tip: the client Q&A customization (a Gmail Trigger plus a second AI agent answering replies from the same week's data) turns the report into an interactive deliverable worth charging more for.

← All templates