π Detect Meta Pixel flatlines with Claude and Gmail alerts
β‘ 4 views Β· π Market Research & Insights
Description
Quick overview
This workflow checks Meta (Facebook) ad account pixels for inactivity using the Meta Marketing API, flags pixels that have stopped firing beyond a defined threshold, asks Anthropic Claude to suggest likely causes and first checks, and emails a readable flatline report via Gmail.
How it works
- Runs manually (or can be switched to a schedule) to start a pixel health check.
- Fetches all Meta ad pixels and their
last_fired_timefrom the Meta Marketing API. - Calculates how many hours each pixel has been quiet and flags pixels as OK, warning, flatlined, or never fired based on your thresholds.
- Sends the flatlined (and optionally never-fired) pixel list to Anthropic Claude to generate a concise JSON diagnosis with a likely cause and first check per pixel.
- Formats the AI output into a human-readable βMeta Pixel Flatline Reportβ including counts, threshold, and per-pixel diagnostics.
- Emails the report using Gmail.
Setup
- Set environment variables for
META_ACCESS_TOKEN,META_AD_ACCOUNT_ID, and optionallyMETA_API_VERSIONto allow the workflow to call the Meta Marketing API. - Set the
ANTHROPIC_API_KEYenvironment variable to enable the Claude diagnosis request. - Add a Gmail credential and configure the Gmail nodeβs recipients/subject as needed for where the report should be sent.
- Adjust
FLATLINE_HOURS,WARN_HOURS, andIGNORE_NEVER_FIREDin the configuration step to match your pixel traffic expectations.
π Nodes Used
HTTP Request, Gmail
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File