How to Auto-Refresh Meta Custom Audiences Weekly with n8n (2026)

How to Auto-Refresh Meta Custom Audiences Weekly with n8n (2026)

AS

Written by

Quick overview

Amir Arsalan Sharifi· Founder & Automation Engineer, PEESHEE Ai

TL;DR — Quick Summary

  • Meta does not auto-refresh custom audiences. Without automation, your audience decays weekly as contacts change numbers and delete accounts.
  • An n8n workflow (Schedule Trigger → Sheets → Hash → Meta API) handles the full refresh in under 4 minutes, on a weekly schedule, with zero human action.
  • The API requires you to SHA-256 hash all identifiers before submission — unlike Ads Manager CSV uploads which hash automatically.
  • Add a suppression list sync in the same workflow — remove churned customers automatically so your retargeting stays relevant.

How to Auto-Refresh Meta Custom Audiences Weekly with n8n (No Manual CSV Ever Again)

Every week you don't refresh your Meta custom audience, it gets slightly worse. Contacts change phone numbers. People delete Facebook accounts. New leads you generated this week aren't in the audience yet. A custom audience that started at 50% match rate is at 35% six months later if nobody touches it — and most advertisers never touch it.

The solution is a four-node n8n workflow that runs every Monday morning, pulls new contacts from your Google Sheet, hashes the identifiers, and pushes them to Meta via the Marketing API. Your audience is always current. No exports, no manual uploads, no Ads Manager navigation. The whole thing takes under four minutes to run and zero minutes of human time.

What You Need Before Starting
  • An n8n instance (self-hosted or n8n.cloud)
  • Google Sheets with your contact list (phone in E.164, email, name columns)
  • A Meta Business Manager account with an existing custom audience
  • A Meta access token with ads_management and ads_read permissions
  • Your Meta Audience ID (found in Ads Manager → Audiences → click your audience)

Why Audience Decay Destroys Campaign Performance Over Time

A Meta custom audience is a snapshot, not a live connection. The moment you upload your CSV, Meta matches your contacts against its current user database and creates a static audience. As weeks pass, that audience degrades silently:

  • Contacts who deactivated their Meta account are removed from the matched set
  • Contacts who changed their phone number no longer match
  • New leads you generated this week are not in the audience
  • Churned customers who should be suppressed remain in the retargeting pool

The result: your campaign's CPL creeps up, your ROAS slides, and the audience that was performing well six months ago now underperforms. Most advertisers increase their ad spend looking for the answer. The real answer is a stale audience.

Custom audiences decay because Meta user data is not static — people change phone numbers, update email addresses, and deactivate accounts. Weekly refreshes via the Meta Marketing API maintain match rates close to initial upload levels. Monthly is the minimum refresh frequency to prevent meaningful audience degradation. Source: Unito — Facebook Custom Audiences in 2026; LeadsBridge — Meta Ads Best Practices 2026

The n8n Workflow: Full Architecture

The workflow has five nodes. Each one does a specific job. Together they form a fully autonomous refresh loop that runs without any human involvement once it's live.

Node Type What It Does
1 — Schedule Trigger Trigger Fires every Monday at 6am. Starts the workflow automatically.
2 — Google Sheets Data Reads contacts added since the last sync timestamp. Only new records.
3 — Code (Normalize + Hash) Transform Trims whitespace, standardizes phone to E.164, SHA-256 hashes all identifiers.
4 — HTTP Request (Meta API) Action POSTs hashed payload to Meta audience endpoint. Adds new contacts to audience.
5 — Google Sheets (Mark Synced) Update Stamps the sync timestamp on processed rows. Prevents re-upload next run.

Step-by-Step: Building the Workflow in n8n

Node 1 — Schedule Trigger

Add a Schedule Trigger node. Set to "Cron Expression" → 0 6 * * 1 (every Monday at 6am). If you want daily refreshes for high-volume pipelines, use 0 6 * * *. Click "Save" — this node needs no further configuration.

Node 2 — Google Sheets: Read New Contacts

Add a Google Sheets node. Operation: "Read Rows". Select your spreadsheet and the contacts sheet. In the "Filters" section, add a filter: Synced_to_Meta column → "is empty". This returns only rows that haven't been pushed yet. Connect to Node 1.

Node 3 — Code Node: Normalize and Hash

Add a Code node. Mode: "Run Once for All Items". Paste the hashing logic below. This node standardizes every field and produces a SHA-256 hash for each identifier before any data leaves your infrastructure.

const crypto = require('crypto'); function sha256(v) { if (!v) return null; return crypto.createHash('sha256') .update(String(v).trim().toLowerCase()) .digest('hex'); } function toE164(phone, defaultCC = '971') { if (!phone) return null; let p = String(phone).replace(/[\s\-\(\)]/g, ''); if (p.startsWith('+')) return p.replace('+', ''); // strip + before hashing if (p.startsWith('00')) p = p.slice(2); if (p.startsWith('0')) p = defaultCC + p.slice(1); // UAE: 0501234567 → 971501234567 return p; } return $input.all().map(item => { const r = item.json; const phone = toE164(r.phone); return { json: { phone: sha256(phone), email: sha256(r.email), fn: sha256(r.fn || r.first_name), ln: sha256(r.ln || r.last_name), country: (r.country || 'ae').toLowerCase(), // NOT hashed per Meta spec _row_id: r._row_id || r.row_number // keep for Sheets update }}; });
Node 4 — HTTP Request: Push to Meta Marketing API

Add an HTTP Request node. Method: POST. URL: https://graph.facebook.com/v19.0/YOUR_AUDIENCE_ID/users. Authentication: Header Auth → Key: Authorization → Value: Bearer YOUR_ACCESS_TOKEN. Body: JSON (see structure below). Connect to Node 3.

// Body structure for the HTTP Request node // Use n8n's "Expression" mode to build from Code node output { "payload": { "schema": ["PHONE", "EMAIL", "FN", "LN", "COUNTRY"], "data": [ // n8n expression: {{ $json["phone"] }}, {{ $json["email"] }}, etc. // Or batch all items: use a Batch node before this node ] } } // Meta accepts up to 10,000 records per API call // For larger lists: add a Split In Batches node (size: 5000) before Node 4
Batching large lists: If your weekly new contacts exceed 500 records, insert a "Split In Batches" node between the Code node and HTTP Request. Set batch size to 5,000 (Meta's API maximum per call). n8n will loop automatically through all batches, calling the API once per batch.
Node 5 — Google Sheets: Mark as Synced

Add a second Google Sheets node. Operation: "Update Row". Map the _row_id field from Node 3 to find the correct row. Set the Synced_to_Meta column to the current timestamp: {{ $now.toISO() }}. This prevents rows from being re-uploaded next week.

Adding a Suppression List: Remove Churned Customers Automatically

A refresh workflow that only adds contacts misses half the maintenance problem. Churned customers, refunded buyers, and unsubscribed leads should be removed from your retargeting audience — not just excluded from new uploads. Add a second branch to the workflow after Node 1 that handles removals.

Suppression Branch — DELETE endpoint

In your Google Sheet, maintain a "Churned" tab. When a customer cancels or unsubscribes, add their row there. In n8n, after Node 1, add a parallel branch: Read the Churned tab → Hash identifiers (same Code node logic) → HTTP Request to DELETE https://graph.facebook.com/v19.0/AUDIENCE_ID/users with the same hashed payload structure. Meta removes matched users from the audience within 24 hours.

Getting a Long-Lived Meta Access Token

Short-lived Meta user tokens expire in 1–2 hours and will break your automation immediately. You need a long-lived System User token that does not expire. Here is how to get one:

Creating a Non-Expiring System User Token

In Meta Business Manager: Settings → Users → System Users → Add System User → assign Admin role. Under the System User, click "Generate New Token" → select your ad account → enable ads_management and ads_read scopes → Generate. This token does not expire. Store it in n8n as a credential (never in plain text in your workflow).

Token security: Never hardcode your Meta access token in the n8n HTTP Request node URL or body directly. Store it as an n8n "Header Auth" credential. Anyone with access to your n8n instance can read workflow configurations — credential storage encrypts the token at rest.

Monitoring: Know When the Refresh Runs and What It Matched

Add a final node after Node 4 that logs the API response to a dedicated "Sync Log" sheet. The Meta API returns a num_received and num_invalid_entries count per call. Tracking these weekly shows you if your match rate is improving or degrading, and flags bad data batches before they accumulate.

// Meta API response structure { "audience_id": "12345678", "num_received": 423, // contacts submitted this batch "num_invalid_entries": 12, // formatting errors — check your normalization "invalid_entry_samples": { "PHONE": ["971501XXXXX"] // example of what failed — fix in source data } }
Feed the Pipeline AED 176 one-time

LinkedIn Lead Gen Agent — Keeps Your Google Sheet Growing Automatically

The n8n refresh workflow above is only as good as the contact sheet feeding it. The LinkedIn Lead Gen Agent adds new qualified contacts to your Google Sheet every week — automatically — so the refresh workflow always has fresh data to push to Meta. Together, they form a closed loop: the agent sources contacts, the n8n workflow pushes them to Meta, and your audience grows without any manual work at either end.

  • Adds 50–200 new qualified B2B contacts to your Google Sheet per week
  • Structured output (phone, email, name) matches the sheet schema the n8n workflow reads
  • Works automatically alongside the refresh workflow — no coordination needed
  • One-time purchase — no weekly fees compounding on top of your automation costs
Agent + n8n workflow = a fully autonomous audience that grows and refreshes itself weekly
Get the LinkedIn Lead Gen Agent →

Want the Full Pipeline This Workflow Plugs Into?

This refresh workflow is stage 4 of the complete agentic lead gen pipeline — from AI contact sourcing through to live Meta campaigns.

Read the Full Pipeline Guide Meta Upload Step-by-Step

Questions about n8n setup? WhatsApp us — we respond within the hour.

Frequently Asked Questions

How do I automatically update a Meta custom audience with n8n?

Build a workflow: Schedule Trigger → Google Sheets (read new contacts) → Code node (normalize + SHA-256 hash) → HTTP Request (POST to Meta Marketing API audience endpoint) → Google Sheets (mark synced). The audience updates automatically on schedule without any manual CSV uploads.

How often should you refresh a Meta custom audience?

Weekly is optimal for active lead gen pipelines. Monthly is the minimum. Daily is possible if you add hundreds of new contacts per day. Audiences decay as Meta users change contact info — without refresh, a 50% match rate audience can drop to 35% within six months.

Does Meta automatically update custom audiences?

No. Meta does not pull from your CRM or any external source automatically. You must re-upload a CSV manually or push updates via the Meta Marketing API. n8n automates the API push on a schedule.

What Meta API endpoint do I use to update a custom audience?

POST to https://graph.facebook.com/v19.0/{AUDIENCE_ID}/users with a JSON body containing a schema array and a data array of SHA-256 hashed values. Requires a system user access token with ads_management permission. To remove contacts, use DELETE on the same endpoint.

Why must I hash data before sending to the Meta API?

When uploading via Ads Manager CSV, Meta hashes your data automatically after upload. When using the Marketing API programmatically, you must hash all identifier values with SHA-256 before submitting. Sending raw un-hashed data to the API causes validation errors.

Amir Arsalan Sharifi — AI Consultant & Marketing Psychologist
Amir Arsalan Sharifi AI Consultant & Marketing Psychologist · PhD · Dubai & MENA

Amir is the founder of PEESHEE Ai and a PhD-level marketing psychologist specializing in AI automation, Shopify strategy, and agentic AI systems for businesses across the MENA region.

Back to blog