{ "name": "ADsPRO — Receber Alertas do Engine", "nodes": [ { "parameters": { "httpMethod": "POST", "path": "adspro-alertas", "responseMode": "onReceived", "options": {} }, "id": "webhook-alerts", "name": "Webhook (N8N_WEBHOOK_URL)", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [240, 300], "webhookId": "adspro-alertas" }, { "parameters": { "jsCode": "const out = [];\nfor (const item of $input.all()) {\n const p = item.json.body || item.json;\n let message = '';\n if (p.type === 'daily_summary') {\n message = 'šŸ“Š Resumo do dia — Festa Magica\\nšŸ’ø Gasto: R$' + p.spend + '\\nšŸ›’ Compras: ' + p.purchases + '\\nšŸŽÆ CPA: R$' + p.cpa + '\\nšŸ“ˆ ROAS: ' + p.roas + '\\nšŸ‘† CTR: ' + p.ctr + '%';\n } else if (p.type === 'automation_run') {\n const acts = (p.actions || []).map(function (a) { return (a.executed ? 'āœ… EXECUTOU' : 'āš ļø RECOMENDA') + ': ' + a.action + ' — ' + a.campaign + ' (' + a.rule + ')'; }).join('\\n');\n message = 'šŸ¤– Engine rodou (modo ' + p.mode + ')\\n' + (acts || 'Nada disparou.');\n } else {\n message = JSON.stringify(p);\n }\n out.push({ json: { message: message, payload: p } });\n}\nreturn out;" }, "id": "code-format", "name": "Formatar mensagem", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [480, 300] }, { "parameters": {}, "id": "noop-channel", "name": "Enviar (conecte seu canal aqui)", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [720, 300] } ], "connections": { "Webhook (N8N_WEBHOOK_URL)": { "main": [ [ { "node": "Formatar mensagem", "type": "main", "index": 0 } ] ] }, "Formatar mensagem": { "main": [ [ { "node": "Enviar (conecte seu canal aqui)", "type": "main", "index": 0 } ] ] } }, "settings": {}, "active": false }