{
  "name": "Generate client contracts automatically using Google Docs, Drive, and GoHighLevel",
  "nodes": [
    {
      "id": "d53465c0-2029-4272-ad5f-1f6be7026286",
      "name": "Sticky Note: Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -624
      ],
      "parameters": {
        "width": 708,
        "height": 544,
        "content": "## 📄 Automated Contract Generator\n\n### How it works\nWhen a webhook receives client data (name, date, scope of works, PC items, and financials), the workflow copies a master Google Docs contract templa"
      }
    },
    {
      "id": "6c18cc5a-609b-4785-8ae7-4260415960bb",
      "name": "Sticky Note: Webhook",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -48
      ],
      "parameters": {
        "width": 280,
        "height": 380,
        "content": "## 🔗 Webhook Trigger\nReceives a POST request with all client contract details — name, date, scope of works, PC items, and pricing. This is the entry point; nothing runs until this fires."
      }
    },
    {
      "id": "89545069-7529-46a8-8936-ee637f5a1a86",
      "name": "Sticky Note: Template Population",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -48
      ],
      "parameters": {
        "width": 564,
        "height": 384,
        "content": "## 📋 Template Copy & Population\nClones the master Google Docs contract template and replaces all placeholder text with the client's actual data — name, date, scope of works headings and descriptions, "
      }
    },
    {
      "id": "ae0db946-929d-49f3-ab74-b613dc38b65b",
      "name": "Sticky Note: Export & Upload",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        -32
      ],
      "parameters": {
        "width": 492,
        "height": 374,
        "content": "## 📤 Export & Upload to CRM\nDownloads the completed contract as a PDF from Google Drive, then uploads it directly to GoHighLevel via the media API. The PDF is ready to attach to a contact record or se"
      }
    },
    {
      "id": "ca2e06f1-6a0a-4502-bed5-189204883cd1",
      "name": "Sticky Note: Cleanup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -32
      ],
      "parameters": {
        "width": 388,
        "height": 376,
        "content": "## 🗑️ Cleanup\nDeletes the temporary Google Drive copy after the PDF has been successfully uploaded. Keeps your Drive tidy with no leftover contract drafts."
      }
    },
    {
      "id": "b04ffc44-b344-4881-b686-956ebffe482d",
      "name": "Sticky Note: Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2368,
        112
      ],
      "parameters": {
        "width": 292,
        "height": 210,
        "content": "## 🔐 Credentials & Security\nUse OAuth2 for Google Drive and Google Docs. Replace the GoHighLevel Bearer token with a credential stored in n8n — never paste live API keys into node fields for shared te"
      }
    },
    {
      "id": "0d648496-37ae-4658-8200-543dd560d598",
      "name": "Receive Contract Request",
      "type": "n8n-nodes-base.webhook",
      "position": [
        672,
        112
      ]
    },
    {
      "id": "73927614-2bdd-4128-9cc5-90fb5c473e82",
      "name": "Copy Master Template",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        960,
        112
      ]
    },
    {
      "id": "cae4af45-d5a1-4979-8b9d-f0e601137af7",
      "name": "Populate Contract with Client Data",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1264,
        112
      ]
    },
    {
      "id": "3f017f3b-31c3-4d70-abea-3c6ee8157b37",
      "name": "Download Contract as PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1536,
        112
      ]
    },
    {
      "id": "71876bed-020a-4259-8628-0fa726357cb9",
      "name": "Upload PDF to GoHighLevel",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1808,
        112
      ]
    },
    {
      "id": "a994f86b-e5f5-4043-8d19-f654682b18c1",
      "name": "Delete Temp Copy from Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2064,
        112
      ]
    }
  ],
  "connections": {
    "Copy Master Template": {
      "main": [
        [
          {
            "node": "Populate Contract with Client Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Contract as PDF": {
      "main": [
        [
          {
            "node": "Upload PDF to GoHighLevel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Contract Request": {
      "main": [
        [
          {
            "node": "Copy Master Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload PDF to GoHighLevel": {
      "main": [
        [
          {
            "node": "Delete Temp Copy from Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Populate Contract with Client Data": {
      "main": [
        [
          {
            "node": "Download Contract as PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}