{
  "name": "Setter Report Template (Form → Notion → Discord)",
  "nodes": [
    {
      "parameters": {
        "content": "## 🔴 Google Forms — Webhook SOP\n\nGoogle Forms has no native webhook. You connect it using a built-in tool called Apps Script. Takes about 5 minutes.\n\n---\n\n### Step 1 — Get the webhook URL\nClick the **Webhook** node in this workflow → copy the **Production URL**.\n\n---\n\n### Step 2 — Open Apps Script\n1. Open your Google Form\n2. Click **Extensions** in the top menu\n3. Click **Apps Script**\nA code editor opens in a new tab.\n\n---\n\n### Step 3 — Paste the script\nDelete everything in the editor. Paste this:\n\nfunction onFormSubmit(e) {\n  var items = e.response.getItemResponses();\n  var data = {};\n  items.forEach(function(item) {\n    data[item.getItem().getTitle()] = item.getResponse();\n  });\n  UrlFetchApp.fetch(\"PASTE_WEBHOOK_URL_HERE\", {\n    method: \"post\",\n    contentType: \"application/json\",\n    payload: JSON.stringify(data)\n  });\n}\n\nReplace PASTE_WEBHOOK_URL_HERE with the URL you copied.\n\n---\n\n### Step 4 — Save the script\nClick the floppy disk icon (or Ctrl+S).\nName the project anything — e.g. \"Setter Webhook\".\n\n---\n\n### Step 5 — Create the trigger\n1. Click the **clock icon** in the left sidebar (Triggers)\n2. Bottom right → click **+ Add Trigger**\n3. Set these options:\n   - Function: **onFormSubmit**\n   - Deployment: **Head**\n   - Event source: **From form**\n   - Event type: **On form submit**\n4. Click **Save**\n\n---\n\n### Step 6 — Authorise the script\nGoogle will open a permissions popup.\n1. Click **Review permissions**\n2. Choose your Google account\n3. Click **Advanced** → **Go to [project name] (unsafe)**\n4. Click **Allow**\n\nThis is normal — Google flags any third-party script. It only runs when your form is submitted.\n\n---\n\n### Step 7 — Test it\n1. Open your Google Form → click the eye icon (preview)\n2. Submit a test response\n3. In n8n → go to **Executions** (left sidebar)\n4. You should see a new execution triggered\n5. Click it → open the Webhook node output\n6. Check the field names — copy them exactly into the **Code in JavaScript** node\n\n---\n\n⚠️ **Important:** The webhook only fires on real submissions, not preview/edit mode.",
        "height": 1252,
        "width": 1004,
        "color": 5
      },
      "id": "e2404c02-3f05-4b3c-8a5b-b04af24e7849",
      "name": "Google Forms Webhook Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -528,
        -1312
      ]
    },
    {
      "parameters": {
        "content": "## 📋 Setter Report — Setup Guide\n\n**How this works:**\nForm submitted → webhook fires → Notion page created with all 11 answers → Discord notified\n\n**Full SOP:** https://slpframes.com\n(Leverage → Automated Weekly Setter Reports)\n\n---\n\n## Step 1 — Create your setter form\nUse Google Forms, JotForm, or Typeform.\nCopy the 11 questions from the SOP above.\n\n---\n\n## Step 2 — Copy the webhook URL\nClick the **Webhook** node → copy the Production URL shown at the top.\n\n---\n\n## Step 3 — Connect your form\n**JotForm:** Settings → Integrations → Webhook → paste URL\n**Typeform:** Connect → Webhooks → Add → paste URL\n**Google Forms:** see the sticky note to the left ←\n\n---\n\n## Step 4 — Update field names in the Code node\nOpen **Code in JavaScript**. Keys must match your exact question labels.\n\n---\n\n## Step 5 — Replace placeholders\n- YOUR_NOTION_DATABASE_ID\n- YOUR_NOTION_API_KEY\n- YOUR_DISCORD_SERVER_ID\n- YOUR_WEEKLY_SALES_REPORTS_CHANNEL_ID\n\nThen activate the workflow.",
        "height": 644,
        "width": 680,
        "color": 3
      },
      "id": "eaec8c64-691e-4bf6-ab8f-16c437324f21",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        624,
        -720
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "setter-weekly-report",
        "options": {}
      },
      "id": "8d6297a4-97e9-488d-9749-b43daa2d6313",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "setter-weekly-report"
    },
    {
      "parameters": {
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "value": "YOUR_NOTION_DATABASE_ID",
          "mode": "id"
        },
        "title": "={{ $json.body['Your full name'] }}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Type|select",
              "selectValue": "Setter"
            }
          ]
        },
        "blockUi": {
          "blockValues": []
        },
        "options": {}
      },
      "id": "42e83236-2a09-43a2-a9dc-43b5a1fb6899",
      "name": "Create Notion Page",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        224,
        0
      ],
      "credentials": {
        "notionApi": {
          "id": "h6B4aYDP3e5LmL7E",
          "name": "Notion account Dwayne"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const body = $('Webhook').item.json.body;\nconst notionPageId = $input.first().json.id;\n\n// ── FIELD MAPPING ─────────────────────────────────────────────────────\n// Keys must match your form question labels EXACTLY (case-sensitive).\n// After your first test submission, check the Webhook node output\n// to see the exact keys your form sends — then update these.\n\nconst name          = body['Your full name'] || '';\nconst weekEnding    = body['Week ending date'] || '';\nconst outbound      = body['How many outbound conversations did you start this week?'] || '0';\nconst booked        = body['How many discovery calls did you book?'] || '0';\nconst showed        = body['How many of those booked calls actually showed up?'] || '0';\nconst noShow        = body['How many no-showed?'] || '0';\nconst cancelled     = body['How many cancelled last minute (under 2 hours before the call)?'] || '0';\nconst objections    = body[\"What were the top 3 objections you heard when people DIDN'T book? (One per line)\"] || '';\nconst bestOpener    = body['What was your best performing opener or hook this week?'] || '';\nconst hitTarget     = body['Did you hit your weekly booking target? If no — what specifically got in the way?'] || '';\nconst needsFromTeam = body['What do you need from content or the team this week to perform better?'] || '';\n\n// ── BUILD NOTION BLOCKS ───────────────────────────────────────────────\nconst blocks = [];\n\nconst p = (content, bold = false) => ({\n  object: 'block', type: 'paragraph',\n  paragraph: { rich_text: [{ type: 'text', text: { content: String(content) }, annotations: { bold } }] }\n});\nconst h2 = (content) => ({\n  object: 'block', type: 'heading_2',\n  heading_2: { rich_text: [{ type: 'text', text: { content } }] }\n});\n\nblocks.push(p('Setter: ' + name, true));\nblocks.push(p('Week Ending: ' + weekEnding));\nblocks.push(h2('📊 Weekly KPIs'));\nblocks.push(p('Outbound conversations started: ' + outbound));\nblocks.push(p('Discovery calls booked: ' + booked));\nblocks.push(p('Showed up: ' + showed));\nblocks.push(p('No-shows: ' + noShow));\nblocks.push(p('Last-minute cancellations (<2 hrs): ' + cancelled));\n\nconst qualitative = [\n  { label: \"Top 3 Objections (People Who Didn't Book)\", value: objections },\n  { label: 'Best Opener or Hook This Week', value: bestOpener },\n  { label: 'Hit Weekly Booking Target?', value: hitTarget },\n  { label: 'Needs From Content / Team', value: needsFromTeam }\n];\n\nfor (const q of qualitative) {\n  blocks.push(h2(q.label));\n  const answer = q.value;\n  if (answer.length <= 1900) {\n    blocks.push(p(answer));\n  } else {\n    for (let i = 0; i < answer.length; i += 1900) {\n      blocks.push(p(answer.slice(i, i + 1900)));\n    }\n  }\n}\n\nreturn [{ json: {\n  notionPageId,\n  notionPayload: JSON.stringify({ children: blocks }),\n  notionUrl: $input.first().json.url,\n  setterName: name\n} }];"
      },
      "id": "3baaf1fc-ba29-4f55-9d21-3a524746e09b",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        448,
        0
      ]
    },
    {
      "parameters": {
        "method": "PATCH",
        "url": "=https://api.notion.com/v1/blocks/{{ $json.notionPageId }}/children",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_NOTION_API_KEY"
            },
            {
              "name": "Notion-Version",
              "value": "2022-06-28"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ $json.notionPayload }}",
        "options": {}
      },
      "id": "6dc48ad8-8e28-46f0-b821-5256dd7c6451",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        672,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const notionUrl = $('Code in JavaScript').item.json.notionUrl;\nconst name = $('Code in JavaScript').item.json.setterName;\n\nconst now = new Date();\nconst formatted = now.toLocaleString('en-GB', {\n  timeZone: 'UTC', year: 'numeric', month: 'long',\n  day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: false\n});\n\nreturn [{ json: { formattedDate: formatted, notionUrl, setterName: name } }];"
      },
      "id": "1cdcddfd-5cd5-40fb-b7cf-2b14b708d42c",
      "name": "Code in JavaScript1",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        896,
        0
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "guildId": {
          "__rl": true,
          "value": "YOUR_DISCORD_SERVER_ID",
          "mode": "id"
        },
        "channelId": {
          "__rl": true,
          "value": "YOUR_WEEKLY_SALES_REPORTS_CHANNEL_ID",
          "mode": "id"
        },
        "content": "=📋 New setter report submitted! @everyone\n\nSetter: {{ $('Code in JavaScript').item.json.setterName }}\nSubmitted: {{ $json.formattedDate }}\n\n**[View in Notion]({{ $json.notionUrl }})**",
        "options": {}
      },
      "id": "b5816bef-731b-4030-a96f-8768a339dce9",
      "name": "Send a message",
      "type": "n8n-nodes-base.discord",
      "typeVersion": 2,
      "position": [
        1120,
        0
      ],
      "webhookId": "c7f3cf6c-fcde-4aa9-a8bd-cb0e3ce5689a",
      "credentials": {
        "discordBotApi": {
          "id": "LL1NGpwu4o3MZkdY",
          "name": "ECGroup Sales"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Create Notion Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Notion Page": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": true
  },
  "versionId": "b827c60d-398e-4952-808b-5a9c1c61cd00",
  "meta": {
    "aiBuilderAssisted": true,
    "builderVariant": "mcp",
    "instanceId": "5185a83f97534d4adc925ed1672fee925d013547b712fbeada89bb6c418f7edc"
  },
  "id": "sRBEp31gMb7LDcqc",
  "tags": [
    {
      "updatedAt": "2025-09-04T13:14:26.735Z",
      "createdAt": "2025-09-04T13:14:26.735Z",
      "id": "DWbGCR01Eld9zt1C",
      "name": "Notion"
    },
    {
      "updatedAt": "2026-04-11T10:27:59.690Z",
      "createdAt": "2026-04-11T10:27:59.690Z",
      "id": "QqUYYl9jHBHn52oU",
      "name": "Setters"
    },
    {
      "updatedAt": "2026-04-08T14:47:56.582Z",
      "createdAt": "2026-04-08T14:47:56.582Z",
      "id": "SBmG51P2Uz6sVZJq",
      "name": "Sales team"
    },
    {
      "updatedAt": "2026-05-15T17:51:36.837Z",
      "createdAt": "2026-05-15T17:51:36.837Z",
      "id": "j21tiBy6ag0iHLC3",
      "name": "Template"
    }
  ]
}