{
  "id": "XOF9UqmsKeApytec",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated Overdue Invoice Recovery & Escalation Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "b857c280-3f76-48ef-98cd-939e8359e539",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        928
      ],
      "parameters": {
        "width": 600,
        "height": 476,
        "content": "## \ud83d\udcb8 Accounts Receivable Recovery Agent\n\n### How it works\nThis workflow runs daily and automatically handles overdue invoice follow-ups \u2014 from sending personalized reminder emails to escalating high-risk accounts. An AI agent reads each unpaid invoice, determines the urgency level (1\u20134), drafts a context-aware email, and decides whether to loop in your legal or collections team.\n\nOnce the email is sent, it updates the invoice record and appends a full log row to a recovery sheet \u2014 so your team always knows what was sent, when, and why.\n\n### Setup steps\n1. Connect your **Google Sheets OAuth2** credential and point both sheet nodes to your spreadsheet (Invoices tab + Recovery Sheet tab)\n2. Connect your **Gmail OAuth2** credential for both outbound email nodes\n3. Connect your **OpenAI API** credential to the GPT-4o-mini model node\n4. Connect your **Slack OAuth2** credential for error and no-invoice alerts\n5. Update `legal@yourcompany.com` in the escalation email node to your real address\n6. Run once manually to verify the sheet columns match: Invoice, Client, Email, Amount, Days Overdue, Level, Reminders Sent"
      },
      "typeVersion": 1
    },
    {
      "id": "1a439390-d077-4825-b424-e2b99ee73771",
      "name": "Section: Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        1488
      ],
      "parameters": {
        "color": 7,
        "width": 900,
        "height": 732,
        "content": "## \u23f1\ufe0f Trigger & Invoice Fetch\n\nFires every 24 hours, reads all rows from the Invoices sheet, and checks whether any valid invoice entries exist. If nothing is found, a Slack alert notifies the team immediately so no silent failures go unnoticed."
      },
      "typeVersion": 1
    },
    {
      "id": "7bd1281a-7405-4d8f-ae1e-2a4b46535999",
      "name": "Section: AI Agent",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        1408
      ],
      "parameters": {
        "color": 7,
        "width": 628,
        "height": 876,
        "content": "## \ud83e\udd16 AI Recovery Agent\n\nThe AI reads each invoice row and determines the right escalation level based on days overdue and prior reminders. It returns a structured JSON with a personalized subject, HTML email body, optional payment plans, and a recommended next action (none / legal / collections)."
      },
      "typeVersion": 1
    },
    {
      "id": "00810150-609b-416c-af9c-bbab159cce86",
      "name": "Section: Email",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        1328
      ],
      "parameters": {
        "color": 7,
        "width": 548,
        "height": 876,
        "content": "## \ud83d\udce7 Email Delivery\n\nTwo Gmail nodes handle outbound mail: one sends the personalized recovery email directly to the client, the other fires an internal escalation alert to your legal or AR team when the AI flags the account as high-risk."
      },
      "typeVersion": 1
    },
    {
      "id": "2ab32e24-4b10-49cc-a984-351851c9b2c4",
      "name": "Section: Logging",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        1264
      ],
      "parameters": {
        "color": 7,
        "width": 532,
        "height": 956,
        "content": "## \ud83d\udcca Sheet Updates & Recovery Log\n\nAfter each run, the Invoices sheet is updated with the new escalation level and AI summary. A separate Recovery Sheet gets a new log row per invoice processed \u2014 giving you a full audit trail of every action taken."
      },
      "typeVersion": 1
    },
    {
      "id": "16bae2bb-1847-42a6-9129-79b59c2160d1",
      "name": "Section: Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        2016
      ],
      "parameters": {
        "color": 3,
        "width": 268,
        "height": 244,
        "content": "## \ud83d\udd10 Credentials & Security\n\nUse OAuth2 for Gmail and Google Sheets. Use API key for OpenAI and OAuth2 for Slack. Never hardcode tokens or emails. Replace all personal IDs with placeholders before sharing this template."
      },
      "typeVersion": 1
    },
    {
      "id": "f0ce1746-f6ca-4b6b-8c8d-93e7c4b5f8d0",
      "name": "AI Recovery Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueErrorOutput",
      "position": [
        -400,
        1648
      ],
      "parameters": {
        "text": "=You are a professional accounts receivable recovery agent. Analyze this overdue invoice and generate a personalized, polite but firm recovery message.\n\nInvoice Details:\n- Invoice Number: {{ $json.Invoice }}\n- Client Name: {{ $json.Client }}\n- Client Email: {{ $json.Email }}\n- Amount Due: {{ $json.Amount }}\n- Due Date: {{ $json['Due Date'] }}\n- Days Overdue: {{ $json['Days Overdue'] }}\n- Previous Reminders Sent: {{ $json['Reminders Sent'] || 0 }}\n\nBased on the days overdue and previous reminders, determine the escalation level:\n- Level 1 (1\u20137 days, 0 reminders): Gentle friendly reminder\n- Level 2 (8\u201314 days, 1 reminder): Firm reminder with payment plan offer\n- Level 3 (15\u201330 days, 2 reminders): Urgent notice with payment plan options\n- Level 4 (30+ days, 3+ reminders): Final notice before collections\n\nGenerate:\n1. A personalized email subject line\n2. A personalized HTML email body (addressed by first name, empathetic but firm)\n3. If Level 2+, include 2\u20133 payment plan options (e.g. 50% now + 50% in 30 days, or 3 monthly installments)\n4. Escalation recommendation: none / legal / collections\n\nRespond ONLY in this exact JSON format with no markdown or code fences:\n{\n  \"escalation_level\": 1,\n  \"subject\": \"email subject line here\",\n  \"email_body\": \"full HTML email body here\",\n  \"payment_plans\": [\"Plan A: ...\", \"Plan B: ...\"],\n  \"escalation_action\": \"none\",\n  \"summary\": \"brief one-line summary of action taken\"\n}",
        "options": {
          "systemMessage": "You are a professional AR recovery specialist. Always respond with valid JSON only \u2014 no markdown, no code fences, no preamble."
        },
        "promptType": "define"
      },
      "retryOnFail": false,
      "typeVersion": 3
    },
    {
      "id": "8a597cd0-08c2-4ab9-b860-a0faa130c574",
      "name": "Send Recovery Email to Client",
      "type": "n8n-nodes-base.gmail",
      "position": [
        304,
        1536
      ],
      "parameters": {
        "sendTo": "={{ $('Read Overdue Invoices').item.json.Email }}",
        "message": "={{ $json.email_body }}",
        "options": {
          "replyTo": "user@example.com",
          "appendAttribution": false
        },
        "subject": "={{ $json.subject }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "0893a4ff-6598-4a8b-8c6b-96710baa14d4",
      "name": "Send Escalation Alert to Legal Team",
      "type": "n8n-nodes-base.gmail",
      "position": [
        608,
        1792
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=<h2 style='color:#c0392b;'>Escalation Alert \u2014 Accounts Receivable</h2><table style='border-collapse:collapse;font-family:Arial;font-size:14px;'><tr><td style='padding:6px 12px;font-weight:bold;'>Client</td><td style='padding:6px 12px;'>{{ $json.client_name }}</td></tr><tr style='background:#f9f9f9;'><td style='padding:6px 12px;font-weight:bold;'>Email</td><td style='padding:6px 12px;'>{{ $json.client_email }}</td></tr><tr><td style='padding:6px 12px;font-weight:bold;'>Invoice #</td><td style='padding:6px 12px;'>{{ $json.invoice_number }}</td></tr><tr style='background:#f9f9f9;'><td style='padding:6px 12px;font-weight:bold;'>Amount Due</td><td style='padding:6px 12px;color:#c0392b;font-weight:bold;'>${{ $json.amount_due }}</td></tr><tr><td style='padding:6px 12px;font-weight:bold;'>Days Overdue</td><td style='padding:6px 12px;'>{{ $json.days_overdue }}</td></tr><tr style='background:#f9f9f9;'><td style='padding:6px 12px;font-weight:bold;'>Escalation Level</td><td style='padding:6px 12px;'>{{ $json.escalation_level }}</td></tr><tr><td style='padding:6px 12px;font-weight:bold;'>Recommended Action</td><td style='padding:6px 12px;color:#e67e22;font-weight:bold;'>{{ $json.escalation_action }}</td></tr><tr style='background:#f9f9f9;'><td style='padding:6px 12px;font-weight:bold;'>AI Summary</td><td style='padding:6px 12px;'>{{ $json.summary }}</td></tr></table><br/><p style='color:#888;font-size:12px;'>This alert was auto-generated by the AR Recovery Agent.</p>",
        "options": {
          "replyTo": "user@example.com",
          "appendAttribution": false
        },
        "subject": "=\ud83d\udea8 ESCALATION: Invoice {{ $json.invoice_number }} \u2014 {{ $json.client_name }} (${{ $json.amount_due }} overdue)"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "493896f7-1a23-4c0e-8c7b-e90b5c19ac06",
      "name": "Daily Invoice Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1328,
        1664
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "abf57ef3-1e3d-40ad-9fa3-a737e640d21f",
      "name": "Read Overdue Invoices",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1104,
        1664
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "invoices"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "3b9b8cec-6b12-4321-8136-0a04d7b12061",
      "name": "Any Overdue Invoices?",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        1664
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition-has-invoices",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $json.Invoice }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "79b63a38-3434-4366-b85d-81e25d0e3406",
      "name": "GPT-4o-mini Language Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -432,
        1872
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "b1191228-db5f-431a-8dab-b08d27953e09",
      "name": "Parse & Structure AI Response",
      "type": "n8n-nodes-base.code",
      "position": [
        -32,
        1744
      ],
      "parameters": {
        "jsCode": "const rawOutput = $input.first().json.output || $input.first().json.text || $input.first().json.content || '';\n\nlet parsed;\ntry {\n  const cleaned = rawOutput\n    .replace(/```json\\n?/g, '')\n    .replace(/```\\n?/g, '')\n    .trim();\n  parsed = JSON.parse(cleaned);\n} catch(e) {\n  parsed = {\n    escalation_level: 1,\n    subject: 'Invoice Payment Reminder - Action Required',\n    email_body: rawOutput || 'Please review your outstanding invoice.',\n    payment_plans: [],\n    escalation_action: 'none',\n    summary: 'Standard reminder sent (parse fallback)'\n  };\n}\n\nconst sourceItem = $('Read Overdue Invoices').item.json;\n\nreturn [{\n  json: {\n    ...parsed,\n    invoice_number: sourceItem['Invoice'],\n    client_name: sourceItem['Client'],\n    client_email: sourceItem['Email'],\n    amount_due: sourceItem['Amount'],\n    days_overdue: sourceItem['Days Overdue'],\n    payment_plans_text: Array.isArray(parsed.payment_plans) ? parsed.payment_plans.join(' | ') : ''\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "71040ea8-1069-4731-9ab0-b92dc3e989f3",
      "name": "Needs Escalation?",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        1952
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition-escalate",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.escalation_action }}",
              "rightValue": "none"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "23365769-49bf-4351-bda5-4ec4d40a86e4",
      "name": "Update Invoice Status in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        880,
        1536
      ],
      "parameters": {
        "columns": {
          "value": {
            "summary": "={{ $('Parse & Structure AI Response').item.json.summary }}",
            "labelIds": "={{ $json.labelIds }}",
            "row_number": "={{ $('Read Overdue Invoices').item.json.row_number }}",
            "escalation_level": "={{ $('Parse & Structure AI Response').item.json.escalation_level }}"
          },
          "schema": [
            {
              "id": "Invoice",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Invoice",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Client",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Client",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Days Overdue",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Days Overdue",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Level",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "escalation_level",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "escalation_level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "labelIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "labelIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "invoices"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "3ba56f0d-cd53-4d9e-876c-d31169e492f2",
      "name": "Append Row to Recovery Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1088,
        1968
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $('Read Overdue Invoices').item.json.Email }}",
            "Level": "={{ $('Read Overdue Invoices').item.json.Level }}",
            "Amount": "={{ $('Read Overdue Invoices').item.json.Amount }}",
            "Client": "={{ $('Read Overdue Invoices').item.json.Client }}",
            "Invoice": "={{ $('Read Overdue Invoices').item.json.Invoice }}",
            "subject": "={{ $('Parse & Structure AI Response').item.json.subject }}",
            "summary": "={{ $('Parse & Structure AI Response').item.json.summary }}",
            "labelIds": "={{ $('Send Recovery Email to Client').item.json.labelIds }}",
            "Days Overdue": "={{ $('Read Overdue Invoices').item.json[\"Days Overdue\"] }}",
            "escalation_level": "={{ $('Parse & Structure AI Response').item.json.escalation_level }}"
          },
          "schema": [
            {
              "id": "Invoice",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Invoice",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Client",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Client",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Days Overdue",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Days Overdue",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "escalation_level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "escalation_level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "labelIds",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "labelIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Recovery sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "05ea22ea-995b-4c49-9953-c34f64460ce9",
      "name": "Slack: AI Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -64,
        2112
      ],
      "parameters": {
        "text": "=\u26a0\ufe0f AR Recovery Agent \u2014 AI processing error on invoice: {{ $('Read Overdue Invoices').item.json.Invoice }}. Check the execution log for details.",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SLACK_CHANNEL_ID"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "9d67d331-67a6-4fcd-a456-8027bf8b4db2",
      "name": "Slack: No Invoices Found Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -688,
        1920
      ],
      "parameters": {
        "text": "\u2705 AR Recovery Agent ran successfully \u2014 no overdue invoices found today.",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SLACK_CHANNEL_ID"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.3
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "14430469-bfe6-4845-8e03-be592a736a95",
  "connections": {
    "AI Recovery Agent": {
      "main": [
        [
          {
            "node": "Parse & Structure AI Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack: AI Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Needs Escalation?": {
      "main": [
        [
          {
            "node": "Send Escalation Alert to Legal Team",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append Row to Recovery Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Invoice Check": {
      "main": [
        [
          {
            "node": "Read Overdue Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Any Overdue Invoices?": {
      "main": [
        [
          {
            "node": "AI Recovery Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack: No Invoices Found Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Overdue Invoices": {
      "main": [
        [
          {
            "node": "Any Overdue Invoices?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack: AI Error Alert": {
      "main": [
        [
          {
            "node": "Read Overdue Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4o-mini Language Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Recovery Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse & Structure AI Response": {
      "main": [
        [
          {
            "node": "Send Recovery Email to Client",
            "type": "main",
            "index": 0
          },
          {
            "node": "Needs Escalation?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Recovery Email to Client": {
      "main": [
        [
          {
            "node": "Update Invoice Status in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Invoice Status in Sheet": {
      "main": [
        [
          {
            "node": "Append Row to Recovery Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Escalation Alert to Legal Team": {
      "main": [
        [
          {
            "node": "Append Row to Recovery Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}