{
 "name": "Calendly bookings to Google Sheets + Slack (AutomateRecipes)",
 "nodes": [
  {
   "parameters": {
    "httpMethod": "POST",
    "path": "calendly-booking",
    "responseMode": "onReceived",
    "options": {}
   },
   "id": "3d219d96-da11-4725-a8bb-9d8b9036f2b7",
   "name": "Calendly webhook",
   "type": "n8n-nodes-base.webhook",
   "typeVersion": 2,
   "position": [
    0,
    0
   ],
   "webhookId": "9121df34-ef64-4c64-9e0f-44d4b40f7db6"
  },
  {
   "parameters": {},
   "id": "10335442-fd16-43e9-9901-380d16964745",
   "name": "Run manually (test)",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    200
   ]
  },
  {
   "parameters": {
    "jsCode": "return [{json:{body:{event:'invitee.created',payload:{name:'Jane Doe',email:'jane@example.com',scheduled_event:{name:'30 min consult',start_time:'2026-10-17T11:00:00Z'}}}}},{json:{body:{event:'invitee.canceled',payload:{name:'X',email:'x@example.com',scheduled_event:{name:'y',start_time:'2026-10-18T09:00:00Z'}}}}}];"
   },
   "id": "dd7c20f0-c0bc-4abb-bbf6-0b530029f863",
   "name": "Sample booking",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    220,
    200
   ]
  },
  {
   "parameters": {
    "jsCode": "// Calendly webhook subscriptions need a paid Calendly plan.\nreturn $input.all().map(i=>i.json.body||i.json).filter(b=>b.event==='invitee.created').map(b=>{const p=b.payload,e=p.scheduled_event||{};return {json:{Booked:new Date().toISOString().slice(0,10),Name:p.name,Email:p.email,Event:e.name,Start:e.start_time}}});"
   },
   "id": "7218d12a-4113-4582-9d28-9cc80f04d4d5",
   "name": "New bookings only",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    440,
    100
   ]
  },
  {
   "parameters": {
    "operation": "append",
    "documentId": {
     "__rl": true,
     "mode": "url",
     "value": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit"
    },
    "sheetName": {
     "__rl": true,
     "mode": "name",
     "value": "Bookings"
    },
    "columns": {
     "mappingMode": "autoMapInputData",
     "value": {}
    },
    "options": {}
   },
   "id": "9eec375c-e7ec-46e6-bfb6-c4db8cd683e7",
   "name": "Google Sheets: add row",
   "type": "n8n-nodes-base.googleSheets",
   "typeVersion": 4.5,
   "position": [
    660,
    100
   ]
  },
  {
   "parameters": {
    "select": "channel",
    "channelId": {
     "__rl": true,
     "mode": "name",
     "value": "#bookings"
    },
    "text": "=New booking: {{ $('New bookings only').item.json.Event }} \u2013 {{ $('New bookings only').item.json.Name }} at {{ $('New bookings only').item.json.Start }}",
    "otherOptions": {}
   },
   "id": "321e3979-9ea3-4d3f-a494-d71617e8a255",
   "name": "Slack: post to #bookings",
   "type": "n8n-nodes-base.slack",
   "typeVersion": 2.2,
   "position": [
    880,
    100
   ]
  }
 ],
 "connections": {
  "Calendly webhook": {
   "main": [
    [
     {
      "node": "New bookings only",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Run manually (test)": {
   "main": [
    [
     {
      "node": "Sample booking",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Sample booking": {
   "main": [
    [
     {
      "node": "New bookings only",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "New bookings only": {
   "main": [
    [
     {
      "node": "Google Sheets: add row",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Google Sheets: add row": {
   "main": [
    [
     {
      "node": "Slack: post to #bookings",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "active": false,
 "settings": {
  "executionOrder": "v1"
 },
 "pinData": {}
}