AutomationFlowsWeb Scraping › Modelo - Alimentar Pixel Externo

Modelo - Alimentar Pixel Externo

MODELO - ALIMENTAR PIXEL EXTERNO. Uses httpRequest. Event-driven trigger; 11 nodes.

Event trigger★★★★☆ complexity11 nodesHTTP Request
Web Scraping Trigger: Event Nodes: 11 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
{
  "updatedAt": "2025-05-15T15:29:21.866Z",
  "createdAt": "2025-05-15T15:12:24.002Z",
  "id": "J0fA6jyrikCmvAc4",
  "name": "MODELO - ALIMENTAR PIXEL EXTERNO",
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -1000,
        200
      ],
      "id": "cb93e291-71f1-4a4f-8242-642924963805",
      "name": "When clicking \u2018Test workflow\u2019"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://graph.facebook.com/v18.0/{{ $json.ID_PIXEL }}/events?access_token={{ $json.TOKEN_API_META }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"data\": [\n    {\n      \"event_name\": \"Deposit\",\n      \"event_time\": {{ Math.floor(new Date($json.DATA.replace(/(\\d{2})-(\\d{2})-(\\d{4})\\s-\\s(\\d{2}:\\d{2})/, '$3-$2-$1T$4-03:00')).getTime() / 1000) }},\n      \"event_source_url\": \"{{ $json.souce_url }}\",\n      \"user_data\": {\n        \"em\": \"{{ $json.email_hash }}\",\n        \"ph\": \"{{ $json.phone_hash }}\"\n      },\n      \"custom_data\": {\n        \"currency\": \"BRL\",\n        \"value\": {{ parseFloat($json.valor) || 0 }}\n      }\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        200
      ],
      "id": "fa451350-7ac4-4ed1-97ca-cce2f4abf4da",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "jsCode": "return items.filter(item => {\n  const dataBruta = item.json[\"DATA\"];\n  if (!dataBruta) return false;\n\n  try {\n    // Divide em [\"07-05-2025\", \"00:00\"]\n    const partes = dataBruta.trim().split(' - ');\n    if (partes.length !== 2) return false;\n\n    const [dia, mes, ano] = partes[0].split('-');\n    const hora = partes[1];\n    \n    // Monta data no formato ISO para o JS entender\n    const dataConvertida = new Date(`${ano}-${mes}-${dia}T${hora}`);\n\n    const dataCorte = new Date(\"2025-05-15T00:00\");\n\n    return dataConvertida > dataCorte;\n  } catch (e) {\n    return false;\n  }\n});\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -120,
        280
      ],
      "id": "b2b54592-1119-408f-ba42-623d0b3ad0ea",
      "name": "Code2"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        180,
        200
      ],
      "id": "14896ef4-4e04-4c47-8d82-30e5dadb22c3",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "jsCode": "// Fun\u00e7\u00e3o SHA-256 em JavaScript puro\nfunction sha256(str) {\n  // Normalizar: remover espa\u00e7os e converter para min\u00fasculas\n  str = str.trim().toLowerCase();\n\n  // Fun\u00e7\u00e3o para converter string em array de bytes (substitui TextEncoder)\n  function stringToBytes(str) {\n    const bytes = [];\n    for (let i = 0; i < str.length; i++) {\n      const char = str.charCodeAt(i);\n      bytes.push(char & 0xff);\n    }\n    return bytes;\n  }\n\n  // Fun\u00e7\u00f5es auxiliares para SHA-256\n  function rightRotate(n, x) {\n    return (x >>> n) | (x << (32 - n));\n  }\n\n  const K = [\n    0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n    0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n    0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n    0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n    0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n    0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n    0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n    0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n  ];\n\n  // Inicializar vari\u00e1veis de hash\n  let H = [\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n  ];\n\n  // Converter string em bytes\n  let msg = stringToBytes(str);\n\n  // Padding\n  const origLen = msg.length * 8;\n  msg.push(0x80);\n  while (msg.length % 64 !== 56) {\n    msg.push(0x00);\n  }\n  // Adicionar comprimento da mensagem\n  for (let i = 7; i >= 0; i--) {\n    msg.push((origLen >>> (i * 8)) & 0xff);\n  }\n\n  // Processar mensagem em blocos de 64 bytes\n  for (let i = 0; i < msg.length; i += 64) {\n    const w = new Array(64);\n    for (let t = 0; t < 16; t++) {\n      w[t] = (msg[i + t * 4] << 24) | (msg[i + t * 4 + 1] << 16) |\n             (msg[i + t * 4 + 2] << 8) | (msg[i + t * 4 + 3]);\n    }\n    for (let t = 16; t < 64; t++) {\n      const s0 = rightRotate(7, w[t - 15]) ^ rightRotate(18, w[t - 15]) ^ (w[t - 15] >>> 3);\n      const s1 = rightRotate(17, w[t - 2]) ^ rightRotate(19, w[t - 2]) ^ (w[t - 2] >>> 10);\n      w[t] = (w[t - 16] + s0 + w[t - 7] + s1) | 0;\n    }\n\n    let [a, b, c, d, e, f, g, h] = H;\n    for (let t = 0; t < 64; t++) {\n      const S1 = rightRotate(6, e) ^ rightRotate(11, e) ^ rightRotate(25, e);\n      const ch = (e & f) ^ (~e & g);\n      const temp1 = (h + S1 + ch + K[t] + w[t]) | 0;\n      const S0 = rightRotate(2, a) ^ rightRotate(13, a) ^ rightRotate(22, a);\n      const maj = (a & b) ^ (a & c) ^ (b & c);\n      const temp2 = (S0 + maj) | 0;\n\n      h = g;\n      g = f;\n      f = e;\n      e = (d + temp1) | 0;\n      d = c;\n      c = b;\n      b = a;\n      a = (temp1 + temp2) | 0;\n    }\n\n    H[0] = (H[0] + a) | 0;\n    H[1] = (H[1] + b) | 0;\n    H[2] = (H[2] + c) | 0;\n    H[3] = (H[3] + d) | 0;\n    H[4] = (H[4] + e) | 0;\n    H[5] = (H[5] + f) | 0;\n    H[6] = (H[6] + g) | 0;\n    H[7] = (H[7] + h) | 0;\n  }\n\n  // Converter hash final para hexadecimal\n  let hash = '';\n  for (let i = 0; i < 8; i++) {\n    for (let j = 3; j >= 0; j--) {\n      hash += ((H[i] >>> (j * 8)) & 0xff).toString(16).padStart(2, '0');\n    }\n  }\n  return hash;\n}\n\n// Fun\u00e7\u00e3o principal para processar itens\nfunction main() {\n  const items = $input.all();\n  for (const item of items) {\n    item.json.email_hash = sha256(item.json.email || '');\n    item.json.phone_hash = sha256(item.json.phone || '');\n  }\n  return items;\n}\n\n// Executar a fun\u00e7\u00e3o principal\nreturn main();"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        200
      ],
      "id": "b1761716-bf83-45d4-bd2a-aadbf18bc831",
      "name": "converte em sha256"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e5874061-832c-47af-b827-e7a7b7d2123f",
              "name": "email",
              "value": "=email@email.com",
              "type": "string"
            },
            {
              "id": "ea79e306-93d7-474c-8915-c32e49c7d6ff",
              "name": "phone",
              "value": "=5511999999999",
              "type": "string"
            },
            {
              "id": "17295034-d1ee-4e6f-a972-3e6bbeb47256",
              "name": "DATA",
              "value": "=15-05-2025 - 00:08",
              "type": "string"
            },
            {
              "id": "e033bda5-0c7d-4650-852c-3e18f0818292",
              "name": "valor",
              "value": "=10",
              "type": "number"
            },
            {
              "id": "0acc5266-5d07-4a70-8b48-c835c0813ad8",
              "name": "souce_url",
              "value": "https://URL.DO.SEU.SITE",
              "type": "string"
            },
            {
              "id": "ed7c4e10-719a-4a54-aaf0-2fcb5c5f5252",
              "name": "TOKEN_API_META",
              "value": "seu token da api do meta",
              "type": "string"
            },
            {
              "id": "e1f3f064-ea01-4b26-a008-096286aa1873",
              "name": "ID_PIXEL",
              "value": "seu id do pixel",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -420,
        200
      ],
      "id": "fc13bca5-4221-4b60-ac97-39cb9381ff7e",
      "name": "DADOS"
    },
    {
      "parameters": {
        "content": "## DADOS\n** trate seus dados aqui",
        "height": 280,
        "width": 220
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        80
      ],
      "typeVersion": 1,
      "id": "68c8b3e5-c31b-48f8-9417-bb4209aa95a9",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## ORIGEM DOS DADOS\n** SHEET, SUPA, BASEROU E ETC\nAQUI SE POE SUA FONTE (MAMUTE)",
        "height": 280,
        "width": 280,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        80
      ],
      "typeVersion": 1,
      "id": "5102fb06-6362-4d1a-b551-9e975864a8cd",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "### ENVIO E LOOPING PARA ENVIAR AO PIXEL DO FACEBOOK\n\n** ATEN\u00c7\u00c3O AO EVENTO",
        "height": 340,
        "width": 760,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        80
      ],
      "typeVersion": 1,
      "id": "a75becc9-276f-47e4-a9e8-03c70cb6e69e",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "### FILTRO DE DATA CASO NECESS\u00c1RIO\n\n**15-05-2025 - 00:08 DD-MM-AAAA - HH:MM\n\nCONECTA APENAS SE NECESS\u00c1RIO\nBRA\u00c7O DE DINOSSAURO",
        "height": 340,
        "width": 320,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        80
      ],
      "typeVersion": 1,
      "id": "f4404fee-c7b5-4cf5-b777-3e568cc0959a",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## START\n** PODE SER CLICK, TRIGLER, WEBHOOK (CAVALO)",
        "height": 280,
        "width": 280,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1060,
        80
      ],
      "typeVersion": 1,
      "id": "9bd5b000-be7d-4d7a-9963-3576353c80ca",
      "name": "Sticky Note4"
    }
  ],
  "connections": {
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "DADOS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        []
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "converte em sha256",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "converte em sha256": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DADOS": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "59f78d20-9960-424f-bd29-fd2648835d54",
  "activeVersionId": null,
  "triggerCount": 0,
  "shared": [
    {
      "updatedAt": "2025-05-15T15:12:24.002Z",
      "createdAt": "2025-05-15T15:12:24.002Z",
      "role": "workflow:owner",
      "workflowId": "J0fA6jyrikCmvAc4",
      "projectId": "86fLtGJ4RKYxddia"
    }
  ],
  "activeVersion": null,
  "tags": []
}
Pro

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

About this workflow

MODELO - ALIMENTAR PIXEL EXTERNO. Uses httpRequest. Event-driven trigger; 11 nodes.

Source: https://github.com/woakes070048/N8N_2025/blob/95a39dbe988cf5a13eb6234468a54d8639792685/modelo---alimentar-pixel-externo-J0fA6jyrikCmvAc4.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

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

Web Scraping

This workflow allows you to import any workflow from a file or another n8n instance and map the credentials easily. A multi-form setup guides you through the entire process At the beginning you have t

Execute Command, Read Write File, HTTP Request +3
Web Scraping

[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. Uses splitInBatches, stickyNote, httpRequest, html. Event-driven trigger; 56 nodes.

HTTP Request, GitHub, Stop And Error +1
Web Scraping

[](https://youtu.be/c7yCZhmMjtI)

HTTP Request, GitHub, Stop And Error +1
Web Scraping

This automation organizes your n8n workflows files into categorizes (Active, Template, Done, Archived) and uploads them directly to a categorized Google Drive folders. It is designed to help users man

Google Drive, HTTP Request, Time Saved
Web Scraping

Create Animated Stories using GPT-4o-mini, Midjourney, Kling and Creatomate API. Uses httpRequest. Event-driven trigger; 51 nodes.

HTTP Request