Skip to main content

Sync Meta Ads insights to Google Sheets with backfill and weekly ETL

Workflow preview

Workflow preview
100%
Sync Meta Ads insights to Google Sheets with backfill and weekly ETL preview
Open on n8n.io

1. Workflow Overview

Meta Ads Insights to Google Sheets (Backfill & Weekly Sync ETL) This workflow provides a structured way to extract Meta Ads performance data and store it in Google Sheets for reporting, dashboardin...

Best for

  • Market Research automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.splitinbatches, n8n-nodes-base.if, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Muh Resky Adiansyah.

Original n8n.io source

1.1 Workflow description

Title
Sync Meta Ads insights to Google Sheets with backfill and weekly ETL
Workflow name
Sync Meta Ads insights to Google Sheets with backfill and weekly ETL

Meta Ads Insights to Google Sheets (Backfill & Weekly Sync ETL)

This workflow provides a structured way to extract Meta Ads performance data and store it in Google Sheets for reporting, dashboarding, or further analysis.

It is designed as a lightweight, reliable ETL pipeline focused on stability, clarity, and ease of use, rather than building a full data warehouse solution.

What This Workflow Does

At a high level, the system:

  • Pulls Meta Ads Insights data via API
  • Supports both historical backfill and automated incremental sync
  • Splits large date ranges into manageable weekly chunks
  • Handles pagination and retries automatically
  • Filters out zero-spend records before storage
  • Stores clean, structured data in Google Sheets
  • Logs skipped or empty responses for traceability

Architecture Overview

Core Components

  • n8n
  • Meta Ads API
  • Google Sheets

Primary Data Outputs

  • Account_A → Campaign-level data (weekly)
  • Account_B → Ad-level data (daily breakdown)
  • Account_A_Log / Account_B_Log → Logging for skipped or empty responses

End-to-End Flow

A) Dual Entry Points

The workflow supports two execution modes:

  1. Historical Backfill (Manual Trigger) Used to populate past data.
  • Define start_date and end_date
  • Workflow generates 7-day chunks
  • Each chunk is processed sequentially
  1. Incremental Sync (Scheduled Trigger) Runs automatically every 7 days.
  • Dynamically pulls last 7 days
  • No manual input required

B) Period Chunking

Large date ranges are split into weekly intervals.

  • Prevents API overload
  • Reduces risk of timeouts
  • Ensures consistent data retrieval

C) Data Extraction (Per Account)

Each period is processed for two separate data streams:

Account A
  • Level: campaign
  • Granularity: weekly
Account B
  • Level: ad
  • Granularity: daily (time_increment=1)

Both using pagination handling & fail-safe response handling

D) Response Validation

Each API response is validated:

  • Must contain a non-empty data array
  • Invalid or empty responses are redirected to logging

This prevents corrupted or empty data from entering the dataset.

E) Data Transformation

API responses are:

  • Split into individual rows
  • Normalized (numeric fields converted properly)
  • Preserved in full structure (no schema trimming)

F) Filtering Logic

Only meaningful data is stored:

  • Records where spend != 0 are allowed
  • Zero-spend rows are discarded

This keeps the dataset lean and relevant for reporting.

G) Data Loading

Valid records are appended into Google Sheets:

  • Account A → campaign-level table
  • Account B → ad-level table

Each run adds new rows without overwriting previous data.

H) Logging & Traceability

If a period returns:

  • empty data
  • or API anomaly

The workflow logs:

  • status
  • reason
  • account
  • date range
  • execution ID
  • timestamp

This creates a lightweight audit trail for debugging and monitoring.

Safeguards Built In

  • Pagination handling (auto-follow next page)
  • Fail-safe handling for unstable API responses
  • Execution-level traceability via logs
  • Separation between transformation and filtering logic

Google Sheets Schema

Account_A / Account_B

Includes:

  • date range (start & stop)
  • account, campaign, adset, and ad identifiers
  • performance metrics (spend, impressions, clicks, etc.)
  • action arrays and ranking fields
Log Sheets

Columns:

  • status
  • reason
  • account
  • since
  • until
  • execution_id
  • timestamp

Limitations (By Design)

  • Append-only system (no deduplication)
  • Re-running the same period will create duplicate rows
  • No transactional guarantees (Google Sheets limitation)
  • No concurrency control for parallel executions
  • Not designed for real-time reporting

These constraints are intentional to keep the workflow simple and portable.

When This Design Works Well

  • Marketing reporting pipelines
  • Looker Studio / dashboard data sources
  • Small to medium datasets
  • Teams without a data warehouse
  • Lightweight ETL needs

Setup Requirements

  • Meta Ads API access (ads_read permission)
  • Google Sheets (with required tabs)
  • n8n instance (cloud or self-hosted)

Summary

This workflow focuses on:

  • clarity over complexity
  • reliability over completeness
  • practical ETL over perfect data modeling

It is a solid foundation for building marketing data pipelines without heavy infrastructure.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Manual Trigger (Historical Backfill)

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Append to Log Sheet (Account B)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - Workflow Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Split API Response (Account A)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Append to Sheet (Account A)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Fetch Meta Insights (Account A)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 9 - Loop Over Periods (Account A)

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - Valid Response? (Account A)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 11 - Log Skipped Period (Account A)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 12 - Append to Log Sheet (Account A)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 13 - Loop Over Periods (Account B)

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 14 - Fetch Meta Insights (Account B)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 15 - Valid Response? (Account B)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 16 - Split API Response (Account B)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Append to Sheet (Account B)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 18 - If Spend not 0 (Account A)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 19 - If Spend not 0 (Account B)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 20 - Set Incremental Range (Last 7 Days)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Schedule Trigger (Incremental)

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 22 - Generate Weekly Periods

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Set Date Range (Historical Backfill)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Log Skipped Period (Account B)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

3. Summary Table

Workflow Sync Meta Ads insights to Google Sheets with backfill and weekly ETL
Complexity advanced
Nodes 24
Categories Market Research
Author Muh Resky Adiansyah
Published 04 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14721/14721.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Sync Meta Ads insights to Google Sheets with backfill and weekly ETL do?

Meta Ads Insights to Google Sheets (Backfill & Weekly Sync ETL) This workflow provides a structured way to extract Meta Ads performance data and store it in Google Sheets for reporting, dashboardin...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research use case.