AutomationFlowsEmail & Gmail › Sige — Obra Rdo Publicado (e-mail Para O Cliente)

Sige — Obra Rdo Publicado (e-mail Para O Cliente)

SIGE — Obra RDO Publicado (E-mail para o cliente). Uses emailSend. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexity5 nodesEmail Send
Email & Gmail Trigger: Webhook Nodes: 5 Complexity: ★★★★☆ Added:

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 →

Download .json
{
  "name": "SIGE \u2014 Obra RDO Publicado (E-mail para o cliente)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "sige-obra-rdo-publicado",
        "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.rdo_publicado`.\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    rdo_id:            d.rdo_id            || null,\n    numero_rdo:        d.numero_rdo        || '',\n    data_relatorio:    d.data_relatorio    || '',\n    status:            d.status            || '',\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?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "={{ $env.SIGE_FROM_EMAIL }}",
        "toEmail": "={{ $json[\"cliente_email\"] }}",
        "subject": "Novo RDO publicado \u2014 {{ $json[\"obra_nome\"] }} ({{ $json[\"data_relatorio\"] }})",
        "text": "Ol\u00e1 {{ $json[\"cliente_nome\"] }},\n\nFoi publicado um novo Relat\u00f3rio Di\u00e1rio de Obra (RDO {{ $json[\"numero_rdo\"] }}) para a obra *{{ $json[\"obra_nome\"] }}* \u2014 referente ao dia {{ $json[\"data_relatorio\"] }}.\n\nVoc\u00ea pode acompanhar o avan\u00e7o, fotos e ocorr\u00eancias no portal:\n{{ $json[\"portal_obra_url\"] }}\n\n\u2014 Equipe SIGE"
      },
      "id": "send-email",
      "name": "Enviar E-mail",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        1140,
        300
      ],
      "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?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tem e-mail?": {
      "main": [
        [
          {
            "node": "Enviar E-mail",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "active": false,
  "settings": {},
  "tags": [
    {
      "name": "sige"
    },
    {
      "name": "obras"
    },
    {
      "name": "rdo"
    }
  ],
  "_meta": {
    "description": "Workflow exemplo para o evento `obra.rdo_publicado` do SIGE.",
    "env_obrigatorias": [
      "N8N_WEBHOOK_SECRET",
      "SIGE_FROM_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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

SIGE — Obra RDO Publicado (E-mail para o cliente). Uses emailSend. Webhook trigger; 5 nodes.

Source: https://github.com/cassioviller/EnterpriseSync-1/blob/43db84f198555fc1a88987471f5dcaf05f46eae5/n8n_workflows/obra_rdo_publicado.json — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

SIGE — Proposta Expirando (Lembrete por Email + WhatsApp). Uses emailSend, httpRequest. Webhook trigger; 7 nodes.

Email Send, HTTP Request
Email & Gmail

SIGE — Proposta Aprovada (Email + WhatsApp via Evolution API). Uses emailSend, httpRequest. Webhook trigger; 7 nodes.

Email Send, HTTP Request
Email & Gmail

SIGE — Obra Concluída (Aviso para o cliente + comercial). Uses emailSend. Webhook trigger; 6 nodes.

Email Send
Email & Gmail

SIGE — Proposta Rejeitada (Notificação interna por Email + Slack). Uses emailSend, httpRequest. Webhook trigger; 5 nodes.

Email Send, HTTP Request
Email & Gmail

User Onboarding - Rohimaya Publishing. Uses emailSend, supabase, mailchimp, n8n. Webhook trigger; 6 nodes.

Email Send, Supabase, Mailchimp +1