{
  "name": "Smart invoice collection system with GPT-4.1, Gmail & Google Sheets",
  "nodes": [
    {
      "id": "sticky-note-1",
      "name": null,
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -100
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## 📊 STEP 1: Invoice Data Collection\n\nThis workflow monitors overdue invoices from Google Sheets:\n\n1. **Get Rows**: Pulls invoice data from your tracking spreadsheet\n2. **Edit Fields**: Calculates day"
      }
    },
    {
      "id": "sticky-note-2",
      "name": null,
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        850,
        -150
      ],
      "parameters": {
        "width": 380,
        "height": 200,
        "content": "## 🔍 STEP 2: Email History Intelligence\n\nPrevents sending follow-ups at inappropriate times:\n\n1. **Loop Over Items**: Processes each overdue invoice individually\n2. **Gmail Get Messages**: Retrieves r"
      }
    },
    {
      "id": "sticky-note-3",
      "name": null,
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        -170
      ],
      "parameters": {
        "width": 400,
        "height": 220,
        "content": "## 🧠 STEP 3: AI-Powered Follow-up Generation\n\nCreates intelligent, context-aware follow-up emails:\n\n**OpenAI Processing:**\n• Analyzes conversation history to determine if follow-up is appropriate\n• Se"
      }
    },
    {
      "id": "sticky-note-4",
      "name": null,
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2100,
        -150
      ],
      "parameters": {
        "width": 380,
        "height": 200,
        "content": "## 📧 STEP 4: Automated Email Delivery\n\nSends personalized follow-ups automatically:\n\n1. **Filter**: Only proceeds with emails that AI approved (verdict = true)\n2. **Gmail Draft/Send**: Creates profess"
      }
    },
    {
      "id": "dd5aa5ef-6970-448a-9a2e-3c2851eb0da7",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -40,
        20
      ]
    },
    {
      "id": "949f0ab9-a966-4120-abe9-1d9ff44fa2b9",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        150
      ]
    },
    {
      "id": "2de0297d-3ab6-432a-a096-1e028b8bbf4c",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        150
      ]
    },
    {
      "id": "974084da-f66e-4d79-953e-7eef1a00aace",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        660,
        150
      ]
    },
    {
      "id": "00175045-bccf-4f26-bf07-296d3d73e219",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        880,
        150
      ]
    },
    {
      "id": "ed7af6f0-3b03-4a0e-bfe8-b5550a5a8b28",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1100,
        75
      ]
    },
    {
      "id": "e432f02f-7135-4133-bc2d-b3f6ca3cc11e",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1320,
        75
      ]
    },
    {
      "id": "3ec2726d-4165-4960-8241-2b783bb98303",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1760,
        80
      ]
    },
    {
      "id": "18090468-75ce-45ee-94d3-4c2630bfeea8",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1540,
        75
      ]
    },
    {
      "id": "97fc0856-b9f9-4017-90bc-0d697261b997",
      "name": "Filter1",
      "type": "n8n-nodes-base.filter",
      "position": [
        2136,
        75
      ]
    },
    {
      "id": "835c5f4c-19cd-4942-81bd-9f1c3bd4396a",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2356,
        150
      ]
    },
    {
      "id": "9a82e86c-1988-4423-b2f7-8e42c447defb",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -40,
        320
      ]
    }
  ],
  "connections": {
    "Gmail": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter1": {
      "main": [
        [
          {
            "node": "Gmail1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}