{
  "id": "rSAjJddqBqdS4qjy",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Vehicle Insurance Claim Approval Workflow (OpenAI + OCR + PDF API Hub)",
  "tags": [],
  "nodes": [
    {
      "id": "737518a8-5a49-4ea4-a91f-77e6c63ab2ae",
      "name": "Sticky Note - Approved Path",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6592,
        224
      ],
      "parameters": {
        "color": 7,
        "width": 1540,
        "height": 372,
        "content": "## \u2705 Approved Path\nGenerates & signs an approval letter, stamps APPROVED watermark, uploads to Drive, and emails the claimant."
      },
      "typeVersion": 1
    },
    {
      "id": "efffb953-c711-46ef-93c8-8367511f1c9d",
      "name": "Sticky Note - Rejected Path",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6592,
        704
      ],
      "parameters": {
        "color": 7,
        "width": 1292,
        "height": 324,
        "content": "## \u274c Rejected Path\nGenerates a rejection letter, stamps REJECTED watermark, uploads to Drive, and emails the claimant."
      },
      "typeVersion": 1
    },
    {
      "id": "0762ebe5-9891-4bc1-b845-1e4c7a1946f0",
      "name": "New Claim Uploaded",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        4880,
        656
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "subject:\"insurance claim\" has:attachment"
        },
        "options": {
          "downloadAttachments": true
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7907b704-be8b-4290-b6ee-2d23e317e983",
      "name": "Extract Claim Data",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        5408,
        944
      ],
      "parameters": {
        "resource": "pdfParsing",
        "parse_mode": "full",
        "parse_input_type": "file",
        "parse_file_binary_property": "={{ $('New Claim Uploaded').item.binary[\n  Object.keys($('New Claim Uploaded').item.binary)\n    .find(key => $('New Claim Uploaded').item.binary[key].mimeType === 'application/pdf')\n] }}"
      },
      "typeVersion": 1
    },
    {
      "id": "1c0e47d9-08e0-4743-95d3-541c49093c0e",
      "name": "Parse AI Decision",
      "type": "n8n-nodes-base.code",
      "position": [
        5904,
        656
      ],
      "parameters": {
        "jsCode": "const aiResponse = items[0].json.text  || items[0].json.response  || items[0].json.message?.content  || (items[0].json.choices && items[0].json.choices[0]?.message?.content)  || '';let parsed;\ntry {\n  const jsonMatch = aiResponse.match(/\\{[\\s\\S]*\\}/);\n  parsed = JSON.parse(jsonMatch[0]);\n} catch (e) {\n  parsed = {\n    decision: 'MANUAL_REVIEW',\n    reasoning: 'AI response could not be parsed \u2014 forwarding for human review.',\n    approved_amount: null,\n    risk_flags: ['parse_error'],\n    claimant_name: 'Unknown',\n    claimant_email: '',\n    claim_type: 'unknown',\n    summary: aiResponse.substring(0, 200)\n  };\n}\n\nparsed.claim_id = 'CLM-' + Date.now();\nparsed.processed_at = new Date().toISOString();\nparsed.email_message_id = $('New Claim Uploaded').item.json.id || '';\n\nreturn [{ json: parsed }];"
      },
      "typeVersion": 2
    },
    {
      "id": "0d9d02ae-490d-469c-8be5-ca2558954376",
      "name": "Log Claim to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6144,
        656
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "claim_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claim_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claimant_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claimant_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claimant_email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claimant_email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claim_type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claim_type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "decision",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "decision",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "approved_amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "approved_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reasoning",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reasoning",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_flags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_flags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "processed_at",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "processed_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_message_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email_message_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 327001765,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit#gid=327001765",
          "cachedResultName": "sample-claims-sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit?usp=drivesdk",
          "cachedResultName": "Auto Insurance Claim Tracker"
        }
      },
      "typeVersion": 4,
      "alwaysOutputData": true
    },
    {
      "id": "735420f5-d265-4072-8e2a-9d1600f2187e",
      "name": "Route by Decision",
      "type": "n8n-nodes-base.switch",
      "position": [
        6384,
        656
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Approved",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3fa68128-3b21-46b8-8cd4-cd410e4d0ba9",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.decision }}",
                    "rightValue": "APPROVED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Rejected",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "bec1de72-9884-478d-adad-067f4c1ecd38",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.decision }}",
                    "rightValue": "REJECTED"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a34bb64e-bf36-4e75-9f33-11b048e4e1aa",
      "name": "Generate Approval Letter",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        6656,
        400
      ],
      "parameters": {
        "font": "Inter",
        "operation": "htmlToPdf",
        "html_content": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\"/>\n<style>\n  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');\n  * { margin: 0; padding: 0; box-sizing: border-box; }\n  body { font-family: 'Inter', Arial, sans-serif; color: #222; padding: 48px 56px; line-height: 1.6; }\n  .header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #1a5276; padding-bottom: 18px; margin-bottom: 32px; }\n  .company { font-size: 22px; font-weight: 700; color: #1a5276; }\n  .company-sub { font-size: 12px; color: #666; margin-top: 4px; }\n  .ref { text-align: right; font-size: 12px; color: #555; }\n  .ref strong { color: #222; }\n  .stamp { display: inline-block; border: 3px solid #27ae60; color: #27ae60; padding: 8px 28px; font-size: 26px; font-weight: 700; transform: rotate(-3deg); border-radius: 6px; margin: 24px 0; letter-spacing: 2px; }\n  .section { background: #f4f8f4; border-left: 4px solid #27ae60; padding: 16px 20px; border-radius: 4px; margin: 20px 0; }\n  .section h3 { font-size: 14px; color: #1a5276; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }\n  .section p { font-size: 13px; color: #333; }\n  .amount { font-size: 28px; font-weight: 700; color: #27ae60; }\n  .footer { margin-top: 48px; font-size: 11px; color: #999; border-top: 1px solid #ddd; padding-top: 16px; }\n  p { margin-bottom: 12px; font-size: 14px; }\n</style>\n</head>\n<body>\n  <div class=\"header\">\n    <div>\n      <div class=\"company\">AutoGuard Insurance Co.</div>\n      <div class=\"company-sub\">Claims Processing Department</div>\n    </div>\n    <div class=\"ref\">\n      <strong>Claim ID:</strong> {{ $json.claim_id }}<br/>\n      <strong>Date:</strong> {{ $json.processed_at.split('T')[0] }}<br/>\n      <strong>Type:</strong> {{ $json.claim_type }}\n    </div>\n  </div>\n\n  <p>Dear <strong>{{ $json.claimant_name }}</strong>,</p>\n\n  <div class=\"stamp\">\u2713 CLAIM APPROVED</div>\n\n  <p>We are pleased to inform you that your insurance claim has been reviewed and <strong>approved</strong>.</p>\n\n  <div class=\"section\">\n    <h3>Approved Amount</h3>\n    <p class=\"amount\">${{ $json.approved_amount }}</p>\n  </div>\n\n  <div class=\"section\">\n    <h3>Decision Summary</h3>\n    <p>{{ $json.reasoning }}</p>\n  </div>\n\n  <p>The approved amount will be disbursed to your registered bank account within <strong>5\u20137 business days</strong>. If you have any questions, please contact our claims helpline at <strong>1-800-555-CLAIM</strong> referencing your Claim ID above.</p>\n\n  <p style=\"margin-top: 32px;\">Sincerely,</p>\n  <p><strong>Claims Approval Authority</strong><br/>AutoGuard Insurance Co.</p>\n\n  <div class=\"footer\">\n    This document was automatically generated and digitally signed. Reference: {{ $json.claim_id }} | AutoGuard Insurance Co. \u2014 All Rights Reserved.\n  </div>\n</body>\n</html>",
        "output_format": "file",
        "dynamic_params": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "advancedOptions": {},
        "output_filename": "=approval-{{ $json.claim_id }}.pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "3b9df0ac-db5c-4b42-99be-ba73e0a817e9",
      "name": "Sign Approval Letter",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        6912,
        400
      ],
      "parameters": {
        "resource": "watermark",
        "sign_text": "Claims Dept.",
        "sign_color": "#1a0dab",
        "sign_all_pages": false,
        "sign_font_size": 36,
        "sign_date_stamp": true,
        "signAdvancedOptions": {},
        "sign_pdf_input_type": "file",
        "sign_sig_input_type": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "4ea5073e-007e-4fea-88c9-6a007db110f5",
      "name": "Add APPROVED Stamp",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        7184,
        400
      ],
      "parameters": {
        "resource": "watermark",
        "operation": "addWatermark",
        "watermark_text": "APPROVED",
        "watermark_opacity": 0.08,
        "watermark_input_type": "file",
        "watermarkAdvancedOptions": {
          "color": "#27ae60"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fdd34a51-8ced-43df-900c-31079eadc9b7",
      "name": "Upload Approved Claim",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        7440,
        400
      ],
      "parameters": {
        "name": "={{ $('Parse AI Decision').item.json.claim_id }}-approved.pdf",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1bVgF_2p2eJsiSq6_1wPWFXjAWGSqXABg",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1bVgF_2p2eJsiSq6_1wPWFXjAWGSqXABg",
          "cachedResultName": "Approved Claims"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "6f41b5b4-142d-4845-8bee-32078ea4d40e",
      "name": "Email Approval",
      "type": "n8n-nodes-base.gmail",
      "position": [
        7696,
        400
      ],
      "parameters": {
        "sendTo": "={{ $('Parse AI Decision').item.json.claimant_email }}",
        "message": "=<h2>Your Claim Has Been Approved</h2><p>Dear {{ $('Parse AI Decision').item.json.claimant_name }},</p><p>Your insurance claim <strong>{{ $('Parse AI Decision').item.json.claim_id }}</strong> has been reviewed and <strong>approved</strong> for <strong>${{ $('Parse AI Decision').item.json.approved_amount }}</strong>.</p><p>{{ $('Parse AI Decision').item.json.reasoning }}</p><p>Funds will be disbursed within 5\u20137 business days.</p><p>Regards,<br/>AutoGuard Insurance Co.</p>",
        "options": {
          "appendAttribution": false
        },
        "subject": "=\u2705 Insurance Claim {{ $('Parse AI Decision').item.json.claim_id }} \u2014 Approved"
      },
      "typeVersion": 2.1
    },
    {
      "id": "9a29beef-aaf5-4792-972b-b77ee90d179c",
      "name": "Generate Rejection Letter",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        6656,
        864
      ],
      "parameters": {
        "font": "Inter",
        "operation": "htmlToPdf",
        "html_content": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\"/>\n<style>\n  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');\n  * { margin: 0; padding: 0; box-sizing: border-box; }\n  body { font-family: 'Inter', Arial, sans-serif; color: #222; padding: 48px 56px; line-height: 1.6; }\n  .header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #1a5276; padding-bottom: 18px; margin-bottom: 32px; }\n  .company { font-size: 22px; font-weight: 700; color: #1a5276; }\n  .company-sub { font-size: 12px; color: #666; margin-top: 4px; }\n  .ref { text-align: right; font-size: 12px; color: #555; }\n  .ref strong { color: #222; }\n  .stamp { display: inline-block; border: 3px solid #e74c3c; color: #e74c3c; padding: 8px 28px; font-size: 26px; font-weight: 700; transform: rotate(-3deg); border-radius: 6px; margin: 24px 0; letter-spacing: 2px; }\n  .section { background: #fdf4f4; border-left: 4px solid #e74c3c; padding: 16px 20px; border-radius: 4px; margin: 20px 0; }\n  .section h3 { font-size: 14px; color: #1a5276; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }\n  .section p { font-size: 13px; color: #333; }\n  .flags { background: #fff8e1; border-left: 4px solid #f39c12; padding: 16px 20px; border-radius: 4px; margin: 20px 0; }\n  .flags h3 { font-size: 14px; color: #e67e22; margin-bottom: 8px; }\n  .flags ul { margin: 0; padding-left: 20px; font-size: 13px; color: #333; }\n  .footer { margin-top: 48px; font-size: 11px; color: #999; border-top: 1px solid #ddd; padding-top: 16px; }\n  p { margin-bottom: 12px; font-size: 14px; }\n</style>\n</head>\n<body>\n  <div class=\"header\">\n    <div>\n      <div class=\"company\">AutoGuard Insurance Co.</div>\n      <div class=\"company-sub\">Claims Processing Department</div>\n    </div>\n    <div class=\"ref\">\n      <strong>Claim ID:</strong> {{ $json.claim_id }}<br/>\n      <strong>Date:</strong> {{ $json.processed_at.split('T')[0] }}<br/>\n      <strong>Type:</strong> {{ $json.claim_type }}\n    </div>\n  </div>\n\n  <p>Dear <strong>{{ $json.claimant_name }}</strong>,</p>\n\n  <div class=\"stamp\">\u2717 CLAIM DENIED</div>\n\n  <p>After careful review, we regret to inform you that your insurance claim has been <strong>denied</strong>.</p>\n\n  <div class=\"section\">\n    <h3>Reason for Denial</h3>\n    <p>{{ $json.reasoning }}</p>\n  </div>\n\n  <div class=\"flags\">\n    <h3>Risk Flags Identified</h3>\n    <ul>\n      <li>{{ $json.risk_flags.join('</li><li>') }}</li>\n    </ul>\n  </div>\n\n  <p>You have the right to appeal this decision within <strong>30 calendar days</strong> of this notice. To file an appeal, contact our appeals department at <strong>1-800-555-APPEAL</strong> or email <strong>appeals@autoguard-insurance.com</strong> with your Claim ID.</p>\n\n  <p style=\"margin-top: 32px;\">Sincerely,</p>\n  <p><strong>Claims Review Authority</strong><br/>AutoGuard Insurance Co.</p>\n\n  <div class=\"footer\">\n    This document was automatically generated. Reference: {{ $json.claim_id }} | AutoGuard Insurance Co. \u2014 All Rights Reserved.\n  </div>\n</body>\n</html>",
        "output_format": "file",
        "dynamic_params": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "advancedOptions": {},
        "output_filename": "=rejection-{{ $json.claim_id }}.pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "8264ff43-9b29-4c40-88a4-4bed4a69ce16",
      "name": "Add REJECTED Stamp",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        6912,
        864
      ],
      "parameters": {
        "resource": "watermark",
        "operation": "addWatermark",
        "watermark_text": "REJECTED",
        "watermark_opacity": 0.08,
        "watermark_input_type": "file",
        "watermarkAdvancedOptions": {
          "color": "#e74c3c"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "256c75eb-e2b3-4efc-a8a5-ca6f765f3334",
      "name": "Upload Rejected Claim",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        7184,
        864
      ],
      "parameters": {
        "name": "={{ $('Parse AI Decision').item.json.claim_id }}-rejected.pdf",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1GzqaUcDQpvQNCuCcW1P29f5uwRoZUG7l",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1GzqaUcDQpvQNCuCcW1P29f5uwRoZUG7l",
          "cachedResultName": "Rejected Claims"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "fffc4370-0760-4939-878f-ee42a17cee83",
      "name": "Email Rejection",
      "type": "n8n-nodes-base.gmail",
      "position": [
        7440,
        864
      ],
      "parameters": {
        "sendTo": "={{ $('Parse AI Decision').item.json.claimant_email }}",
        "message": "=<h2>Claim Decision Notice</h2><p>Dear {{ $('Parse AI Decision').item.json.claimant_name }},</p><p>Your insurance claim <strong>{{ $('Parse AI Decision').item.json.claim_id }}</strong> has been reviewed and unfortunately has been <strong>denied</strong>.</p><p><strong>Reason:</strong> {{ $('Parse AI Decision').item.json.reasoning }}</p><p>You may appeal this decision within 30 days. Please contact our appeals department at 1-800-555-APPEAL.</p><p>Regards,<br/>AutoGuard Insurance Co.</p>",
        "options": {
          "appendAttribution": false
        },
        "subject": "=\u274c Insurance Claim {{ $('Parse AI Decision').item.json.claim_id }} \u2014 Denied"
      },
      "typeVersion": 2.1
    },
    {
      "id": "77a8398a-c352-41c8-b793-1b03d414b755",
      "name": "Notify Claims Adjuster",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6768,
        1232
      ],
      "parameters": {
        "sendTo": "={{ $('Workflow Config').item.json.claims_adjuster_email }}",
        "message": "=<h2>Claim Requires Manual Review</h2><p>A claim has been flagged for human review by the automated system.</p><table border='1' cellpadding='8' cellspacing='0' style='border-collapse:collapse; font-family:sans-serif; font-size:14px;'><tr><td><strong>Claim ID</strong></td><td>{{ $json.claim_id }}</td></tr><tr><td><strong>Claimant</strong></td><td>{{ $json.claimant_name }}</td></tr><tr><td><strong>Email</strong></td><td>{{ $json.claimant_email }}</td></tr><tr><td><strong>Type</strong></td><td>{{ $json.claim_type }}</td></tr><tr><td><strong>AI Reasoning</strong></td><td>{{ $json.reasoning }}</td></tr><tr><td><strong>Risk Flags</strong></td><td>{{ $json.risk_flags.join(', ') }}</td></tr></table><p style='margin-top:16px;'>Please review the original claim in the <strong>Claims Inbox</strong> Google Drive folder and update the tracking sheet.</p>",
        "options": {
          "appendAttribution": false
        },
        "subject": "=\ud83d\udd0d Manual Review Required \u2014 {{ $json.claim_id }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "4017efdb-39c0-4023-873b-89b9081f0388",
      "name": "Update Sheet - Approved",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7952,
        400
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "claim_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "claim_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claimant_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claimant_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claimant_email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claimant_email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claim_type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claim_type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "decision",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "decision",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "approved_amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "approved_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reasoning",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reasoning",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_flags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_flags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "processed_at",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "processed_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_message_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email_message_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "claim_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 327001765,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit#gid=327001765",
          "cachedResultName": "sample-claims-sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit?usp=drivesdk",
          "cachedResultName": "Auto Insurance Claim Tracker"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c3a19af6-32d0-4fd5-8fbe-e17835ddd1d6",
      "name": "Update Sheet - Rejected",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7696,
        864
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "claim_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "claim_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claimant_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claimant_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claimant_email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claimant_email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "claim_type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "claim_type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "decision",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "decision",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "approved_amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "approved_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reasoning",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reasoning",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_flags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_flags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "processed_at",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "processed_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_message_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email_message_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "claim_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 327001765,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit#gid=327001765",
          "cachedResultName": "sample-claims-sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit?usp=drivesdk",
          "cachedResultName": "Auto Insurance Claim Tracker"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "83e4d84f-6d34-4001-9e3f-d8d984e6972a",
      "name": "Mock AI Evaluator",
      "type": "n8n-nodes-base.code",
      "position": [
        5888,
        864
      ],
      "parameters": {
        "jsCode": "// \u2705 Mock AI \u2014 controlled by Workflow Config node\n// Set mock_decision in Workflow Config: 'APPROVED' | 'REJECTED' | 'MANUAL_REVIEW'\nconst mockDecision = $('Workflow Config').item.json.mock_decision || 'APPROVED';\n\nconst response = {\n  decision: mockDecision,\n  reasoning: 'Claim is valid. Police report confirms fault of other party. Documentation is complete with repair estimate, medical records, and towing receipt. Amount is within policy limits.',\n  approved_amount: mockDecision === 'APPROVED' ? 10405 : null,\n  risk_flags: mockDecision === 'MANUAL_REVIEW' ? ['high_value', 'missing_witness'] : mockDecision === 'REJECTED' ? ['insufficient_documentation', 'coverage_mismatch'] : [],\n  claimant_name: 'James A. Mitchell',\n  claimant_email: 'user@example.com',\n  claim_type: 'collision',\n  summary: 'Collision claim \u2014 other driver ran red light, front-end damage, $10,405 total'\n};\n\nreturn [{ json: { text: JSON.stringify(response) } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "9762b6ed-a760-466b-8d90-8bf3084aecb2",
      "name": "AI Mode Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        5680,
        656
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "OpenAI",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "aimode-cond-0001",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Workflow Config').item.json.ai_mode }}",
                    "rightValue": "openai"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e01ce192-a419-4d42-b0e4-59b102cdef76",
      "name": "Workflow Config",
      "type": "n8n-nodes-base.set",
      "position": [
        5120,
        448
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"self_email\": \"user@example.com\",\n  \"claims_adjuster_email\": \"user@example.com\",\n  \"company_name\": \"Your Insurance Company\",\n  \"support_phone\": \"+1234567890\",\n  \"appeals_email\": \"user@example.com\",\n  \"ai_mode\": \"mock\",\n  \"mock_decision\": \"REJECTED\",\n  \"sheet_tab_name\": \"Claims\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "15144638-10df-42b6-9f2a-c8f67163d07b",
      "name": "Check Duplicate in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5360,
        448
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $('New Claim Uploaded').item.json.id }}",
              "lookupColumn": "email_message_id"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 327001765,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit#gid=327001765",
          "cachedResultName": "sample-claims-sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSSANnNBTqP9I4pTgXvvvKgqoCKiLaRTrNkvYnO11kc/edit?usp=drivesdk",
          "cachedResultName": "Auto Insurance Claim Tracker"
        }
      },
      "typeVersion": 4,
      "alwaysOutputData": true
    },
    {
      "id": "8251f480-fc9b-4247-99f9-f8c3f401aec5",
      "name": "Notify - Already Processed",
      "type": "n8n-nodes-base.gmail",
      "position": [
        5408,
        672
      ],
      "parameters": {
        "sendTo": "={{ $('Workflow Config').item.json.self_email }}",
        "message": "=<h2>Duplicate Claim \u2014 Already Processed</h2><p>A claim email that was previously processed was received again and has been <strong>skipped automatically</strong>.</p><table border='1' cellpadding='8' cellspacing='0' style='border-collapse:collapse;font-family:sans-serif;font-size:14px;'><tr><td><strong>Email Subject</strong></td><td>{{ $('New Claim Uploaded').item.json.subject }}</td></tr><tr><td><strong>From</strong></td><td>{{ $('New Claim Uploaded').item.json.from }}</td></tr><tr><td><strong>Gmail Message ID</strong></td><td>{{ $('New Claim Uploaded').item.json.id }}</td></tr><tr><td><strong>Original Claim ID</strong></td><td>{{ $json.claim_id }}</td></tr><tr><td><strong>Originally Processed At</strong></td><td>{{ $json.processed_at }}</td></tr><tr><td><strong>Original Decision</strong></td><td>{{ $json.decision }}</td></tr></table><p>No further processing has occurred. To reprocess, remove the existing row from the claims sheet and resend the email.</p>",
        "options": {
          "appendAttribution": false
        },
        "subject": "=\u26a0\ufe0f Duplicate Claim Detected \u2014 {{ $('New Claim Uploaded').item.json.subject }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "a115f670-d2f6-47f1-9620-2ab6d832e62b",
      "name": "AI Claim Evaluator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        5856,
        320
      ],
      "parameters": {
        "text": "=You are an experienced insurance claims adjuster AI. Evaluate the following claim data and make a decision.\n\nCLAIM DATA:\n{{ JSON.stringify($json, null, 2) }}\n\nEVALUATION RULES:\n- APPROVED: Claim is valid, documentation is complete, damage matches the policy type, no fraud indicators\n- REJECTED: Claim falls outside policy coverage, insufficient documentation, clear fraud indicators, or exceeds policy limits\n- MANUAL_REVIEW: Ambiguous cases, high-value claims (>$50,000), possible but unconfirmed fraud, or missing critical information\n\nRISK FLAGS to check:\n- Inconsistent dates (accident date vs report date gap >30 days)\n- Vague damage descriptions\n- Multiple recent claims from same claimant\n- Damage amount seems inflated\n- Missing police report for accident claims\n\nReturn ONLY a valid JSON object with this exact structure:\n{\n  \"decision\": \"APPROVED\" or \"REJECTED\" or \"MANUAL_REVIEW\",\n  \"reasoning\": \"2-3 sentence explanation\",\n  \"approved_amount\": number or null,\n  \"risk_flags\": [\"flag1\", \"flag2\"],\n  \"claimant_name\": \"extracted name or Unknown\",\n  \"claimant_email\": \"extracted email or empty string\",\n  \"claim_type\": \"collision/comprehensive/liability/property/medical/other\",\n  \"summary\": \"one-line claim summary\"\n}\n\nOUTPUT (STRICT): Only the JSON object, nothing else.",
        "batching": {},
        "messages": {
          "messageValues": []
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "3c1126e7-b516-477f-8c7e-92d1dcabf1aa",
      "name": "OpenAI GPT-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        6256,
        432
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {
          "maxTokens": 1000
        },
        "responsesApiEnabled": false
      },
      "typeVersion": 1.3
    },
    {
      "id": "1e3682aa-2152-43e5-a3a7-da51d74aa0fc",
      "name": "Sticky Note - Claim Intake",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4784,
        304
      ],
      "parameters": {
        "color": 7,
        "width": 816,
        "height": 864,
        "content": "## \ud83d\udce5 Claim Intake\nTriggers on new Gmail claim emails, loads workflow config, checks for duplicates, and extracts PDF text."
      },
      "typeVersion": 1
    },
    {
      "id": "c864c70b-94e4-46c6-b86b-999032bbdca6",
      "name": "Sticky Note - AI Evaluation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5648,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 872,
        "height": 896,
        "content": "## \ud83e\udd16 AI Evaluation & Routing\nRoutes to Mock or OpenAI evaluator, parses the AI decision, logs the claim to Sheets, then routes to Approved / Rejected / Manual Review."
      },
      "typeVersion": 1
    },
    {
      "id": "3cf14a32-afc9-4f3e-b04b-ec97961c64c5",
      "name": "Sticky Note - Manual Review",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6720,
        1152
      ],
      "parameters": {
        "color": 7,
        "width": 696,
        "height": 240,
        "content": "## \ud83d\udd0d Manual Review\nClaims the AI cannot confidently decide are forwarded to your claims adjuster for human review."
      },
      "typeVersion": 1
    },
    {
      "id": "85ebb2b0-49a3-473b-8a68-84d8c4268c6d",
      "name": "Sticky Note - Warning Config",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4928,
        384
      ],
      "parameters": {
        "color": 3,
        "width": 324,
        "height": 208,
        "content": "\u26a0\ufe0f **Set Configs** \n`self_email`\n`claims_adjuster_email`\n`ai_mode`\n`mock_decision`\n... "
      },
      "typeVersion": 1
    },
    {
      "id": "e5483389-f8c8-4487-be04-2855fa46950b",
      "name": "Sticky Note - Warning Sheets",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6144,
        304
      ],
      "parameters": {
        "color": 3,
        "width": 278,
        "height": 272,
        "content": "\n\n\n\n                                           \u26a0\ufe0f **Connect Open AI Model** - (ex, gpt 4o mini)"
      },
      "typeVersion": 1
    },
    {
      "id": "b46b3b01-aad9-4cdd-8a8c-0a50f42115bf",
      "name": "Sticky Note - Warning Drive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7360,
        304
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 256,
        "content": "\u26a0\ufe0f **Connect Google Drive credential** and set the correct folder ID for Approved Claims and Rejected Claims upload nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "151540ae-14aa-4261-b03f-946608ece218",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3872,
        256
      ],
      "parameters": {
        "width": 740,
        "height": 620,
        "content": "## \ud83d\ude97 AI-Powered Vehicle Insurance Claim Approval\n\n**How it works:**\n1. Monitors Gmail for emails with subject \"insurance claim\" + PDF attachment\n2. Skips duplicates \u2014 notifies you if already processed\n3. Extracts claim text from the attached PDF (PDF API Hub)\n4. Routes to AI: **Mock** (testing) or **OpenAI GPT-4o-mini** (production)\n5. Auto-routes the decision:\n   - \u2705 **Approved** \u2192 generates & signs approval letter, stamps APPROVED watermark, uploads to Drive, emails claimant\n   - \u274c **Rejected** \u2192 generates rejection letter, stamps REJECTED, uploads to Drive, emails claimant\n   - \ud83d\udd0d **Manual Review** \u2192 notifies your claims adjuster\n6. Every claim is logged to Google Sheets for tracking\n\n**Setup:**\n- [ ] Connect credentials: Gmail, Google Drive, Google Sheets, PDF API Hub, OpenAI (production only)\n- [ ] Create Google Sheet with required headers \u2014 configure it in all sheet nodes\n- [ ] Create two Drive folders: **Approved Claims** and **Rejected Claims**\n- [ ] Edit **Workflow Config** node: set `self_email`, `claims_adjuster_email`, and `ai_mode`\n\n**Customize:**\n- Set `ai_mode` to `openai` for production, `mock` for testing\n- Change `mock_decision` to test APPROVED / REJECTED / MANUAL_REVIEW paths without API calls\n- Edit HTML in the letter-generation nodes to match your branding"
      },
      "typeVersion": 1
    },
    {
      "id": "5c39ea18-a171-49c6-bc27-ef4d6cd844dc",
      "name": "Already Processed?",
      "type": "n8n-nodes-base.if",
      "position": [
        5216,
        688
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dup-cond-0001",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.email_message_id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "a828cb9d-d909-43d8-a71a-aa8d35e79566",
      "name": "Sticky Note - Warning Config1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4832,
        624
      ],
      "parameters": {
        "color": 3,
        "width": 244,
        "height": 176,
        "content": "\u26a0\ufe0f **Set Google oauth here**"
      },
      "typeVersion": 1
    },
    {
      "id": "0c53dac2-c455-4516-a093-a1547a455484",
      "name": "Sticky Note - Warning Config2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5168,
        896
      ],
      "parameters": {
        "color": 3,
        "width": 388,
        "height": 208,
        "content": "\u26a0\ufe0f **PDF API Hub Key**\nGet free key to start from https://pdfapihub.com"
      },
      "typeVersion": 1
    },
    {
      "id": "dbb6ad78-c921-4bcd-95cb-4c7ebd52df00",
      "name": "Sticky Note - Warning Config3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5296,
        384
      ],
      "parameters": {
        "color": 3,
        "width": 228,
        "height": 208,
        "content": "\u26a0\ufe0f **Google Sheet Connect**"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "5c8cc89b-0dff-47ec-9d4a-491df707a4b4",
  "connections": {
    "AI Mode Router": {
      "main": [
        [
          {
            "node": "AI Claim Evaluator",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mock AI Evaluator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Approval": {
      "main": [
        [
          {
            "node": "Update Sheet - Approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Rejection": {
      "main": [
        [
          {
            "node": "Update Sheet - Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Config": {
      "main": [
        [
          {
            "node": "Check Duplicate in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mock AI Evaluator": {
      "main": [
        [
          {
            "node": "Parse AI Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Decision": {
      "main": [
        [
          {
            "node": "Log Claim to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Decision": {
      "main": [
        [
          {
            "node": "Generate Approval Letter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Rejection Letter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Claims Adjuster",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Claim Evaluator": {
      "main": [
        [
          {
            "node": "Parse AI Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add APPROVED Stamp": {
      "main": [
        [
          {
            "node": "Upload Approved Claim",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add REJECTED Stamp": {
      "main": [
        [
          {
            "node": "Upload Rejected Claim",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Already Processed?": {
      "main": [
        [
          {
            "node": "Notify - Already Processed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Claim Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Claim Data": {
      "main": [
        [
          {
            "node": "AI Mode Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Claim to Sheet": {
      "main": [
        [
          {
            "node": "Route by Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Claim Uploaded": {
      "main": [
        [
          {
            "node": "Workflow Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Claim Evaluator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Sign Approval Letter": {
      "main": [
        [
          {
            "node": "Add APPROVED Stamp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Approved Claim": {
      "main": [
        [
          {
            "node": "Email Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Rejected Claim": {
      "main": [
        [
          {
            "node": "Email Rejection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Duplicate in Sheet": {
      "main": [
        [
          {
            "node": "Already Processed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Approval Letter": {
      "main": [
        [
          {
            "node": "Sign Approval Letter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Rejection Letter": {
      "main": [
        [
          {
            "node": "Add REJECTED Stamp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}