{
  "name": "AI-powered invoice reminder & payment tracker for finance & accounting",
  "nodes": [
    {
      "id": "5e70b579-3fec-471f-8788-2205c066e21f",
      "name": "Schedule Daily Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -304
      ]
    },
    {
      "id": "75c19552-8451-4c27-978c-54d6ea422b84",
      "name": "Fetch Pending Invoices",
      "type": "n8n-nodes-base.postgres",
      "position": [
        224,
        -304
      ]
    },
    {
      "id": "3bf276a9-2041-4f5c-995c-ca3ffb4f0cd0",
      "name": "Filter Overdue Invoices",
      "type": "n8n-nodes-base.if",
      "position": [
        448,
        -304
      ]
    },
    {
      "id": "000ea7a3-3db4-409d-bdea-b416590933e4",
      "name": "Calculate Reminder Logic",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        -304
      ]
    },
    {
      "id": "2879e970-5943-4a87-b74c-dd92e9c83662",
      "name": "Prepare AI Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        -304
      ]
    },
    {
      "id": "5e61c6ea-62df-4c69-95d8-5b5dd7a0eb66",
      "name": "Format Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        -304
      ]
    },
    {
      "id": "49d9b854-ffda-4125-b07f-9997b799d5aa",
      "name": "Send Email Reminder",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1696,
        -304
      ]
    },
    {
      "id": "6f307b3e-9222-4df7-a92b-9c7dbcea6d79",
      "name": "Update Reminder Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1920,
        -304
      ]
    },
    {
      "id": "07f23377-e924-49b1-b803-88aedd3de5bd",
      "name": "Create Activity Log",
      "type": "n8n-nodes-base.set",
      "position": [
        2144,
        -304
      ]
    },
    {
      "id": "5884f963-de92-4613-ab16-5fc5bff620cd",
      "name": "Save to Activity Log",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2368,
        -304
      ]
    },
    {
      "id": "473efd7a-44f7-4724-a638-731e337e21e2",
      "name": "Generate Daily Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        -304
      ]
    },
    {
      "id": "6a8c062f-093c-40cd-869f-e459ea3b0eac",
      "name": "Send Summary to Finance Team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2816,
        -304
      ]
    },
    {
      "id": "29cc7161-00b3-4ad6-8df4-e582296fc2ed",
      "name": "Webhook: Payment Received",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -48,
        368
      ]
    },
    {
      "id": "7338b886-106f-4aad-86b7-dd4cb743d8d1",
      "name": "Update Payment Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        208,
        368
      ]
    },
    {
      "id": "f1699fe0-c7fe-48f7-9e39-62e983a7b063",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        464,
        144
      ]
    },
    {
      "id": "5554a9a8-1fc3-4743-9f98-896ae8a2b146",
      "name": "Send Payment Confirmation",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        480,
        576
      ]
    },
    {
      "id": "8a45b060-fd84-4e2f-a880-5bb2db6e5cb4",
      "name": "Generate Email",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1200,
        -80
      ]
    },
    {
      "id": "51c1516e-e53b-4435-ab0f-a8c147b3478a",
      "name": "AI Agent For Generate Email Content",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        -304
      ]
    },
    {
      "id": "278e2272-baa8-4c0e-81db-836db7204219",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Starts the workflow automatically each morning."
      }
    },
    {
      "id": "77598975-6120-472e-b9a1-d1b23c64f651",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Decides when and how to send reminders.\n"
      }
    },
    {
      "id": "98bbe714-19b0-4be2-8610-95074be891e8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Keeps only overdue invoices.\n"
      }
    },
    {
      "id": "d4b28ef6-da2a-4d6a-8486-5cb60c272115",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Gets unpaid invoices from the database.\n"
      }
    },
    {
      "id": "7789557b-f95a-4336-ae2a-2247b215cc6e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Creates a personalized AI prompt for each client.\n"
      }
    },
    {
      "id": "9e5d7552-ab77-48bd-9f64-78a82f9676b1",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Records reminder activity for audit.\n"
      }
    },
    {
      "id": "63b897b8-e59e-42c4-9d3f-194c52c850e6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Marks reminder as sent in the database.\n"
      }
    },
    {
      "id": "9ea47eb5-9b59-47df-873f-1f1060ae9bf5",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Sends the email via Gmail or SMTP.\n"
      }
    },
    {
      "id": "9e881563-1895-40a0-8b1b-9f8fe886e284",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Converts AI text to a professional HTML email.\n"
      }
    },
    {
      "id": "1b036318-bfc1-4bef-bde8-06c3523c5ccf",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -416
      ],
      "parameters": {
        "width": 272,
        "height": 288,
        "content": "Uses AI to draft reminder emails.\n"
      }
    },
    {
      "id": "b570ef63-5ee6-4605-b461-429f1d817b8b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2544,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Prepares a report of reminders sent.\n"
      }
    },
    {
      "id": "10b172aa-f4bb-4ccc-a102-2593e0d78ff8",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2768,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Emails summary to the finance team.\n"
      }
    },
    {
      "id": "a0c95551-0747-4c97-9cf7-d61ff9c12fd8",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2320,
        -416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Stores raw workflow data for review.\n"
      }
    },
    {
      "id": "4e422ead-f833-4de8-8f86-3b78116b2eab",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        0
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Generates thank-you massage via AI.\n"
      }
    },
    {
      "id": "0816a7b8-03bd-4416-aa58-a30f1e3af0f5",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        240
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Captures payment notifications.\n"
      }
    },
    {
      "id": "0f6e79b9-107d-4ddb-bbaa-421a07d47078",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        240
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Updates invoice as “paid.”\n"
      }
    },
    {
      "id": "ce1221dd-7976-47d1-9cc9-81389efc72fe",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        416
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "Sends payment receipt to client."
      }
    }
  ],
  "connections": {
    "Format Email": {
      "main": [
        [
          {
            "node": "Send Email Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Email": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent For Generate Email Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prepare AI Prompt": {
      "main": [
        [
          {
            "node": "AI Agent For Generate Email Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Activity Log": {
      "main": [
        [
          {
            "node": "Save to Activity Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Reminder": {
      "main": [
        [
          {
            "node": "Update Reminder Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Activity Log": {
      "main": [
        [
          {
            "node": "Generate Daily Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Daily Check": {
      "main": [
        [
          {
            "node": "Fetch Pending Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Payment Status": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Payment Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Pending Invoices": {
      "main": [
        [
          {
            "node": "Filter Overdue Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Daily Summary": {
      "main": [
        [
          {
            "node": "Send Summary to Finance Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Reminder Status": {
      "main": [
        [
          {
            "node": "Create Activity Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Overdue Invoices": {
      "main": [
        [
          {
            "node": "Calculate Reminder Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Reminder Logic": {
      "main": [
        [
          {
            "node": "Prepare AI Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook: Payment Received": {
      "main": [
        [
          {
            "node": "Update Payment Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent For Generate Email Content": {
      "main": [
        [
          {
            "node": "Format Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}