n8n: novo lead → resumo com IA → email Fluxo n8n importável, só com nós padrão: recebe um lead por POST, pede ao Claude Haiku 5.5 um resumo de 5 linhas em pt-PT e envia-o por email com os dados originais, mesmo que a IA falhe. Depois de importar: credenciais Header Auth (x-api-key) e SMTP, troca <O_TEU_EMAIL> e <O_TEU_DOMINIO> e ativa. O webhook é público: liga Header Auth no nó Webhook ou põe um limite de pedidos à frente.
· workflow.json No known keys or hidden characters · n8n · Claude · v1· CC BY 4.0 No known keys or hidden characters
Neer checks every version before saving it: it refuses known key and token formats and hidden characters, and warns about commands that need attention. It is not an audit.
workflow.json Install
Paste the JSON into the n8n editor (Ctrl+V) or use Import from File.
1 { 2 "name": "Novo lead - resumo IA - email", 3 "nodes": [ 4 { 5 "parameters": { 6 "httpMethod": "POST", 7 "path": "novo-lead", 8 "responseMode": "responseNode", 9 "options": {} 10 }, 11 "id": "1a111111-1111-4111-8111-111111111111", 12 "name": "Webhook", 13 "type": "n8n-nodes-base.webhook", 14 "typeVersion": 2, 15 "position": [ 16 240, 17 300 18 ], 19 "webhookId": "novo-lead" 20 }, 21 { 22 "parameters": { 23 "method": "POST", 24 "url": "https://api.anthropic.com/v1/messages", 25 "authentication": "genericCredentialType", 26 "genericAuthType": "httpHeaderAuth", 27 "sendHeaders": true, 28 "headerParameters": { 29 "parameters": [ 30 { 31 "name": "anthropic-version", 32 "value": "2023-06-01" 33 } 34 ] 35 }, 36 "sendBody": true, 37 "specifyBody": "json", 38 "jsonBody": "={{ JSON.stringify({ model: \"claude-haiku-5-5\", max_tokens: 1024, output_config: { effort: \"low\" }, messages: [{ role: \"user\", content: \"Resume este lead em 5 linhas, em pt-PT, e sugere um próximo passo concreto.\\n\\nNome: \" + ($json.body.nome || \"\") + \"\\nEmail: \" + ($json.body.email || \"\") + \"\\nMensagem: \" + ($json.body.mensagem || \"\") }] }) }}", 39 "options": {} 40 }, 41 "id": "2b222222-2222-4222-8222-222222222222", 42 "name": "Resumir lead com IA", 43 "type": "n8n-nodes-base.httpRequest", 44 "typeVersion": 4.2, 45 "position": [ 46 460, 47 300 48 ], 49 "credentials": { 50 "httpHeaderAuth": { 51 "id": "", 52 "name": "Anthropic (x-api-key)" 53 } 54 }, 55 "onError": "continueRegularOutput" 56 }, 57 { 58 "parameters": { 59 "fromEmail": "leads@<O_TEU_DOMINIO>", 60 "toEmail": "<O_TEU_EMAIL>", 61 "subject": "=Novo lead: {{$('Webhook').item.json.body.nome}}", 62 "emailFormat": "text", 63 "text": "={{ (($json.content || []).find(b => b.type === \"text\") || {}).text || \"Resumo indisponível: a chamada à IA falhou.\" }}\n\n---\nNome: {{ $('Webhook').item.json.body.nome }}\nEmail: {{ $('Webhook').item.json.body.email }}\nMensagem: {{ $('Webhook').item.json.body.mensagem }}", 64 "options": { 65 "appendAttribution": false 66 } 67 }, 68 "id": "3c333333-3333-4333-8333-333333333333", 69 "name": "Enviar email", 70 "type": "n8n-nodes-base.emailSend", 71 "typeVersion": 2.1, 72 "position": [ 73 680, 74 300 75 ] 76 }, 77 { 78 "parameters": { 79 "respondWith": "json", 80 "responseBody": "={\n \"ok\": true\n}", 81 "options": {} 82 }, 83 "id": "4d444444-4444-4444-8444-444444444444", 84 "name": "Responder ao webhook", 85 "type": "n8n-nodes-base.respondToWebhook", 86 "typeVersion": 1.1, 87 "position": [ 88 900, 89 300 90 ] 91 } 92 ], 93 "connections": { 94 "Webhook": { 95 "main": [ 96 [ 97 { 98 "node": "Resumir lead com IA", 99 "type": "main", 100 "index": 0 101 } 102 ] 103 ] 104 }, 105 "Resumir lead com IA": { 106 "main": [ 107 [ 108 { 109 "node": "Enviar email", 110 "type": "main", 111 "index": 0 112 } 113 ] 114 ] 115 }, 116 "Enviar email": { 117 "main": [ 118 [ 119 { 120 "node": "Responder ao webhook", 121 "type": "main", 122 "index": 0 123 } 124 ] 125 ] 126 } 127 }, 128 "active": false, 129 "settings": { 130 "executionOrder": "v1" 131 }, 132 "pinData": {} 133 } 134 Licence: CC BY 4.0.