Skip to content

In n8n, copy this file and paste it onto the canvas, or use Import from File.

{
  "name": "New lead to Sheets, Slack and email",
  "flow": [
    { "id": 1, "module": "gateway:CustomWebHook", "version": 1, "parameters": { "hook": 12345, "maxResults": 1 }, "mapper": {},
      "metadata": { "designer": { "name": "Lead Webhook" } } },
    { "id": 2, "module": "google-sheets:addRow", "version": 2, "parameters": { "__IMTCONN__": 1 },
      "mapper": { "spreadsheetId": "1AbCdEfGhIjK", "sheetId": "Leads", "values": { "0": "{{1.name}}", "1": "{{1.email}}", "2": "{{1.budget}}" } },
      "metadata": { "designer": { "name": "Add Lead Row" } } },
    { "id": 3, "module": "builtin:BasicRouter", "version": 1, "metadata": { "designer": { "name": "Router" } }, "routes": [
      { "flow": [
        { "id": 4, "module": "slack:CreateMessage", "version": 4,
          "filter": { "name": "Big budget", "conditions": [[{ "a": "{{1.budget}}", "b": "5000", "o": "number:greater" }]] },
          "mapper": { "channel": "#sales", "text": "Big lead: {{1.name}} ({{1.budget}})" }, "metadata": { "designer": { "name": "Alert Sales" } } }
      ] },
      { "flow": [
        { "id": 5, "module": "google-email:ActionSendEmail", "version": 2,
          "mapper": { "to": ["{{1.email}}"], "subject": "Thanks, {{1.name}}", "content": "Hi {{1.name}}, we got your request and will reply within a day." },
          "metadata": { "designer": { "name": "Thank-you Email" } } },
        { "id": 6, "module": "smartsuite:createRecord", "version": 1,
          "mapper": { "title": "{{1.name}}", "value": "{{formatNumber(1.budget; 0)}}" }, "metadata": { "designer": { "name": "Create SmartSuite Record" } } }
      ] }
    ] }
  ]
}