{
  "name": "TrustField Agentic Cal Booking",
  "nodes": [
    {
      "parameters": {},
      "id": "trigger",
      "name": "On Interested Reply",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://api.cal.com/v2/slots",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "eventTypeId",
              "value": "={{$env.CAL_COM_EVENT_TYPE_ID}}"
            },
            {
              "name": "startTime",
              "value": "={{$now}}"
            },
            {
              "name": "endTime",
              "value": "={{$now.plus({days: 7})}}"
            }
          ]
        }
      },
      "id": "slots",
      "name": "Cal.com Slots",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.cal.com/v2/bookings",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "eventTypeId",
              "value": "={{$env.CAL_COM_EVENT_TYPE_ID}}"
            },
            {
              "name": "start",
              "value": "={{$json.start}}"
            },
            {
              "name": "attendee",
              "value": "={{$json.attendee}}"
            }
          ]
        }
      },
      "id": "book",
      "name": "Cal.com Book",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "command": "=./scripts/demo_book_agentic.sh --company \"{{$json.company}}\" --ref \"cal:{{$json.uid}}\""
      },
      "id": "log_demo",
      "name": "Log demo-tracker",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        960,
        300
      ]
    }
  ],
  "connections": {
    "On Interested Reply": {
      "main": [
        [
          {
            "node": "Cal.com Slots",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cal.com Slots": {
      "main": [
        [
          {
            "node": "Cal.com Book",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cal.com Book": {
      "main": [
        [
          {
            "node": "Log demo-tracker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "description": "See docs/gtm/AGENTIC_CAL_BOOKING.md \u00b7 demo_book_agentic.sh"
  }
}