{
  "name": "Auto-generate and auto-fill business documents with Google Sheets & Gmail",
  "nodes": [
    {
      "id": "171902dc-bc1e-41a0-bbde-f9ad294a25a8",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -440,
        -60
      ]
    },
    {
      "id": "e506b2b6-4948-4fd5-b292-bb60de3584f6",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        80,
        -60
      ]
    },
    {
      "id": "4621dd93-5acd-4c52-862d-859973a25cf2",
      "name": "Get employees",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -160,
        -60
      ]
    },
    {
      "id": "6a0caf1d-301e-49fb-8f7a-d902a80b8476",
      "name": "Create agreement",
      "type": "n8n-nodes-craftmypdf.craftMyPdf",
      "position": [
        340,
        -40
      ]
    },
    {
      "id": "35b1c198-c56c-4826-91aa-664686bf3ca0",
      "name": "Get agreement",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        860,
        -60
      ]
    },
    {
      "id": "1a7ce678-eb84-4213-a0ef-539854353e81",
      "name": "Upload agreement",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        340,
        200
      ]
    },
    {
      "id": "0024b884-2bc4-4c53-8d35-db61bb351880",
      "name": "Update row",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        860,
        260
      ]
    },
    {
      "id": "0c6b6f65-5331-4c80-8ad4-1e3d89361ecd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        -360
      ],
      "parameters": {
        "width": 520,
        "height": 220,
        "content": "## PRELIMINARY STEPS\n\nOnly works with the self-hosted version of n8n\n- Clone this [Sheet](https://docs.google.com/spreadsheets/d/1YQPuoEubRHJepRKdquks69Iqf2XdGVKfpWOdYwk3RMg/edit?usp=sharing)\n- Create"
      }
    },
    {
      "id": "4cea2139-0fd1-4ec0-a48d-5adfcaad268f",
      "name": "Success?",
      "type": "n8n-nodes-base.if",
      "position": [
        580,
        -40
      ]
    },
    {
      "id": "0701598a-fdb8-4fd3-8b2d-14487c82bf8c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        -620
      ],
      "parameters": {
        "width": 520,
        "height": 240,
        "content": "## Auto-Generate Business Documents in PDF\n \n\nThis workflow allows you to generate contracts in bulk (job proposals, general documents, pay slips, invoices, contracts, etc.) in PDF format, starting fr"
      }
    },
    {
      "id": "34ea77ea-cb4f-4227-be35-da9932f72111",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        580,
        260
      ]
    },
    {
      "id": "18541572-a7fb-42b9-91ec-1275fd116ac7",
      "name": "Send email with PDF",
      "type": "n8n-nodes-base.gmail",
      "position": [
        340,
        380
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Update row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success?": {
      "main": [
        [
          {
            "node": "Get agreement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get agreement": {
      "main": [
        [
          {
            "node": "Upload agreement",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send email with PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get employees": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Create agreement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create agreement": {
      "main": [
        [
          {
            "node": "Success?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload agreement": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send email with PDF": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get employees",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}