{
  "nodes": [
    {
      "id": "61facbf1-b66f-4b18-8af0-fc8f4a522dbb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        80
      ],
      "parameters": {
        "width": 1040,
        "height": 528,
        "content": "# Automated Invoice Payment Reminder\nThis workflow automates accounts receivable by monitoring invoices and sending scheduled reminders. It ensures you never miss a follow-up while maintaining professional communication.\n\n## How it works\n1. **Trigger:** Runs daily or on form submission.\n2. **Checks:**\n   - **7-Day:** Sends a polite email/SMS if unpaid after one week.\n   - **9-Day:** Sends a firmer reminder two days later.\n   - **12-Day:** Sends a final urgent notice.\n3. **Safety:** Checks the sheet for payment status immediately before sending any message to ensure paid clients are not disturbed.\n\n## Setup steps\n1. **Google Sheets:** Create a sheet with columns named exactly: `DATE`, `EMAIL`, and `Payment Status`.\n2. **Credentials:** Configure your Gmail and Google Sheets credentials in the respective nodes.\n3. **Twilio (Optional):** Connect your Twilio account if you wish to send SMS, and toggle the SMS nodes to \"Active\".\n4. **Configuration:** Select your specific spreadsheet in the \"Read Sheet\" nodes.\n\n\u2014 Neal, CTK Industries"
      },
      "typeVersion": 1
    },
    {
      "id": "669c4d84-b9aa-4f21-959a-5afef4ba21a7",
      "name": "Invoice Form Submission Trigger",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -2528,
        736
      ],
      "parameters": {
        "options": {},
        "formTitle": "Invoice",
        "formFields": {
          "values": [
            {
              "fieldLabel": "First Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Last Name"
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone",
              "requiredField": true
            },
            {
              "fieldLabel": "Payment Link",
              "requiredField": true
            },
            {
              "fieldLabel": "Invoice Amount"
            },
            {
              "fieldLabel": "Name Of Bank",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Enter Details for invoice"
      },
      "typeVersion": 2.2
    },
    {
      "id": "bda8b44b-5579-4fa9-871a-dd89b1f0c540",
      "name": "Wait 7 Days for First Follow-up",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2304,
        736
      ],
      "parameters": {
        "unit": "days",
        "amount": 7
      },
      "typeVersion": 1.1
    },
    {
      "id": "f78f89db-6160-4d0a-96e7-218a69ab8ef0",
      "name": "Send First Payment Reminder",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1632,
        816
      ],
      "parameters": {
        "sendTo": "={{ $('Invoice Form Submission Trigger').item.json.Email }}",
        "message": "=First Message",
        "options": {
          "appendAttribution": false
        },
        "subject": "(Company Name) Invoice Due"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "dc9fecda-5ed4-4e2a-8d22-9725a47fbffa",
      "name": "Check Payment Status in Sheet - Day 7",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2080,
        736
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "[SELECT YOUR SHEET]"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=[SELECT YOUR SHEET]"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "c7f67f3a-5f18-45e1-8cad-ede474e2ad40",
      "name": "If Still Unpaid - First Check\"",
      "type": "n8n-nodes-base.if",
      "notes": "Payment date is on or after X days ago\n+\nEmail Address Matches",
      "position": [
        -1856,
        736
      ],
      "parameters": {
        "options": {
          "ignoreCase": true
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "20678cb9-341b-44a4-abcb-0887356410ac",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Invoice Form Submission Trigger').item.json.Email }}",
              "rightValue": "={{ $json['EMAIL '] }}"
            },
            {
              "id": "ccb787c6-c0d3-46f0-bbaf-fc25a3bc2304",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $json.DATE }}",
              "rightValue": "={{ $today.minus({Days: 9}).format(\"yyyy-MM-dd\") }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "b27d7014-2c3a-427a-a6ba-dde6d52467d7",
      "name": "Send First SMS Reminder (Optional)",
      "type": "n8n-nodes-base.twilio",
      "disabled": true,
      "position": [
        -1408,
        816
      ],
      "parameters": {
        "message": "[ADD YOUR MESSAGE]",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "233f444a-748a-4e8e-a60f-daf61e73fb4d",
      "name": "Wait 2 Days for Second Follow-up",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1184,
        816
      ],
      "parameters": {
        "unit": "days",
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "6cc5d983-9ac3-40c5-81b5-76bc25967f1f",
      "name": "Check Payment Status in Sheet - Day 9",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -960,
        816
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "=[SELECT YOUR SHEET]"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=[SELECT YOUR SHEET]"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "41a417f4-859b-4eb7-a32f-ad656f977c48",
      "name": "If Still Unpaid - Second Check",
      "type": "n8n-nodes-base.if",
      "notes": "Payment date is on or after X days ago\n+\nEmail Address Matches",
      "position": [
        -736,
        816
      ],
      "parameters": {
        "options": {
          "ignoreCase": true
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "20678cb9-341b-44a4-abcb-0887356410ac",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Invoice Form Submission Trigger').item.json.Email }}",
              "rightValue": "={{ $json['EMAIL '] }}"
            },
            {
              "id": "ccb787c6-c0d3-46f0-bbaf-fc25a3bc2304",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $json.DATE }}",
              "rightValue": "={{ $today.minus({Days: 9}).format(\"yyyy-MM-dd\") }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "2fecdd11-5637-41f8-9fb6-ff98d49a482a",
      "name": "Send Second Payment Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -512,
        880
      ],
      "parameters": {
        "sendTo": "={{ $('Invoice Form Submission Trigger').item.json.Email }}",
        "message": "=Follow up message",
        "options": {
          "appendAttribution": false
        },
        "subject": "Friendly Reminder: Invoice Still Outstanding with <Name>"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 2.1
    },
    {
      "id": "27822b69-f6ed-4396-9965-fd20537e48c7",
      "name": "Send Second SMS Reminder (Optional)",
      "type": "n8n-nodes-base.twilio",
      "disabled": true,
      "position": [
        -288,
        880
      ],
      "parameters": {
        "message": "[ADD YOUR MESSAGE]",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "f69ab2f6-c6af-4f58-b1a3-ce60a7ef5d8d",
      "name": "Wait 3 Days for Final Follow-up",
      "type": "n8n-nodes-base.wait",
      "position": [
        -64,
        880
      ],
      "parameters": {
        "unit": "days",
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "0ba1aa85-bd77-417b-91bc-b0afe2619320",
      "name": "Check Payment Status in Sheet - Day 12",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        880
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "=[SELECT YOUR SHEET]"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=[SELECT YOUR SHEET]"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f72fdedf-f233-49a9-970f-674a9b0bd82e",
      "name": "If Still Unpaid - Third Check",
      "type": "n8n-nodes-base.if",
      "notes": "Payment date is on or after X days ago\n+\nEmail Address Matches",
      "position": [
        384,
        880
      ],
      "parameters": {
        "options": {
          "ignoreCase": true
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "20678cb9-341b-44a4-abcb-0887356410ac",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Invoice Form Submission Trigger').item.json.Email }}",
              "rightValue": "={{ $json['EMAIL '] }}"
            },
            {
              "id": "ccb787c6-c0d3-46f0-bbaf-fc25a3bc2304",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $json.DATE }}",
              "rightValue": "={{ $today.minus({Days: 9}).format(\"yyyy-MM-dd\") }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "3d386f83-24c6-4b94-8a74-2f52a12c3b19",
      "name": "Send Final Payment Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        608,
        928
      ],
      "parameters": {
        "sendTo": "={{ $('Invoice Form Submission Trigger').item.json.Email }}",
        "message": "=Final Message",
        "options": {
          "appendAttribution": false
        },
        "subject": "Final Reminder: Action Needed \u2014 Outstanding Invoice"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3d753c91-3c74-48cb-81fd-fd22dc891412",
      "name": "Send Final SMS Reminder (Optional)",
      "type": "n8n-nodes-base.twilio",
      "disabled": true,
      "position": [
        832,
        928
      ],
      "parameters": {
        "message": "[ADD YOUR MESSAGE]",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "62e144eb-94e4-4000-a8e6-2aa22a4a68c0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        624
      ],
      "parameters": {
        "color": 7,
        "width": 1072,
        "height": 608,
        "content": "## First Follow-up Cycle\nWaits 7 days after the invoice date. It checks the Google Sheet for payment status and sends the initial reminder email and SMS if the funds haven't been received."
      },
      "typeVersion": 1
    },
    {
      "id": "611ba3d9-891b-4df7-8075-ce4c13beee21",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        624
      ],
      "parameters": {
        "color": 7,
        "width": 1120,
        "height": 608,
        "content": "## Second Follow-up Cycle\nWaits an additional 2 days. Re-checks the payment status and escalates with a second reminder email/SMS if the invoice is still outstanding."
      },
      "typeVersion": 1
    },
    {
      "id": "b5eaa326-7238-43e2-a226-9b8ee1e85dd3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        624
      ],
      "parameters": {
        "color": 7,
        "width": 1120,
        "height": 608,
        "content": "## Final Follow-up Cycle\nAfter 3 more days, this section performs a final status check and sends a last \"Urgent\" payment reminder before ending the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "b4a96870-ac04-4368-8c7b-14de301ff980",
      "name": "Process Complete",
      "type": "n8n-nodes-base.noOp",
      "position": [
        736,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "connections": {
    "Send First Payment Reminder": {
      "main": [
        [
          {
            "node": "Send First SMS Reminder (Optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Still Unpaid - Third Check": {
      "main": [
        [
          {
            "node": "Process Complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Final Payment Reminder Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Still Unpaid - First Check\"": {
      "main": [
        [
          {
            "node": "Process Complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send First Payment Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Still Unpaid - Second Check": {
      "main": [
        [
          {
            "node": "Process Complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Second Payment Reminder Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice Form Submission Trigger": {
      "main": [
        [
          {
            "node": "Wait 7 Days for First Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 3 Days for Final Follow-up": {
      "main": [
        [
          {
            "node": "Check Payment Status in Sheet - Day 12",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 7 Days for First Follow-up": {
      "main": [
        [
          {
            "node": "Check Payment Status in Sheet - Day 7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2 Days for Second Follow-up": {
      "main": [
        [
          {
            "node": "Check Payment Status in Sheet - Day 9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Final Payment Reminder Email": {
      "main": [
        [
          {
            "node": "Send Final SMS Reminder (Optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send First SMS Reminder (Optional)": {
      "main": [
        [
          {
            "node": "Wait 2 Days for Second Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Second Payment Reminder Email": {
      "main": [
        [
          {
            "node": "Send Second SMS Reminder (Optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Second SMS Reminder (Optional)": {
      "main": [
        [
          {
            "node": "Wait 3 Days for Final Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Payment Status in Sheet - Day 7": {
      "main": [
        [
          {
            "node": "If Still Unpaid - First Check\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Payment Status in Sheet - Day 9": {
      "main": [
        [
          {
            "node": "If Still Unpaid - Second Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Payment Status in Sheet - Day 12": {
      "main": [
        [
          {
            "node": "If Still Unpaid - Third Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}