{
  "name": "Formulário do site no WhatsApp e na planilha (template Wobs Digital)",
  "nodes": [
    {
      "id": "7c9a767a-33dc-423f-b571-f343d36c2689",
      "name": "Formulário de orçamento",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.6,
      "position": [
        0,
        200
      ],
      "parameters": {
        "formTitle": "Peça seu orçamento",
        "formDescription": "Preencha os dados e a gente chama você no WhatsApp. Ao enviar, você concorda em receber mensagens neste número sobre o seu pedido.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Nome",
              "fieldName": "Nome",
              "fieldType": "text",
              "requiredField": true,
              "placeholder": "Seu nome"
            },
            {
              "fieldLabel": "WhatsApp",
              "fieldName": "WhatsApp",
              "fieldType": "text",
              "requiredField": true,
              "placeholder": "(19) 99999-1234"
            },
            {
              "fieldLabel": "Interesse",
              "fieldName": "Interesse",
              "fieldType": "textarea",
              "requiredField": false,
              "placeholder": "Conte o que você precisa"
            }
          ]
        },
        "responseMode": "onReceived",
        "options": {
          "path": "orcamento",
          "buttonLabel": "Enviar pedido",
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "respondWith": "text",
              "formSubmittedText": "Recebemos! Em instantes você recebe uma mensagem no WhatsApp."
            }
          }
        }
      }
    },
    {
      "id": "bc69c380-dbe1-4b44-96a9-2a39920d9383",
      "name": "Organizar os dados",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        240,
        200
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "nome",
              "name": "nome",
              "type": "string",
              "value": "={{ $json.Nome }}"
            },
            {
              "id": "whatsapp",
              "name": "whatsapp",
              "type": "string",
              "value": "={{ (function (d) { return d.length <= 11 ? \"55\" + d : d; })(String($json.WhatsApp || \"\").replace(/\\D/g, \"\").replace(/^0+/, \"\")) }}"
            },
            {
              "id": "interesse",
              "name": "interesse",
              "type": "string",
              "value": "={{ $json.Interesse || \"Não informado\" }}"
            },
            {
              "id": "data",
              "name": "data",
              "type": "string",
              "value": "={{ $now.setZone(\"America/Sao_Paulo\").toFormat(\"dd/MM/yyyy HH:mm\") }}"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "f4fb92d9-7c72-4a54-ad0e-69df6c70e2c8",
      "name": "Mandar WhatsApp para o cliente",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1.1,
      "position": [
        480,
        200
      ],
      "onError": "continueRegularOutput",
      "parameters": {
        "resource": "message",
        "operation": "sendTemplate",
        "phoneNumberId": "SEU_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ $('Organizar os dados').first().json.whatsapp }}",
        "template": "boas_vindas_lead|pt_BR",
        "components": {
          "component": [
            {
              "type": "body",
              "bodyParameters": {
                "parameter": [
                  {
                    "type": "text",
                    "text": "={{ $('Organizar os dados').first().json.nome }}"
                  }
                ]
              }
            }
          ]
        }
      }
    },
    {
      "id": "f145648f-4c55-4b63-b010-8d8c630573bd",
      "name": "Anotar na planilha",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        720,
        200
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "SEU_ID_DA_PLANILHA"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Data": "={{ $('Organizar os dados').first().json.data }}",
            "Nome": "={{ $('Organizar os dados').first().json.nome }}",
            "WhatsApp": "={{ $('Organizar os dados').first().json.whatsapp }}",
            "Interesse": "={{ $('Organizar os dados').first().json.interesse }}",
            "Status": "Novo"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Data",
              "displayName": "Data",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Nome",
              "displayName": "Nome",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "WhatsApp",
              "displayName": "WhatsApp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Interesse",
              "displayName": "Interesse",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "7ab60ce4-fc65-4928-af19-e088c40ab2af",
      "name": "Avisar a equipe por e-mail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        960,
        200
      ],
      "parameters": {
        "resource": "message",
        "operation": "send",
        "sendTo": "seu-email@suaempresa.com.br",
        "subject": "=Novo lead: {{ $(\"Organizar os dados\").first().json.nome }}",
        "emailType": "html",
        "message": "=<p><b>Novo lead no site</b></p><p>Nome: {{ $(\"Organizar os dados\").first().json.nome }}<br>WhatsApp: {{ $(\"Organizar os dados\").first().json.whatsapp }}<br>Interesse: {{ $(\"Organizar os dados\").first().json.interesse }}<br>Recebido em: {{ $(\"Organizar os dados\").first().json.data }}</p><p><a href=\"https://wa.me/{{ $(\"Organizar os dados\").first().json.whatsapp }}\">Chamar no WhatsApp agora</a></p>",
        "options": {
          "appendAttribution": false
        }
      }
    },
    {
      "id": "c12f0310-71b3-4d64-b6ff-04e752f7edf2",
      "name": "Como configurar",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -20,
        -430
      ],
      "parameters": {
        "content": "## Formulário do site que cai no WhatsApp, na planilha e no seu e-mail (template Wobs Digital)\nO cliente preenche o formulário, o n8n organiza o telefone, manda uma mensagem no WhatsApp, anota o lead na planilha e avisa a sua equipe por e-mail.\n\n**Antes de ativar, configure:**\n1. Credencial **WhatsApp Business Cloud** no nó de WhatsApp, e troque `SEU_PHONE_NUMBER_ID` pelo ID do seu número.\n2. Crie e aprove, na Meta, o **modelo de mensagem** `boas_vindas_lead` (português do Brasil, com uma variável para o nome).\n3. Credencial **Google Sheets** e a planilha: troque `SEU_ID_DA_PLANILHA`. A aba `Leads` precisa ter na linha 1: Data, Nome, WhatsApp, Interesse, Status.\n4. Credencial **Gmail** e o e-mail de destino da equipe.\n\nSem credenciais incluídas. Passo a passo completo: wobsdigital.tech/blog",
        "color": 5,
        "width": 960,
        "height": 420
      }
    }
  ],
  "connections": {
    "Formulário de orçamento": {
      "main": [
        [
          {
            "node": "Organizar os dados",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Organizar os dados": {
      "main": [
        [
          {
            "node": "Mandar WhatsApp para o cliente",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mandar WhatsApp para o cliente": {
      "main": [
        [
          {
            "node": "Anotar na planilha",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anotar na planilha": {
      "main": [
        [
          {
            "node": "Avisar a equipe por e-mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}