{
  "name": "Generate and email PDF payslips from Google Sheets with Gmail",
  "nodes": [
    {
      "id": "c4cfd869-eec5-49c9-b866-48fa3bd39119",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2560,
        368
      ]
    },
    {
      "id": "e326b4a7-be63-4ad9-ac69-96068c8db253",
      "name": "Company Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -2352,
        368
      ]
    },
    {
      "id": "a8a21d06-1edc-400f-9c26-7373fb8da0c1",
      "name": "Fetch Payroll Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2128,
        368
      ]
    },
    {
      "id": "da81de85-ad5b-499b-9334-c4368dcd8c28",
      "name": "Iterate Payslip Rows",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1680,
        304
      ]
    },
    {
      "id": "750961aa-cf88-4c19-b510-cfac9769be1f",
      "name": "Prepare Payslip Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1456,
        288
      ]
    },
    {
      "id": "2e0c5829-2360-43d4-a527-a2518d75ff22",
      "name": "Check Email Not Sent",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1904,
        368
      ]
    },
    {
      "id": "4482e304-38a7-40e1-a826-9af818a95f67",
      "name": "Generate Payslip HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        -1232,
        288
      ]
    },
    {
      "id": "53df5b3b-2bb1-4db0-a051-fd4325ded35b",
      "name": "Generate Payslip PDF",
      "type": "n8n-nodes-puppeteer.puppeteer",
      "position": [
        -1008,
        288
      ]
    },
    {
      "id": "2df79e27-95c0-457e-bc29-e3e97ce20aca",
      "name": "Create PDF File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -784,
        288
      ]
    },
    {
      "id": "5f081a5d-2db0-4336-a936-9982bd41f0e0",
      "name": "Send Payslip Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -560,
        288
      ]
    },
    {
      "id": "42f8dc37-3f3f-4cf9-8adc-944164ed425d",
      "name": "Mark Email Sent in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -352,
        288
      ]
    },
    {
      "id": "28642d8e-dcff-4bac-be8d-79f61e49310c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        528
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "cb040c93-1945-4be2-a9c3-13f38ae5d5dd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        528
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "db9843d7-7562-4554-a05c-595a4c8aeea7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        528
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "052fe0ea-ab42-4326-8f6a-c5ada8c5d292",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        528
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "fdab71ad-e026-43e6-ade7-0ea39e2dffdd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        528
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "79284cac-77fd-4bbc-9db8-390b26d9584f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        896
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "175f2dfd-c839-48b9-8ce3-d4e705eade39",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3424,
        -80
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Company Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create PDF File": {
      "main": [
        [
          {
            "node": "Send Payslip Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Payroll Data": {
      "main": [
        [
          {
            "node": "Check Email Not Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Payslip Email": {
      "main": [
        [
          {
            "node": "Mark Email Sent in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Email Not Sent": {
      "main": [
        [
          {
            "node": "Iterate Payslip Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Payslip PDF": {
      "main": [
        [
          {
            "node": "Create PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Iterate Payslip Rows": {
      "main": [
        [],
        [
          {
            "node": "Prepare Payslip Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Payslip Data": {
      "main": [
        [
          {
            "node": "Generate Payslip HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Company Configuration": {
      "main": [
        [
          {
            "node": "Fetch Payroll Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Payslip HTML": {
      "main": [
        [
          {
            "node": "Generate Payslip PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Email Sent in Sheet": {
      "main": [
        [
          {
            "node": "Iterate Payslip Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}