{
  "name": "Automated invoice generation & payment reminders with QuickBooks, Jotform & GPT-4o",
  "nodes": [
    {
      "id": "9c594f0d-b9d7-4329-8017-90bbc445cc43",
      "name": "Receive form submission",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -464,
        0
      ]
    },
    {
      "id": "20ea495b-ef6e-4bb4-a3a4-8fa95b17a77d",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        0
      ]
    },
    {
      "id": "16ccee04-eefb-4e38-a5d4-3c65e26f779f",
      "name": "Get the product",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        1248,
        0
      ]
    },
    {
      "id": "51fda0e5-2c6e-40cc-a967-76426f4bcf36",
      "name": "Create the invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        1856,
        0
      ]
    },
    {
      "id": "2e729c72-459b-4448-892c-4f7b14af1eb6",
      "name": "Send the invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        2160,
        0
      ]
    },
    {
      "id": "9fb60975-4ab2-465d-b0c3-27669702b49f",
      "name": "Check if the customer exists",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        112,
        0
      ]
    },
    {
      "id": "465941dd-9b14-4651-bff1-d5c62a6b52aa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Receive Submission\nReceives the product/service form submission from Jotform"
      }
    },
    {
      "id": "fd542ca6-d362-4d9d-8469-0a0493d8092e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -112
      ],
      "parameters": {
        "width": 400,
        "height": 320,
        "content": "## Check If Customer exists \nChecks if the customer exists in QBO or not"
      }
    },
    {
      "id": "10412197-c39a-4b71-a8ae-f025c30c6a88",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -336
      ],
      "parameters": {
        "width": 304,
        "height": 336,
        "content": "## Customer Exists\nNow since the customer exists we will update the customer details like updating the billing details with the new one"
      }
    },
    {
      "id": "77b8565e-bd0a-4fd7-a23c-7bdd2c94cd42",
      "name": "Create the customer",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        608,
        176
      ]
    },
    {
      "id": "aa96c6e2-418b-45d1-848d-cef54e891550",
      "name": "Update the customer",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        608,
        -192
      ]
    },
    {
      "id": "a27bb89f-7797-4e4e-b104-0b739d05ee0d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        48
      ],
      "parameters": {
        "width": 304,
        "height": 320,
        "content": "## Customer Doesn't Exist\nNow since the customer doesn't exist we will create new customer"
      }
    },
    {
      "id": "3c029901-edd6-4085-a4b9-578adecf5164",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Get The Item\nGets the selected product/service from QBO"
      }
    },
    {
      "id": "4c978dba-767e-4327-a1b2-2626fac272a7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Create The Invoice\nCreates a new invoice for that customer"
      }
    },
    {
      "id": "7eb0c556-eeb0-47ff-bc78-8050056f6dbe",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Send The Invoice\nSends the newly created invoice for that customer(via email)"
      }
    },
    {
      "id": "cb13f312-4f56-45ad-b462-fe120cd79c62",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -416
      ],
      "parameters": {
        "width": 1072,
        "height": 1280,
        "content": "## Generate Invoices and Send Reminders for Customers with Jotform, QuickBooks and Gmail\nThis workflow automates the entire process of receiving a product/service order, checking or creating a custome"
      }
    },
    {
      "id": "f4d77f45-9142-4c1c-b125-e8e5f24ed59d",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Format Data\nFormats the data thus making it easier to be used in other nodes"
      }
    },
    {
      "id": "b66c8925-e5af-4ad3-83bf-8b8db88fa5bc",
      "name": "Format data",
      "type": "n8n-nodes-base.code",
      "position": [
        -160,
        0
      ]
    },
    {
      "id": "3ef848b5-f0c9-4e48-994a-1ec16d130c27",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Add Customer Id\nAdds customer id to the data"
      }
    },
    {
      "id": "a475fc3d-1d1b-406e-92ae-f8d982232b33",
      "name": "Add customer id",
      "type": "n8n-nodes-base.code",
      "position": [
        944,
        0
      ]
    },
    {
      "id": "d521cb5a-a497-4b2b-be64-0b2b0a755696",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Add Item Id\nAdds item (service/product) id to the data"
      }
    },
    {
      "id": "e5bdb990-3b56-4f97-beba-499d3e063961",
      "name": "Add item id",
      "type": "n8n-nodes-base.code",
      "position": [
        1552,
        0
      ]
    },
    {
      "id": "9370f28d-d910-4e28-8001-414529a51f18",
      "name": "Add reminders config",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        704
      ]
    },
    {
      "id": "f1e1bc2a-c99e-461d-88fd-d87bfcff3a34",
      "name": "Insert invoice id to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1664,
        512
      ]
    },
    {
      "id": "aabb6827-0dd5-4332-a36c-cc35f150956a",
      "name": "Get Invoices",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1664,
        880
      ]
    },
    {
      "id": "15f3089c-ebc8-4cad-85c0-67fc5bbf2802",
      "name": "Get the invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        2368,
        1104
      ]
    },
    {
      "id": "0f498328-0b7b-41d9-8f7a-edc45f92438a",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        1312,
        704
      ]
    },
    {
      "id": "e84c641c-5316-47fa-bd3c-827487d437a9",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2736,
        544
      ]
    },
    {
      "id": "93a4aa27-13ca-4989-a617-5211f3856ed9",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2736,
        752
      ]
    },
    {
      "id": "06381d7b-8067-4216-8ecb-a84876693bf3",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        2672,
        1120
      ]
    },
    {
      "id": "242fe315-78c9-4bb5-8a53-2d6485574d54",
      "name": "Schedule reminders trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        608,
        704
      ]
    },
    {
      "id": "add99766-9f1f-4309-96b7-6e26d5503185",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        576
      ],
      "parameters": {
        "width": 304,
        "height": 320,
        "content": "## Schedule Trigger\nSchedules reminders trigger daily at 8 AM"
      }
    },
    {
      "id": "fb8287f4-0b04-4adc-914d-875c5ff04e7c",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        528
      ],
      "parameters": {
        "width": 304,
        "height": 368,
        "content": "## Add Reminders Config\nAdds reminders config details like `intervals in days` so first reminder will be sent after 2 days, second one after 3 days and final one after 5 days"
      }
    },
    {
      "id": "c07d8400-4ef0-40e4-bff2-22555692077d",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        528
      ],
      "parameters": {
        "width": 304,
        "height": 368,
        "content": "## Check Trigger\nChecks if the previous node has been executed by the above workflow or by the schedule trigger"
      }
    },
    {
      "id": "2c40665a-11db-454b-951f-e28890b633bd",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        352
      ],
      "parameters": {
        "width": 304,
        "height": 336,
        "content": "## Insert Invoice To DB\nInserts newly created invoice needed details to DB so customer will be notified later on about the invoice"
      }
    },
    {
      "id": "397c3156-6843-4596-8b1e-ac2dbe795b2e",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        736
      ],
      "parameters": {
        "width": 304,
        "height": 336,
        "content": "## Get All Invoices\nGets all the invoices from DB"
      }
    },
    {
      "id": "d23e89a3-885d-4251-8f24-9baece741836",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        752
      ],
      "parameters": {
        "width": 304,
        "height": 320,
        "content": "## Loop Over Invoices\nLoops over invoices one by one"
      }
    },
    {
      "id": "8621a71b-9813-4232-9a44-15c62332e75a",
      "name": "Loop over invoices",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2016,
        880
      ]
    },
    {
      "id": "4c21d69d-5111-45bf-b76f-b5834379c1cc",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2272,
        544
      ],
      "parameters": {
        "width": 304,
        "height": 352,
        "content": "## Get Sent Reminders\nGets today's sent reminders from DB"
      }
    },
    {
      "id": "3270e7c4-c153-4341-a9f9-2f2c299264a6",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2272,
        944
      ],
      "parameters": {
        "width": 304,
        "height": 368,
        "content": "## Get Invoice Details\nGets the invoice details from QBO so we know whether or not any changes have been made or not"
      }
    },
    {
      "id": "c12c85f8-ea33-471b-80ff-491db349e784",
      "name": "Get today's sent reminders",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2368,
        688
      ]
    },
    {
      "id": "2139421b-bd22-47a6-98d7-7ad641207c7f",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2624,
        416
      ],
      "parameters": {
        "width": 592,
        "height": 480,
        "content": "## Summarize Sent Reminders & Send An Email\nSummarizes today's sent reminders using AI and send a summery email to the team like sales team or finance team"
      }
    },
    {
      "id": "11869e18-01a0-4e33-906e-3d6b7b59d40c",
      "name": "Increase sent reminders",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3136,
        1072
      ]
    },
    {
      "id": "17e76636-622c-49c1-8993-cbb15022b41a",
      "name": "Delete invoice",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3616,
        1232
      ]
    },
    {
      "id": "34b07269-37f5-4946-8af7-83b200f31c81",
      "name": "If3",
      "type": "n8n-nodes-base.if",
      "position": [
        3344,
        1072
      ]
    },
    {
      "id": "32b570e6-b5fb-46bd-96f0-6815e30cf4b2",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2624,
        944
      ],
      "parameters": {
        "width": 1184,
        "height": 480,
        "content": "## Send Reminders Logic\nThe logic that decides whether or not to send a reminder email now, skip it and send it later or delete the invoice/s from DB (because all the reminders have been sent or the i"
      }
    },
    {
      "id": "c358be7d-4f13-406c-b713-189474fa8583",
      "name": "Send reminder email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2928,
        1072
      ]
    },
    {
      "id": "91131646-c435-4151-b683-6de0053e4d43",
      "name": "Send reminders sent summary",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3008,
        544
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Update the customer",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create the customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "Insert invoice id to DB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If3": {
      "main": [
        [
          {
            "node": "Delete invoice",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop over invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Send reminder email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete invoice",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop over invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send reminders sent summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add item id": {
      "main": [
        [
          {
            "node": "Create the invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format data": {
      "main": [
        [
          {
            "node": "Check if the customer exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Invoices": {
      "main": [
        [
          {
            "node": "Loop over invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete invoice": {
      "main": [
        [
          {
            "node": "Loop over invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add customer id": {
      "main": [
        [
          {
            "node": "Get the product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the invoice": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the product": {
      "main": [
        [
          {
            "node": "Add item id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send the invoice": {
      "main": [
        [
          {
            "node": "Add reminders config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create the invoice": {
      "main": [
        [
          {
            "node": "Send the invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over invoices": {
      "main": [
        [
          {
            "node": "Get today's sent reminders",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get the invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create the customer": {
      "main": [
        [
          {
            "node": "Add customer id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send reminder email": {
      "main": [
        [
          {
            "node": "Increase sent reminders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update the customer": {
      "main": [
        [
          {
            "node": "Add customer id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add reminders config": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Increase sent reminders": {
      "main": [
        [
          {
            "node": "If3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert invoice id to DB": {
      "main": [
        []
      ]
    },
    "Receive form submission": {
      "main": [
        [
          {
            "node": "Format data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get today's sent reminders": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule reminders trigger": {
      "main": [
        [
          {
            "node": "Add reminders config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if the customer exists": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}