AutomationFlowsData & Sheets › Unifyone — Meta Capi Event Relay

Unifyone — Meta Capi Event Relay

UnifyOne — Meta CAPI Event Relay. Uses httpRequest. Webhook trigger; 4 nodes.

Webhook trigger★★★★☆ complexity4 nodesHTTP Request
Data & Sheets Trigger: Webhook Nodes: 4 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "UnifyOne \u2014 Meta CAPI Event Relay",
  "description": "Receives server-side conversion events from UnifyOne and relays them to Meta Conversions API. Deduplicates against browser Pixel events using eventId.",
  "nodes": [
    {
      "id": "webhook-trigger",
      "name": "Webhook: CAPI Event",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        200,
        300
      ],
      "parameters": {
        "path": "meta-capi-event",
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "validate-event",
      "name": "Validate Event Payload",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        420,
        300
      ],
      "parameters": {
        "jsCode": "const body = $input.first().json.body || $input.first().json;\nconst required = ['eventName', 'eventId', 'eventTime'];\nfor (const field of required) {\n  if (!body[field]) throw new Error(`Missing required field: ${field}`);\n}\nreturn [{ json: body }];"
      }
    },
    {
      "id": "send-to-meta",
      "name": "HTTP: Send to Meta CAPI",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        640,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "=https://graph.facebook.com/v19.0/{{ $env.META_PIXEL_ID }}/events",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "access_token",
              "value": "={{ $env.META_CAPI_ACCESS_TOKEN }}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "json",
        "body": {
          "data": [
            {
              "event_name": "={{ $json.eventName }}",
              "event_id": "={{ $json.eventId }}",
              "event_time": "={{ $json.eventTime }}",
              "event_source_url": "={{ $json.eventSourceUrl || 'https://1commerce.online' }}",
              "action_source": "website",
              "user_data": {
                "em": "={{ $json.userData?.hashedEmail || '' }}",
                "ph": "={{ $json.userData?.hashedPhone || '' }}",
                "fbp": "={{ $json.userData?.fbp || '' }}",
                "fbc": "={{ $json.userData?.fbc || '' }}",
                "client_ip_address": "={{ $json.userData?.clientIp || '' }}",
                "client_user_agent": "={{ $json.userData?.userAgent || '' }}"
              },
              "custom_data": "={{ $json.customData || {} }}"
            }
          ],
          "test_event_code": "={{ $env.META_TEST_EVENT_CODE || '' }}"
        }
      }
    },
    {
      "id": "respond-success",
      "name": "Respond: Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        860,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={ \"success\": true, \"eventsReceived\": {{ $json.events_received || 1 }} }"
      }
    }
  ],
  "connections": {
    "Webhook: CAPI Event": {
      "main": [
        [
          {
            "node": "Validate Event Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Event Payload": {
      "main": [
        [
          {
            "node": "HTTP: Send to Meta CAPI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Send to Meta CAPI": {
      "main": [
        [
          {
            "node": "Respond: Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "envVarsRequired": [
      "META_PIXEL_ID",
      "META_CAPI_ACCESS_TOKEN"
    ],
    "envVarsOptional": [
      "META_TEST_EVENT_CODE"
    ]
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

UnifyOne — Meta CAPI Event Relay. Uses httpRequest. Webhook trigger; 4 nodes.

Source: https://github.com/t7451/unifyone-netlify-supabase/blob/9d4cc582b9d07ff7f76b24bed4f99f63d47e2a81/n8n-workflows/meta-capi-relay.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

BP_check. Uses googleSheets, @n-octo-n/n8n-nodes-json-database, httpRequest, itemLists. Webhook trigger; 99 nodes.

Google Sheets, @N Octo N/N8N Nodes Json Database, HTTP Request +2
Data & Sheets

v25.1.3. Uses httpRequest, mySql, n8n-nodes-zohozeptomail. Webhook trigger; 98 nodes.

HTTP Request, MySQL, N8N Nodes Zohozeptomail
Data & Sheets

BP_check2. Uses googleSheets, @n-octo-n/n8n-nodes-json-database, httpRequest, itemLists. Webhook trigger; 95 nodes.

Google Sheets, @N Octo N/N8N Nodes Json Database, HTTP Request +2
Data & Sheets

CMM. Uses httpRequest, postgres, redis. Webhook trigger; 90 nodes.

HTTP Request, Postgres, Redis
Data & Sheets

This solution enables you to manage all your Notion and Todoist tasks from different workspaces as well as your calendar events in a single place. This is 2 way sync with partial support for recurring

Redis, Notion, Todoist +6