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": "Precifique \u2014 Afiliada Venda",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "afiliado-venda",
"responseMode": "onReceived",
"responseData": "firstEntryJson",
"options": {}
},
"id": "webhook-venda",
"name": "Webhook Venda",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.body.whatsapp }}",
"operation": "isNotEmpty"
},
{
"value1": "={{ $json.body.nome }}",
"operation": "isNotEmpty"
},
{
"value1": "={{ $json.body.valor_comissao }}",
"operation": "isNotEmpty"
}
]
}
},
"id": "validar-campos-venda",
"name": "Validar Campos",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
460,
300
]
},
{
"parameters": {
"jsCode": "const raw = $input.first().json.body.whatsapp || '';\nconst digits = raw.replace(/\\D/g, '');\nlet number = digits;\nif (!number.startsWith('55')) {\n number = '55' + number;\n}\nconst body = $input.first().json.body;\nconst valorFmt = String(body.valor_comissao).replace('.', ',');\nreturn [{ json: { ...body, whatsapp_fmt: number, valor_fmt: valorFmt } }];"
},
"id": "formatar-telefone-venda",
"name": "Formatar Telefone",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
680,
200
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $env.EVOLUTION_URL }}/message/sendText/{{ $env.EVOLUTION_INSTANCE }}",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $env.EVOLUTION_API_KEY }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"number\": \"{{ $json.whatsapp_fmt }}\",\n \"text\": \"\ud83c\udf89 {{ $json.nome }}, voc\u00ea fez uma venda!\\n\\nUma pessoa comprou o Precifique pelo seu link e voc\u00ea ganhou *R$ {{ $json.valor_fmt }}* de comiss\u00e3o! \ud83d\udc9c\\n\\nAcompanhe seus ganhos no painel:\\n{{ $json.link_painel }}\\n\\nContinue divulgando! Cada indica\u00e7\u00e3o vale R$ 12,90 no seu bolso. \ud83d\ude80\"\n}",
"options": {
"response": {
"response": {
"neverError": true
}
}
}
},
"id": "whatsapp-venda",
"name": "WhatsApp Comiss\u00e3o",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
900,
200
]
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.statusCode }}",
"operation": "smallerEqual",
"value2": 299
}
]
}
},
"id": "checar-resposta-venda",
"name": "Enviou OK?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1120,
200
]
},
{
"parameters": {
"jsCode": "console.error('[afiliado-venda] Falha ao enviar WhatsApp:', JSON.stringify($input.first().json));\nreturn [];"
},
"id": "log-erro-venda",
"name": "Log Erro Envio",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1340,
300
]
},
{
"parameters": {
"jsCode": "const item = $input.first().json;\nconsole.error('[afiliado-venda] Campos inv\u00e1lidos:', JSON.stringify(item.body));\nreturn [];"
},
"id": "log-campos-invalidos-venda",
"name": "Log Campos Inv\u00e1lidos",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
680,
400
]
}
],
"connections": {
"Webhook Venda": {
"main": [
[
{
"node": "Validar Campos",
"type": "main",
"index": 0
}
]
]
},
"Validar Campos": {
"main": [
[
{
"node": "Formatar Telefone",
"type": "main",
"index": 0
}
],
[
{
"node": "Log Campos Inv\u00e1lidos",
"type": "main",
"index": 0
}
]
]
},
"Formatar Telefone": {
"main": [
[
{
"node": "WhatsApp Comiss\u00e3o",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Comiss\u00e3o": {
"main": [
[
{
"node": "Enviou OK?",
"type": "main",
"index": 0
}
]
]
},
"Enviou OK?": {
"main": [
[],
[
{
"node": "Log Erro Envio",
"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
Precifique — Afiliada Venda. Uses httpRequest. Webhook trigger; 7 nodes.
Source: https://github.com/Cjota221/calculadora/blob/b551be6de69b77f1a57f1c064c6fd4ff73fa0633/n8n/afiliado-venda.json — 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