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": "SIGE \u2014 Obra Conclu\u00edda (Aviso para o cliente + comercial)",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "sige-obra-concluida",
"responseMode": "onReceived",
"responseData": "allEntries",
"options": {
"rawBody": true
}
},
"id": "webhook-in",
"name": "Webhook (POST)",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"functionCode": "// Valida\u00e7\u00e3o HMAC-SHA256 (X-Signature) \u2014 segredo em $env.N8N_WEBHOOK_SECRET.\nconst crypto = require('crypto');\nconst secret = $env.N8N_WEBHOOK_SECRET || '';\nconst given = ($input.first().json.headers || {})['x-signature'] || '';\nlet body = $input.first().json.body ? JSON.stringify($input.first().json.body) : '';\ntry {\n if ($input.first().binary && $input.first().binary.data) {\n body = Buffer.from($input.first().binary.data, 'base64').toString('utf8');\n }\n} catch (e) {}\nif (!secret) return [{ json: { ...$input.first().json, _signature_skipped: 'no_secret' } }];\nconst expected = crypto.createHmac('sha256', secret).update(body, 'utf8').digest('hex');\nconst ok = expected.length === given.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(given));\nif (!ok) throw new Error('Assinatura HMAC inv\u00e1lida (X-Signature n\u00e3o confere)');\nreturn [{ json: { ...$input.first().json, _signature_ok: true } }];"
},
"id": "validate-hmac",
"name": "Validar Assinatura HMAC",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
460,
300
]
},
{
"parameters": {
"functionCode": "// Normaliza payload do evento `obra.concluida`.\nconst body = $input.first().json.body || $input.first().json;\nconst d = (body && body.data) || {};\nreturn [{\n json: {\n obra_id: d.obra_id || null,\n obra_nome: d.obra_nome || 'Obra',\n cliente_nome: d.cliente_nome || 'Cliente',\n cliente_email: d.cliente_email || '',\n data_conclusao: d.data_conclusao || '',\n data_inicio: d.data_inicio || '',\n data_previsao_fim: d.data_previsao_fim || '',\n valor_contrato: d.valor_contrato || 0,\n portal_obra_url: d.portal_obra_url || '',\n admin_id: body.admin_id || null\n }\n}];"
},
"id": "extract",
"name": "Extrair Dados",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
680,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json[\"cliente_email\"] }}",
"operation": "isNotEmpty"
}
]
}
},
"id": "if-has-email",
"name": "Tem e-mail do cliente?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
900,
200
]
},
{
"parameters": {
"fromEmail": "={{ $env.SIGE_FROM_EMAIL }}",
"toEmail": "={{ $json[\"cliente_email\"] }}",
"subject": "Obra {{ $json[\"obra_nome\"] }} conclu\u00edda",
"text": "Ol\u00e1 {{ $json[\"cliente_nome\"] }},\n\nTemos uma boa not\u00edcia: a obra *{{ $json[\"obra_nome\"] }}* foi marcada como CONCLU\u00cdDA em {{ $json[\"data_conclusao\"] }}.\n\nVoc\u00ea pode revisar o hist\u00f3rico, RDOs e medi\u00e7\u00f5es no portal:\n{{ $json[\"portal_obra_url\"] }}\n\nMuito obrigado pela parceria \u2014 em breve enviaremos o termo de encerramento.\n\n\u2014 Equipe SIGE"
},
"id": "send-email-cliente",
"name": "E-mail Cliente",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2,
"position": [
1140,
200
],
"credentials": {
"smtp": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"fromEmail": "={{ $env.SIGE_FROM_EMAIL }}",
"toEmail": "={{ $env.SIGE_COMERCIAL_EMAIL }}",
"subject": "[Comercial] Obra {{ $json[\"obra_nome\"] }} conclu\u00edda \u2014 gerar follow-up de encerramento",
"text": "Obra *{{ $json[\"obra_nome\"] }}* (id {{ $json[\"obra_id\"] }}) \u2014 cliente {{ $json[\"cliente_nome\"] }} \u2014 conclu\u00edda em {{ $json[\"data_conclusao\"] }} (in\u00edcio: {{ $json[\"data_inicio\"] }}, previs\u00e3o original: {{ $json[\"data_previsao_fim\"] }}, valor contrato: R$ {{ $json[\"valor_contrato\"] }}).\n\nLembrar de: termo de encerramento, pesquisa de satisfa\u00e7\u00e3o, follow-up de novas oportunidades.\n\nPortal: {{ $json[\"portal_obra_url\"] }}"
},
"id": "send-email-comercial",
"name": "E-mail Comercial",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2,
"position": [
1140,
420
],
"credentials": {
"smtp": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Webhook (POST)": {
"main": [
[
{
"node": "Validar Assinatura HMAC",
"type": "main",
"index": 0
}
]
]
},
"Validar Assinatura HMAC": {
"main": [
[
{
"node": "Extrair Dados",
"type": "main",
"index": 0
}
]
]
},
"Extrair Dados": {
"main": [
[
{
"node": "Tem e-mail do cliente?",
"type": "main",
"index": 0
},
{
"node": "E-mail Comercial",
"type": "main",
"index": 0
}
]
]
},
"Tem e-mail do cliente?": {
"main": [
[
{
"node": "E-mail Cliente",
"type": "main",
"index": 0
}
],
[]
]
}
},
"active": false,
"settings": {},
"tags": [
{
"name": "sige"
},
{
"name": "obras"
}
],
"_meta": {
"description": "Workflow exemplo para o evento `obra.concluida` \u2014 envia agradecimento ao cliente e cria follow-up para o comercial.",
"env_obrigatorias": [
"N8N_WEBHOOK_SECRET",
"SIGE_FROM_EMAIL",
"SIGE_COMERCIAL_EMAIL"
]
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
smtp
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
SIGE — Obra Concluída (Aviso para o cliente + comercial). Uses emailSend. Webhook trigger; 6 nodes.
Source: https://github.com/cassioviller/EnterpriseSync-1/blob/d7fcfe6a1ae16237b86ac38938fccb2e4173b930/n8n_workflows/obra_concluida.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.
SIGE — Proposta Expirando (Lembrete por Email + WhatsApp). Uses emailSend, httpRequest. Webhook trigger; 7 nodes.
SIGE — Proposta Rejeitada (Notificação interna por Email + Slack). Uses emailSend, httpRequest. Webhook trigger; 5 nodes.
User Onboarding - Rohimaya Publishing. Uses emailSend, supabase, mailchimp, n8n. Webhook trigger; 6 nodes.
Automate WhatsApp communication for recruitment agencies with an interactive, structured customer experience. This workflow handles pricing inquiries, request submissions, tracking, complaints, and hu
Code. Uses googleSheets, gmail, supabase, stickyNote. Webhook trigger; 51 nodes.