{
  "name": "Gary Club — New Contact → Instant AI Call",
  "nodes": [
    {
      "parameters": {
        "content": "## ⚡ After import — 3 steps\n\n**1. Bind your credential**\nClick the **Initiate Call** node → set **Credential for Header Auth** to your Gary Club Agency key.\n\n**2. Register this webhook in Gary Club**\nCopy the **Production URL** from the **Contact Created** node. In Gary Club → Settings → Webhooks → add the URL for the `contact.created` event.\n\n**3. Set your agent**\nIn the **Call Setup** node, replace the `agent_id` value with the UUID of the Gary Club agent you want to use for outbound calls. Find it in your agent settings.\n\n📋 **Notes**\n- `data.id` — the new contact's UUID (automatically passed as `contact_id` to link the call).\n- `data.phone` — the contact's phone number. If missing, the IF node skips the call so you don't get an error.\n- The IF node checks that a phone number exists before attempting the call — always include this guard.\n- For web-to-call flows, you can replace this webhook trigger with a **Form Webhook** node from the Form → Contact + SMS recipe.\n\n📚 Docs: https://docs.gary.club/api/calls | https://docs.gary.club/api/webhooks",
        "height": 420,
        "width": 400,
        "color": 5
      },
      "id": "aa000000-0000-4000-8000-000000000000",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-220, 60]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "gary-contact-created",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "aa000000-0001-4000-8000-000000000001",
      "name": "Contact Created",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 300],
      "webhookId": "aa000000-webhook-4000-8000-000000000001"
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": false, "leftValue": "", "typeValidation": "loose" },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.body.data.phone }}",
              "rightValue": "",
              "operator": { "type": "string", "operation": "notEmpty" }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "aa000000-0002-4000-8000-000000000002",
      "name": "Has Phone?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "f1", "name": "to", "value": "={{ $('Contact Created').item.json.body.data.phone }}", "type": "string" },
            { "id": "f2", "name": "contact_id", "value": "={{ $('Contact Created').item.json.body.data.id }}", "type": "string" },
            { "id": "f3", "name": "agent_id", "value": "bbbbbbbb-0000-4000-8000-000000000000", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "aa000000-0003-4000-8000-000000000003",
      "name": "Call Setup",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [740, 200]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://agency.gary.club/api/public/v1/calls",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            { "name": "to", "value": "={{ $json.to }}" },
            { "name": "contact_id", "value": "={{ $json.contact_id }}" },
            { "name": "agent_id", "value": "={{ $json.agent_id }}" }
          ]
        },
        "options": {}
      },
      "id": "aa000000-0004-4000-8000-000000000004",
      "name": "Initiate Call",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [980, 200]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ ok: true }) }}",
        "options": { "responseCode": 200 }
      },
      "id": "aa000000-0005-4000-8000-000000000005",
      "name": "Respond 200",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [500, 460]
    }
  ],
  "connections": {
    "Contact Created": { "main": [[{ "node": "Has Phone?", "type": "main", "index": 0 }]] },
    "Has Phone?": {
      "main": [
        [{ "node": "Call Setup", "type": "main", "index": 0 }],
        [{ "node": "Respond 200", "type": "main", "index": 0 }]
      ]
    },
    "Call Setup": { "main": [[{ "node": "Initiate Call", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": [{ "name": "gary-club-api" }]
}
