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 →
{
"name": "Zapp Compartilhado \u2014 Disparo",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "zapp-disparo",
"responseMode": "responseNode",
"options": {}
},
"id": "webhook-1",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
200,
300
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ { \"accepted\": $json.body.recipients.length } }}",
"options": {}
},
"id": "respond-1",
"name": "Respond 200",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
400,
200
]
},
{
"parameters": {
"fieldToSplitOut": "body.recipients",
"options": {}
},
"id": "split-1",
"name": "Split Recipients",
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
400,
400
]
},
{
"parameters": {
"jsCode": "// Render template: substitui {{destinatario}} pelo nome do recipient corrente,\n// e demais {{vars}} pelos valores compartilhados do disparo (disparoVars).\nconst body = $('Webhook').first().json.body;\nconst conteudo = body.conteudoTemplate;\nconst disparoVars = body.disparoVars || {};\nconst rendered = conteudo.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (_, k) => {\n const key = k.toLowerCase();\n if (key === 'destinatario' || key === 'nome') return $json.nome;\n const v = disparoVars[key];\n return v != null ? String(v) : `{{${k}}}`;\n});\nreturn { ...$json, conteudoFinal: rendered };"
},
"id": "render-1",
"name": "Render Template",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
400
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "has-media",
"leftValue": "={{ $('Webhook').first().json.body.attachmentBase64 }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "notEmpty"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "if-1",
"name": "Tem anexo?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
800,
400
]
},
{
"parameters": {
"method": "POST",
"url": "=https://chat.cejusc.com/message/sendMedia/{{ $('Webhook').first().json.body.instanceName }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "apikey",
"value": "={{ $env.EVOLUTION_API_KEY }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ number: $json.telefone, mediatype: $('Webhook').first().json.body.attachmentType || 'document', media: $('Webhook').first().json.body.attachmentBase64, mimetype: $('Webhook').first().json.body.attachmentMime, caption: $json.conteudoFinal, fileName: $('Webhook').first().json.body.attachmentFileName || undefined }) }}",
"options": {
"response": {
"response": {
"neverError": true,
"fullResponse": true
}
}
}
},
"id": "send-media",
"name": "Evolution sendMedia",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1000,
300
]
},
{
"parameters": {
"method": "POST",
"url": "=https://chat.cejusc.com/message/sendText/{{ $('Webhook').first().json.body.instanceName }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "apikey",
"value": "={{ $env.EVOLUTION_API_KEY }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ number: $json.telefone, text: $json.conteudoFinal }) }}",
"options": {
"response": {
"response": {
"neverError": true,
"fullResponse": true
}
}
}
},
"id": "send-text",
"name": "Evolution sendText",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1000,
500
]
},
{
"parameters": {
"jsCode": "// Build per-recipient result\nconst ok = $json.statusCode >= 200 && $json.statusCode < 300;\nconst body = $json.body || {};\nreturn {\n recipientId: $('Split Recipients').item.json.id,\n templateId: $('Webhook').first().json.body.templateId,\n status: ok ? 'sent' : 'failed',\n evolutionMsgId: body?.key?.id || null,\n errorMessage: ok ? null : (typeof body === 'string' ? body : JSON.stringify(body))\n};"
},
"id": "shape-1",
"name": "Shape Result",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1200,
400
]
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"options": {}
},
"id": "agg-1",
"name": "Aggregate Results",
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1400,
400
]
},
{
"parameters": {
"method": "POST",
"url": "=https://vara.brotto.io/api/disparo/callback",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "X-Callback-Secret",
"value": "={{ $('Webhook').first().json.body.callbackSecret }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ varaSlug: $('Webhook').first().json.body.varaSlug, results: $json.data }) }}",
"options": {}
},
"id": "callback-1",
"name": "Callback App",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1600,
400
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Respond 200",
"type": "main",
"index": 0
},
{
"node": "Split Recipients",
"type": "main",
"index": 0
}
]
]
},
"Split Recipients": {
"main": [
[
{
"node": "Render Template",
"type": "main",
"index": 0
}
]
]
},
"Render Template": {
"main": [
[
{
"node": "Tem anexo?",
"type": "main",
"index": 0
}
]
]
},
"Tem anexo?": {
"main": [
[
{
"node": "Evolution sendMedia",
"type": "main",
"index": 0
}
],
[
{
"node": "Evolution sendText",
"type": "main",
"index": 0
}
]
]
},
"Evolution sendMedia": {
"main": [
[
{
"node": "Shape Result",
"type": "main",
"index": 0
}
]
]
},
"Evolution sendText": {
"main": [
[
{
"node": "Shape Result",
"type": "main",
"index": 0
}
]
]
},
"Shape Result": {
"main": [
[
{
"node": "Aggregate Results",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Results": {
"main": [
[
{
"node": "Callback App",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Zapp Compartilhado — Disparo. Uses httpRequest. Webhook trigger; 10 nodes.
Source: https://gist.github.com/brotto/5697331213c17e58352d71d4faede492 — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c