{
  "name": "Generate invoices and send AI-summarized reminders with Jotform and QuickBooks",
  "nodes": [
    {
      "id": "09a933fa-37c9-485a-99bd-9e59241fe115",
      "name": "Receive form submission",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -3248,
        320
      ]
    },
    {
      "id": "1c6af41c-650f-4aca-818c-1e26d5f8db25",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -2464,
        320
      ]
    },
    {
      "id": "c189e5e3-23f6-468b-8687-3f6fc461e8cd",
      "name": "Get the product",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -1536,
        320
      ]
    },
    {
      "id": "b5c1ae8a-2713-47cf-b628-25d62ef4f3ef",
      "name": "Create the invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -928,
        320
      ]
    },
    {
      "id": "34a4491f-04f5-49a6-b577-560c37ca434b",
      "name": "Send the invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -624,
        320
      ]
    },
    {
      "id": "e90a5432-c6d9-43a3-a745-856be6dd40bc",
      "name": "Check if the customer exists",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -2672,
        320
      ]
    },
    {
      "id": "20a4e724-a97a-451a-8efe-5c1206387b8c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3328,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "fb4bcd41-335f-4fb8-8726-16ffc16b53a5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "56141b2e-0b76-42e7-a56f-6503a90ade21",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2272,
        -16
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "3dfd2f9b-dbca-45c7-88e0-dd7ffd646155",
      "name": "Create the customer",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -2176,
        496
      ]
    },
    {
      "id": "3234fa01-66f4-4979-b8f5-97f5cafa3864",
      "name": "Update the customer",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -2176,
        128
      ]
    },
    {
      "id": "c14d9973-4979-40b3-8f81-73d9f2e18469",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2272,
        368
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "070fe42c-ff86-41f9-bfd3-f7bcabc8cdfe",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c8642fb1-3c24-4f9b-9cfe-566a5e67b264",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "9f333f2a-5a46-453a-afd7-39e32463289d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c739baf1-1ca5-4567-b74d-86c80067f7b4",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4448,
        -96
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "07d98409-9ad5-4c0e-8446-200515172a34",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3024,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "dae5015a-41a5-4e06-93c3-058df1f4d3e9",
      "name": "Format data",
      "type": "n8n-nodes-base.code",
      "position": [
        -2944,
        320
      ]
    },
    {
      "id": "68ef465b-b3cf-45dd-b26c-0e166fa451cc",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "710b465e-0c40-4e63-9468-82a9dd569286",
      "name": "Add customer id",
      "type": "n8n-nodes-base.code",
      "position": [
        -1840,
        320
      ]
    },
    {
      "id": "a9210fda-8f65-427b-b1dd-ce6fa6c51456",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "622c7a42-9368-41ee-ad29-be33f854c511",
      "name": "Add item id",
      "type": "n8n-nodes-base.code",
      "position": [
        -1232,
        320
      ]
    },
    {
      "id": "a291f611-4420-40d4-afd6-00a04e62efa5",
      "name": "Add reminders config",
      "type": "n8n-nodes-base.set",
      "position": [
        -1824,
        1024
      ]
    },
    {
      "id": "d22542fe-4409-4b3d-b2eb-daed9c91c7a8",
      "name": "Send reminder email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        160,
        1392
      ]
    },
    {
      "id": "76622fe8-4003-4eff-b5b3-e4752cf2d34c",
      "name": "Insert invoice id to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -1120,
        832
      ]
    },
    {
      "id": "c3c5a32a-88f7-470b-bc8f-03890795246c",
      "name": "Get Invoices",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -1120,
        1200
      ]
    },
    {
      "id": "730432d3-38c2-42dc-bafe-a5d950d35353",
      "name": "Get the invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -416,
        1424
      ]
    },
    {
      "id": "b4b6ff61-bfa0-4243-aaac-e0a165d0d1ee",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        -1472,
        1024
      ]
    },
    {
      "id": "7837f92b-a57b-4e42-91f8-f80e8b140595",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -48,
        864
      ]
    },
    {
      "id": "25dc6d06-7283-4b6d-8d8b-b33ceb1231b4",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -48,
        1072
      ]
    },
    {
      "id": "922cde2d-c9d6-429c-9526-fd35dc7ac5bd",
      "name": "Send reminders sent summary",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        240,
        864
      ]
    },
    {
      "id": "06c61fb1-35dd-4de2-b453-586095f4287a",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -112,
        1440
      ]
    },
    {
      "id": "dcb368ea-3ec9-4f3d-8a0d-08d759243e4c",
      "name": "Schedule reminders trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2176,
        1024
      ]
    },
    {
      "id": "a898f506-44cf-4fef-a56d-ca03d596b2f0",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2272,
        896
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "68a32f07-3238-4e75-b60f-9e6ca319dc3a",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        848
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "df9ef4b5-4f27-44bf-bd16-eac4adea68b4",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        848
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "7b207d61-10d0-411d-95c0-2c7a161a73cb",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        672
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "7788ff3b-8116-443a-922e-4eb85097b91b",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        1056
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c14fb5de-3b40-48c1-a856-a4f4be81b682",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        1072
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "4ad62ebb-ad2c-415e-a009-4aef961016bf",
      "name": "Loop over invoices",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -768,
        1200
      ]
    },
    {
      "id": "6a1ccb7b-b75f-4a5b-a98d-fa4e91890525",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        864
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c2e8ebc2-9266-4fed-b7a0-3ac1a99aa888",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        1264
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d0000cb4-c4ce-4cca-b4e9-805985bc293c",
      "name": "Get today's sent reminders",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -416,
        1008
      ]
    },
    {
      "id": "c4441357-ee80-476f-b084-b4d3dac822ab",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        736
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c0d2127c-cd3a-4882-8e0e-af9c4f61fe9c",
      "name": "Increase sent reminders",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        368,
        1392
      ]
    },
    {
      "id": "f225693e-fa06-44b5-8aa8-b2a5a782b227",
      "name": "Delete invoice",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        848,
        1552
      ]
    },
    {
      "id": "67485965-6b11-474d-8902-d9974146c7a4",
      "name": "If3",
      "type": "n8n-nodes-base.if",
      "position": [
        576,
        1392
      ]
    },
    {
      "id": "4989fafb-6362-4322-aee8-859202d195d8",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        1264
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "de09ce70-ea77-4669-bfe1-13961c3ef517",
      "name": "Sticky Note21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4448,
        1264
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "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
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    }
  }
}