ChatGPTSalesRevenue growthAI score · 73/100AI-assisted edit · no obvious prompt-injection riskn8n.io

Build a Conversational Meta Ads Reporting Assistant with n8n

Input: chat messages; Processing: AI Agent calls Facebook Graph API to query ad accounts, campaigns, and insights; Output: conversational reports and account structure

ExperiencedStepsWorkflowPrompt
Who
Marketers and advertisers who need quick access to Meta Ads data
You get
Query ad account lists, campaign details, and performance metrics (spend, impressions, conversions, etc.) via chat
You need
n8n

Constraints

Prerequisites: n8n instance (self-hosted or cloud), OpenAI API key, Facebook Graph API credentials (with ad account permissions). Template is marked Work-In-Progress. Core functionality depends on an external sub-workflow 'Meta Ads Agent' (workflowId: UXdblREvbkvy3WSs) not included in the template snapshot; you must source or rebuild it separately. Model is configured as gpt-5-mini.

What they did

Author kroziewski published this workflow template in the n8n template library, creating an AI assistant that accesses Meta Ads data through a chat interface. The template uses an AI Agent node driving an OpenAI gpt-5-mini model with Simple Memory, registering three ToolWorkflow tools (list accounts, account details, ad details) plus a Calculator tool. A sub-workflow queries ad account structure, campaign status, and performance insights via Facebook Graph API v23.0.

How it went

No runtime results or user feedback are provided by the source. The template page is marked 'Currently Work-In-Progress'.

Worth knowing

1) Template is marked Work-In-Progress and may change. 2) Core tool nodes depend on external sub-workflow 'Meta Ads Agent' (workflowId: UXdblREvbkvy3WSs), which is not included in the template snapshot; you must source or rebuild it separately. 3) Source mentions 'GPT-5' but the actual node configuration uses gpt-5-mini. 4) This site has not tested the workflow; reproduction=not_tested. 5) Facebook Graph API credentials require ads_read permission and are subject to rate limits and data access tiers.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • OpenAI Chat Model node: connect OpenAI API credentials.
  • graph: adaccounts node: connect facebookGraphApi credentials.
  • account: campaigns node: connect facebookGraphApi credentials.
  • account: adsets node: connect facebookGraphApi credentials.
  • account: ads node: connect facebookGraphApi credentials.
  • account insights node: connect facebookGraphApi credentials.
  • ads: insights node: connect facebookGraphApi credentials.

Configuration to replace

  • Source template is n8n public workflow #7957 (~24 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Configure AI Agent and chat trigger

    After importing the template into n8n, configure the Chat Trigger node (When chat message received) as the entry point. Set the AI Agent node's system message to: =You are a helpful Meta ads assistant. Current date is: {{ $today.format('yyyy-MM-dd') }} Connect the OpenAI Chat Model node, select model gpt-5-mini, and bind your openAiApi credential. Connect the Simple Memory node to maintain conversation context.

    Execution prompt · Source text。AI Agent node Options > System Message field

    =You are a helpful Meta ads assistant.
    
    Current date is: {{ $today.format('yyyy-MM-dd') }}
  2. Register Meta Ads query tools

    Add three ToolWorkflow tool nodes to the AI Agent: list accounts, account details, and ad details. Each binds to the external workflow 'Meta Ads Agent' (workflowId: UXdblREvbkvy3WSs). The account details and ad details nodes use $fromAI so the Agent extracts parameters (account ID, date range) automatically. Also add a Calculator tool for numeric operations.

  3. Configure sub-workflow inputs and routing

    The sub-workflow triggers via 'When Executed by Another Workflow', accepting command, id, since, and until. The 'since, until' node sets defaults: since defaults to start of current month, until to end of current month; override with provided values. The Switch node routes by command: list_accounts → list accounts; account → fetch campaigns/adsets/ads plus insights; list_ads → fetch ad-level insights. The 'fix missing act_' node prepends 'act_' to account IDs if missing.

  4. Configure Facebook Graph API data queries

    Configure Facebook Graph API nodes per route, all using v23.0 with facebookGraphApi credential: - graph: adaccounts — node=me, edge=adaccounts, fields=name - account: campaigns — node={{ $json.id }}, edge=campaigns, fields=id,name,status, filter effective_status=["ACTIVE"] - account: adsets — same node, edge=adsets, fields=id,name,status,campaign - account: ads — same node, edge=ads, fields=id,name,status,campaign{id,name},adset{id,name} - account insights — edge=insights, includes spend/impressions/ctr/cpm/cpc/purchase_roas etc., time range from since/until - ads: insights — fetch ad-level insights data

  5. Assemble and return results

    The Merge node combines campaigns, adsets, ads, and account_insights branches using combineByPosition. A Code node assembles the result into a JSON object returned to the main workflow. The ads: insights branch passes through Code1 to extract ads.data before returning.

Prompt you can copy

Setup guidance · Editorial suggestion。Give to setup assistant: confirm inputs and permissions first, then configure nodes step by step

This block is the prompt. Ads are never placed here.

You are setting up a conversational Meta Ads reporting assistant. First confirm you have: 1) n8n instance access; 2) OpenAI API key; 3) Facebook Graph API credentials with adaccounts permission. After importing the template, configure credentials, verify the AI Agent system message, and ensure the external sub-workflow 'Meta Ads Agent' is available. Test with a test account to verify the account list query returns data.

Before building, confirm your Facebook app has ads_read permission and your test account is linked to an ad account.

Source

Conversational Meta ads reporting & management with GPT-5 · kroziewski · n8n.io · 2025-08-27

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related