{
  "name": "Loan eligibility workflow",
  "nodes": [
    {
      "parameters": {
        "formTitle": "Loan form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "First Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Last name",
              "requiredField": true
            },
            {
              "fieldLabel": "Email",
              "fieldType": "email",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone number",
              "fieldType": "number"
            },
            {
              "fieldLabel": "Address",
              "requiredField": true
            },
            {
              "fieldLabel": "Salary range",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "500k and below"
                  },
                  {
                    "option": "\u2060> 500k to 1 million"
                  },
                  {
                    "option": "\u2060> 1 million"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "How much do you need?",
              "fieldType": "number",
              "requiredField": true
            },
            {
              "fieldLabel": "Reason for loan",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.5,
      "position": [
        -2192,
        48
      ],
      "id": "f0d2dd1c-3723-4ad9-915d-96b13ae281d2",
      "name": "On form submission"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "055af3ff-3331-4b09-86ee-553bddcc156b",
              "name": "Name",
              "value": "={{ $json['First Name'].trim() + \" \" + $json['Last name'].trim() }}",
              "type": "string"
            },
            {
              "id": "b6379930-5b61-4ce8-b75a-387fad0d0350",
              "name": "loan amount requested",
              "value": "={{ parseFloat(String($json['How much do you need?']).replace(/[^0-9.]/g, \"\")) }}",
              "type": "number"
            },
            {
              "id": "de82dedf-b598-4631-a6aa-fcf4d09294a4",
              "name": "loan request submitted at",
              "value": "={{ new Date($json.submittedAt).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false }) }}",
              "type": "number"
            },
            {
              "id": "b116d0b1-aaa9-4e65-aca5-87f131d41f5b",
              "name": "email",
              "value": "={{ $json.Email }}",
              "type": "string"
            },
            {
              "id": "1d38e733-ea0d-44fd-b81e-0d14284ad047",
              "name": "Phone number",
              "value": "={{ $json['Phone number'] }}",
              "type": "number"
            },
            {
              "id": "800de9b4-e66e-436e-8a10-4755f6b193d4",
              "name": "Address",
              "value": "={{ $json.Address }}",
              "type": "string"
            },
            {
              "id": "28e4474e-e9cb-4964-84b3-45da4f5cc127",
              "name": "Salary range",
              "value": "={{ $json['Salary range'] }}",
              "type": "string"
            },
            {
              "id": "9a4b5d76-ca68-4d94-969f-e1f16133a6fb",
              "name": "Reason for loan",
              "value": "={{ $json['Reason for loan'] }}",
              "type": "string"
            },
            {
              "id": "59317f05-62e0-428a-8438-6fddabe43747",
              "name": "applicant id",
              "value": "={{ \"APP-\" + $now.toMillis() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1984,
        48
      ],
      "id": "0d0d58a4-b6c1-421a-a376-cc26a87e4303",
      "name": "Concatenate name and give applicant ID"
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "name": "={{ $json.Name }}",
            "email": "={{ $json.email }}",
            "phone": "={{ $json['Phone number'] }}",
            "salary": "={{ $json['Salary range'] }}",
            "loan request submitted at": "={{ $json['loan request submitted at'] }}",
            "loan amount requested": "={{ $json['loan amount requested'] }}",
            "reason for loan": "={{ $json['Reason for loan'] }}",
            "applicant_id": "={{ $json['applicant id'] }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1776,
        48
      ],
      "id": "56080e3e-5d39-429a-b245-456c41a55fd3",
      "name": "Append or update row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "We've received your application!",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Loan Application Received</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n\n    body {\n      background-color: #f0ede8;\n      font-family: 'DM Sans', sans-serif;\n      padding: 40px 16px;\n      color: #1a1a1a;\n    }\n\n    .wrapper {\n      max-width: 580px;\n      margin: 0 auto;\n      background: #ffffff;\n      border-radius: 4px;\n      overflow: hidden;\n      box-shadow: 0 4px 24px rgba(0,0,0,0.08);\n    }\n\n    /* Header */\n    .header {\n      background: #1a2e22;\n      padding: 40px 48px 36px;\n      position: relative;\n      overflow: hidden;\n    }\n\n    .header::before {\n      content: '';\n      position: absolute;\n      top: -40px; right: -40px;\n      width: 180px; height: 180px;\n      border-radius: 50%;\n      background: rgba(255,255,255,0.04);\n    }\n\n    .header::after {\n      content: '';\n      position: absolute;\n      bottom: -20px; left: 30px;\n      width: 100px; height: 100px;\n      border-radius: 50%;\n      background: rgba(255,255,255,0.03);\n    }\n\n    .brand {\n      font-family: 'DM Sans', sans-serif;\n      font-weight: 600;\n      font-size: 13px;\n      letter-spacing: 0.15em;\n      text-transform: uppercase;\n      color: #8dbe9a;\n      margin-bottom: 20px;\n    }\n\n    .header h1 {\n      font-family: 'DM Serif Display', serif;\n      font-size: 32px;\n      color: #ffffff;\n      line-height: 1.2;\n      font-weight: 400;\n    }\n\n    .header h1 span {\n      color: #8dbe9a;\n    }\n\n    /* Body */\n    .body {\n      padding: 44px 48px;\n    }\n\n    .greeting {\n      font-size: 16px;\n      color: #555;\n      margin-bottom: 20px;\n      line-height: 1.6;\n    }\n\n    .greeting strong {\n      color: #1a2e22;\n      font-weight: 600;\n    }\n\n    .message {\n      font-size: 15px;\n      line-height: 1.75;\n      color: #444;\n      margin-bottom: 32px;\n    }\n\n    /* Status card */\n    .status-card {\n      background: #f6f9f6;\n      border-left: 3px solid #1a2e22;\n      border-radius: 0 6px 6px 0;\n      padding: 20px 24px;\n      margin-bottom: 36px;\n    }\n\n    .status-card p {\n      font-size: 13px;\n      font-weight: 600;\n      letter-spacing: 0.1em;\n      text-transform: uppercase;\n      color: #8dbe9a;\n      margin-bottom: 8px;\n    }\n\n    .status-card .ref {\n      font-size: 22px;\n      font-family: 'DM Serif Display', serif;\n      color: #1a2e22;\n    }\n\n    /* Steps */\n    .steps-title {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #999;\n      margin-bottom: 18px;\n    }\n\n    .step {\n      display: flex;\n      gap: 16px;\n      align-items: flex-start;\n      margin-bottom: 16px;\n    }\n\n    .step-num {\n      width: 28px;\n      height: 28px;\n      min-width: 28px;\n      background: #1a2e22;\n      color: #fff;\n      border-radius: 50%;\n      font-size: 12px;\n      font-weight: 600;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      margin-top: 1px;\n    }\n\n    .step-text {\n      font-size: 14px;\n      color: #555;\n      line-height: 1.6;\n    }\n\n    .step-text strong {\n      color: #1a2e22;\n      font-weight: 600;\n    }\n\n    .divider {\n      border: none;\n      border-top: 1px solid #ebebeb;\n      margin: 36px 0;\n    }\n\n    .closing {\n      font-size: 14px;\n      color: #666;\n      line-height: 1.7;\n    }\n\n    .closing strong {\n      display: block;\n      color: #1a2e22;\n      font-size: 15px;\n      margin-top: 20px;\n      font-weight: 600;\n    }\n\n    /* Footer */\n    .footer {\n      background: #f6f9f6;\n      padding: 24px 48px;\n      border-top: 1px solid #e8ede8;\n    }\n\n    .footer p {\n      font-size: 12px;\n      color: #999;\n      line-height: 1.6;\n      text-align: center;\n    }\n\n    .footer a {\n      color: #1a2e22;\n      text-decoration: none;\n      font-weight: 500;\n    }\n\n    /* Mobile */\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n\n    <div class=\"header\">\n      <div class=\"brand\">LoanDesk &mdash; Application Portal</div>\n      <h1>We've received<br>your <span>application.</span></h1>\n    </div>\n\n    <div class=\"body\">\n\n      <p class=\"greeting\">\n        Hello <strong>{{ $json.name }}</strong>,\n      </p>\n\n      <p class=\"message\">\n        Thank you for submitting your loan application. We've successfully received your request and our team is currently reviewing your details. You'll hear from us shortly with the next steps.\n      </p>\n\n      <div class=\"status-card\">\n        <p>Application Reference</p>\n        <div class=\"ref\">{{ $json.applicant_id }}</div>\n      </div>\n\n      <div class=\"steps-title\">What happens next</div>\n\n      <div class=\"step\">\n        <div class=\"step-num\">1</div>\n        <div class=\"step-text\"><strong>Eligibility Review</strong> \u2014 We'll assess your application against our lending criteria within a short period.</div>\n      </div>\n\n      <div class=\"step\">\n        <div class=\"step-num\">2</div>\n        <div class=\"step-text\"><strong>Loan Offer</strong> \u2014 If eligible, you'll receive a personalised loan offer with your interest rate and repayment breakdown.</div>\n      </div>\n\n      <div class=\"step\">\n        <div class=\"step-num\">3</div>\n        <div class=\"step-text\"><strong>Your Decision</strong> \u2014 You'll be able to accept or decline the offer directly from your email \u2014 no login required.</div>\n      </div>\n\n      <hr class=\"divider\" />\n\n      <div class=\"closing\">\n        In the meantime, if you have any questions or need to update your information, don't hesitate to reach out to us.\n        <strong>The LoanDesk Team</strong>\n      </div>\n\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        This email was sent because you submitted a loan enquiry at LoanDesk.<br>\n        If this wasn't you, please <a href=\"#\">contact us immediately</a>.<br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        -1568,
        48
      ],
      "id": "d7e1f8af-d569-4152-969e-6eb0f70c1d9d",
      "name": "Send welcome email",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "7e8b61da-2016-4094-8177-586cfb7cda03",
              "leftValue": "={{ $('Append or update row in sheet').item.json.salary }}",
              "rightValue": "500k and below",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1360,
        48
      ],
      "id": "e07d6dcb-c975-4497-9486-153085d27cfe",
      "name": "Check eligibility based on salary range"
    },
    {
      "parameters": {
        "sendTo": "={{ $('Append or update row in sheet').item.json.email }}",
        "subject": "An update on your loan application ",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Loan Application Update</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n\n    body {\n      background-color: #f0ede8;\n      font-family: 'DM Sans', sans-serif;\n      padding: 40px 16px;\n      color: #1a1a1a;\n    }\n\n    .wrapper {\n      max-width: 580px;\n      margin: 0 auto;\n      background: #ffffff;\n      border-radius: 4px;\n      overflow: hidden;\n      box-shadow: 0 4px 24px rgba(0,0,0,0.08);\n    }\n\n    /* Header */\n    .header {\n      background: #2e1a1a;\n      padding: 40px 48px 36px;\n      position: relative;\n      overflow: hidden;\n    }\n\n    .header::before {\n      content: '';\n      position: absolute;\n      top: -40px; right: -40px;\n      width: 180px; height: 180px;\n      border-radius: 50%;\n      background: rgba(255,255,255,0.04);\n    }\n\n    .header::after {\n      content: '';\n      position: absolute;\n      bottom: -20px; left: 30px;\n      width: 100px; height: 100px;\n      border-radius: 50%;\n      background: rgba(255,255,255,0.03);\n    }\n\n    .brand {\n      font-family: 'DM Sans', sans-serif;\n      font-weight: 600;\n      font-size: 13px;\n      letter-spacing: 0.15em;\n      text-transform: uppercase;\n      color: #c98d8d;\n      margin-bottom: 20px;\n    }\n\n    .header h1 {\n      font-family: 'DM Serif Display', serif;\n      font-size: 32px;\n      color: #ffffff;\n      line-height: 1.2;\n      font-weight: 400;\n    }\n\n    .header h1 span {\n      color: #c98d8d;\n    }\n\n    /* Body */\n    .body {\n      padding: 44px 48px;\n    }\n\n    .greeting {\n      font-size: 16px;\n      color: #555;\n      margin-bottom: 20px;\n      line-height: 1.6;\n    }\n\n    .greeting strong {\n      color: #2e1a1a;\n      font-weight: 600;\n    }\n\n    .message {\n      font-size: 15px;\n      line-height: 1.75;\n      color: #444;\n      margin-bottom: 32px;\n    }\n\n    /* Status card */\n    .status-card {\n      background: #fdf6f6;\n      border-left: 3px solid #c0392b;\n      border-radius: 0 6px 6px 0;\n      padding: 20px 24px;\n      margin-bottom: 36px;\n    }\n\n    .status-card p {\n      font-size: 13px;\n      font-weight: 600;\n      letter-spacing: 0.1em;\n      text-transform: uppercase;\n      color: #c98d8d;\n      margin-bottom: 6px;\n    }\n\n    .status-card .status-value {\n      font-size: 20px;\n      font-family: 'DM Serif Display', serif;\n      color: #2e1a1a;\n    }\n\n    .status-card .ref-small {\n      font-size: 12px;\n      color: #aaa;\n      margin-top: 6px;\n    }\n\n    /* Reason block */\n    .section-label {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #999;\n      margin-bottom: 16px;\n    }\n\n    .reason-item {\n      display: flex;\n      gap: 14px;\n      align-items: flex-start;\n      margin-bottom: 14px;\n    }\n\n    .reason-icon {\n      width: 20px;\n      height: 20px;\n      min-width: 20px;\n      background: #fdf6f6;\n      border: 1.5px solid #e8c0c0;\n      border-radius: 50%;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      font-size: 10px;\n      color: #c0392b;\n      margin-top: 2px;\n    }\n\n    .reason-text {\n      font-size: 14px;\n      color: #555;\n      line-height: 1.6;\n    }\n\n    .divider {\n      border: none;\n      border-top: 1px solid #ebebeb;\n      margin: 36px 0;\n    }\n\n    /* Encourage block */\n    .encourage {\n      background: #f6f9f6;\n      border-radius: 6px;\n      padding: 24px 28px;\n      margin-bottom: 32px;\n    }\n\n    .encourage p {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #8dbe9a;\n      margin-bottom: 10px;\n    }\n\n    .encourage ul {\n      list-style: none;\n      padding: 0;\n    }\n\n    .encourage ul li {\n      font-size: 14px;\n      color: #444;\n      line-height: 1.7;\n      padding-left: 16px;\n      position: relative;\n    }\n\n    .encourage ul li::before {\n      content: '\u2192';\n      position: absolute;\n      left: 0;\n      color: #8dbe9a;\n      font-size: 12px;\n    }\n\n    .closing {\n      font-size: 14px;\n      color: #666;\n      line-height: 1.7;\n    }\n\n    .closing strong {\n      display: block;\n      color: #2e1a1a;\n      font-size: 15px;\n      margin-top: 20px;\n      font-weight: 600;\n    }\n\n    /* Footer */\n    .footer {\n      background: #fdf6f6;\n      padding: 24px 48px;\n      border-top: 1px solid #f0e0e0;\n    }\n\n    .footer p {\n      font-size: 12px;\n      color: #999;\n      line-height: 1.6;\n      text-align: center;\n    }\n\n    .footer a {\n      color: #2e1a1a;\n      text-decoration: none;\n      font-weight: 500;\n    }\n\n    /* Mobile */\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n\n    <div class=\"header\">\n      <div class=\"brand\">LoanDesk &mdash; Application Update</div>\n      <h1>An update on<br>your <span>application.</span></h1>\n    </div>\n\n    <div class=\"body\">\n\n      <p class=\"greeting\">\n        Hello <strong>{{ $('Append or update row in sheet').item.json.name }}</strong>,\n      </p>\n\n      <p class=\"message\">\n        Thank you for your interest in our loan product and for taking the time to submit your application. After carefully reviewing your details, we regret to inform you that we are unable to proceed with your loan request at this time.\n      </p>\n\n      <div class=\"status-card\">\n        <p>Application Status</p>\n        <div class=\"status-value\">Not Eligible &mdash; Unsuccessful</div>\n        <div class=\"ref-small\">Ref: {{ $('Append or update row in sheet').item.json.applicant_id }}</div>\n      </div>\n\n      <div class=\"section-label\">Reason for this decision</div>\n\n      <div class=\"reason-item\">\n        <div class=\"reason-icon\">\u2715</div>\n        <div class=\"reason-text\">Your declared income did not meet the minimum threshold required to qualify for the loan amount requested.</div>\n      </div>\n\n      <div class=\"reason-item\">\n        <div class=\"reason-icon\">\u2715</div>\n        <div class=\"reason-text\">Based on our current eligibility criteria, we are unable to offer a suitable loan product that matches your profile at this time.</div>\n      </div>\n\n      <hr class=\"divider\" />\n\n      <div class=\"encourage\">\n        <p>You can reapply in the future</p>\n        <ul>\n          <li>Ensure your monthly income meets our minimum requirement</li>\n          <li>Request a loan amount proportional to your income level</li>\n          <li>You are welcome to reapply once your financial situation changes</li>\n          <li>Feel free to contact us if you'd like guidance before reapplying</li>\n        </ul>\n      </div>\n\n      <div class=\"closing\">\n        We understand this may be disappointing and we genuinely appreciate your interest. This decision is based solely on eligibility criteria and is not a reflection of your character or creditworthiness in general.\n        <strong>The LoanDesk Team</strong>\n      </div>\n\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        This email is regarding your loan application submitted to LoanDesk.<br>\n        If you believe this decision was made in error, please <a href=\"#\">contact our support team</a>.<br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        -1168,
        -128
      ],
      "id": "83053344-abef-4330-8417-5aba82b3749d",
      "name": "Send rejection mail",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e013d5a3-d7e7-4d2c-9ee7-6120080a5255",
              "name": "name",
              "value": "={{ $('Append or update row in sheet').item.json.name }}",
              "type": "string"
            },
            {
              "id": "c3d3ef4b-a820-45ff-bc80-9b3e4cb612d8",
              "name": "email",
              "value": "={{ $('Append or update row in sheet').item.json.email }}",
              "type": "string"
            },
            {
              "id": "57e30995-b6c9-4c68-97ce-e54fd73feb5b",
              "name": "phone",
              "value": "={{ $('Append or update row in sheet').item.json.phone }}",
              "type": "number"
            },
            {
              "id": "d5552a44-4827-40ed-a717-6305b5e482e0",
              "name": "salary",
              "value": "={{ $('Append or update row in sheet').item.json.salary }}",
              "type": "string"
            },
            {
              "id": "acde109f-141a-4e84-8ac0-6247883eade6",
              "name": "loan request submitted at",
              "value": "={{ $('Append or update row in sheet').item.json['loan request submitted at'] }}",
              "type": "string"
            },
            {
              "id": "2d3d1472-2908-4c03-b13c-31f1078b0001",
              "name": "loan amount requested",
              "value": "={{ $('Append or update row in sheet').item.json['loan amount requested'] }}",
              "type": "number"
            },
            {
              "id": "bf213945-73e7-48c6-8630-910621cd8577",
              "name": "applicant_id",
              "value": "={{ $('Append or update row in sheet').item.json.applicant_id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1168,
        240
      ],
      "id": "07e8c21c-6726-448d-b528-450f0cd1b2fb",
      "name": "Preserve loan details"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "d5f97b67-df85-40a2-b4da-84f9d2d562e9",
              "leftValue": "={{ $json.salary }}",
              "rightValue": "> 500k to 1 million",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -896,
        240
      ],
      "id": "4f00d1f0-0c7a-4381-ac91-303720c56e8d",
      "name": "seperate eligibility range"
    },
    {
      "parameters": {
        "jsCode": "for (const item of $input.all()) {\n  const loanAmount = parseFloat(item.json['loan amount requested']) || 0;\n  const interestRate = 0.08; // 8% for 500k to 1M salary tier\n  const TERM = 12;\n\n  const totalInterest    = loanAmount * interestRate * TERM;\n  const totalPayable     = loanAmount + totalInterest;\n  const monthlyRepayment = totalPayable / TERM;\n\n  const fmt = (n) => \"\u20a6\" + n.toLocaleString(\"en-NG\", {\n    minimumFractionDigits: 2,\n    maximumFractionDigits: 2\n  });\n\n  item.json.interest_rate_percent  = \"8%\";\n  item.json.loan_term_months       = TERM;\n  item.json.total_interest         = fmt(totalInterest);\n  item.json.total_payable          = fmt(totalPayable);\n  item.json.monthly_repayment      = fmt(monthlyRepayment);\n  item.json.total_payable_raw      = totalPayable.toFixed(2);\n  item.json.monthly_repayment_raw  = monthlyRepayment.toFixed(2);\n}\n\nreturn $input.all();"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -576,
        96
      ],
      "id": "2cca744e-9867-4841-953f-d345a8182f2b",
      "name": "Calculate interest for \u2060> 500k to 1 million"
    },
    {
      "parameters": {
        "jsCode": "for (const item of $input.all()) {\n  const loanAmount = parseFloat(item.json['loan amount requested']) || 0;\n  const interestRate = 0.08; // 8% for 500k to 1M salary tier\n  const TERM = 12;\n\n  const totalInterest    = loanAmount * interestRate * TERM;\n  const totalPayable     = loanAmount + totalInterest;\n  const monthlyRepayment = totalPayable / TERM;\n\n  const fmt = (n) => \"\u20a6\" + n.toLocaleString(\"en-NG\", {\n    minimumFractionDigits: 2,\n    maximumFractionDigits: 2\n  });\n\n  item.json.interest_rate_percent  = \"8%\";\n  item.json.loan_term_months       = TERM;\n  item.json.total_interest         = fmt(totalInterest);\n  item.json.total_payable          = fmt(totalPayable);\n  item.json.monthly_repayment      = fmt(monthlyRepayment);\n  item.json.total_payable_raw      = totalPayable.toFixed(2);\n  item.json.monthly_repayment_raw  = monthlyRepayment.toFixed(2);\n}\n\nreturn $input.all();"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -576,
        384
      ],
      "id": "17b0b5fd-ffb5-4908-a638-1980a844c88d",
      "name": "Calculate interest for \u2060\"> 1 million"
    },
    {
      "parameters": {
        "content": "## Loan request intake and acknowledgement\n",
        "height": 368,
        "width": 848
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2256,
        -80
      ],
      "typeVersion": 1,
      "id": "cf32fa44-8a1c-4882-aa6b-d2ba5c4b9e77",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Eligibility routing",
        "height": 608,
        "width": 592,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -208
      ],
      "typeVersion": 1,
      "id": "ab7bd360-52bf-43b1-8e7d-8a1ce0897f3e",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "eligibility status": "ineligible",
            "applicant_id": "={{ $('Append or update row in sheet').item.json.applicant_id }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "offer sent at",
              "displayName": "offer sent at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response recived at",
              "displayName": "response recived at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "final status",
              "displayName": "final status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -960,
        -128
      ],
      "id": "9ec24598-b53f-4709-8b2b-7c9e324a2520",
      "name": "Update status to ineligible",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "applicant_id": "={{ $json.applicant_id }}",
            "interest rate": "={{ $json.interest_rate_percent }}",
            "total payable": "={{ $json.total_payable }}",
            "loan_term_months": "={{ $json.loan_term_months }}",
            "monthly_repayment": "={{ $json.monthly_repayment }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "offer sent at",
              "displayName": "offer sent at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "response received at",
              "displayName": "response received at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -320,
        384
      ],
      "id": "3d002a3c-769d-461b-8982-4dcb7b9fe23f",
      "name": "Update sheet",
      "executeOnce": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "applicant_id": "={{ $json.applicant_id }}",
            "interest rate": "={{ $json.interest_rate_percent }}",
            "total payable": "={{ $json.total_payable }}",
            "loan_term_months": "={{ $json.loan_term_months }}",
            "monthly_repayment": "={{ $json.monthly_repayment }}",
            "eligibility status": "eligible",
            "response status": "no response",
            "follow up count": "0"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "offer sent at",
              "displayName": "offer sent at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "response received at",
              "displayName": "response received at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -320,
        96
      ],
      "id": "12bf4045-98a6-409f-9dc4-39a1f7ecc894",
      "name": "update info",
      "executeOnce": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Calculate interest and send eligibility mail",
        "height": 608,
        "width": 928,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -64
      ],
      "typeVersion": 1,
      "id": "30011165-6d0f-401f-9988-18a1de79532d",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "sendTo": "={{ $('Calculate interest for \u2060> 500k to 1 million').item.json.email }}",
        "subject": "=Your loan request was approved!",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Your Loan Offer</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n\n    body {\n      background-color: #f0ede8;\n      font-family: 'DM Sans', sans-serif;\n      padding: 40px 16px;\n      color: #1a1a1a;\n    }\n\n    .wrapper {\n      max-width: 580px;\n      margin: 0 auto;\n      background: #ffffff;\n      border-radius: 4px;\n      overflow: hidden;\n      box-shadow: 0 4px 24px rgba(0,0,0,0.08);\n    }\n\n    /* Header */\n    .header {\n      background: #1a2e22;\n      padding: 40px 48px 36px;\n      position: relative;\n      overflow: hidden;\n    }\n\n    .header::before {\n      content: '';\n      position: absolute;\n      top: -40px; right: -40px;\n      width: 200px; height: 200px;\n      border-radius: 50%;\n      background: rgba(255,255,255,0.04);\n    }\n\n    .brand {\n      font-size: 13px;\n      font-weight: 600;\n      letter-spacing: 0.15em;\n      text-transform: uppercase;\n      color: #8dbe9a;\n      margin-bottom: 20px;\n    }\n\n    .header h1 {\n      font-family: 'DM Serif Display', serif;\n      font-size: 32px;\n      color: #ffffff;\n      line-height: 1.2;\n      font-weight: 400;\n    }\n\n    .header h1 span { color: #8dbe9a; }\n\n    /* Body */\n    .body { padding: 44px 48px; }\n\n    .greeting {\n      font-size: 16px;\n      color: #555;\n      margin-bottom: 16px;\n      line-height: 1.6;\n    }\n\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n\n    .message {\n      font-size: 15px;\n      line-height: 1.75;\n      color: #444;\n      margin-bottom: 32px;\n    }\n\n    /* Offer breakdown table */\n    .section-label {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #999;\n      margin-bottom: 16px;\n    }\n\n    .offer-table {\n      width: 100%;\n      border-collapse: collapse;\n      margin-bottom: 36px;\n    }\n\n    .offer-table tr {\n      border-bottom: 1px solid #f0f0f0;\n    }\n\n    .offer-table tr:last-child { border-bottom: none; }\n\n    .offer-table td {\n      padding: 14px 0;\n      font-size: 14px;\n    }\n\n    .offer-table td:first-child {\n      color: #888;\n      width: 55%;\n    }\n\n    .offer-table td:last-child {\n      color: #1a2e22;\n      font-weight: 600;\n      text-align: right;\n    }\n\n    .offer-table .highlight td {\n      background: #f6f9f6;\n      padding: 16px 16px;\n      border-radius: 6px;\n      border-bottom: none;\n    }\n\n    .offer-table .highlight td:first-child {\n      color: #1a2e22;\n      font-weight: 600;\n      border-radius: 6px 0 0 6px;\n    }\n\n    .offer-table .highlight td:last-child {\n      font-size: 18px;\n      color: #1a2e22;\n      border-radius: 0 6px 6px 0;\n    }\n\n    .divider {\n      border: none;\n      border-top: 1px solid #ebebeb;\n      margin: 32px 0;\n    }\n\n    /* CTA Buttons */\n    .cta-label {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #999;\n      margin-bottom: 16px;\n      text-align: center;\n    }\n\n    .cta-wrap {\n      display: flex;\n      gap: 12px;\n      margin-bottom: 20px;\n    }\n\n    .btn {\n      display: block;\n      width: 100%;\n      padding: 16px;\n      border-radius: 4px;\n      text-align: center;\n      font-size: 15px;\n      font-weight: 600;\n      text-decoration: none;\n      font-family: 'DM Sans', sans-serif;\n    }\n\n    .btn-accept {\n      background: #1a2e22;\n      color: #ffffff;\n    }\n\n    .btn-decline {\n      background: #f6f6f6;\n      color: #666;\n      border: 1px solid #e0e0e0;\n    }\n\n    .cta-note {\n      font-size: 12px;\n      color: #aaa;\n      text-align: center;\n      line-height: 1.6;\n      margin-bottom: 32px;\n    }\n\n    .closing {\n      font-size: 14px;\n      color: #666;\n      line-height: 1.7;\n    }\n\n    .closing strong {\n      display: block;\n      color: #1a2e22;\n      font-size: 15px;\n      margin-top: 20px;\n      font-weight: 600;\n    }\n\n    /* Footer */\n    .footer {\n      background: #f6f9f6;\n      padding: 24px 48px;\n      border-top: 1px solid #e8ede8;\n    }\n\n    .footer p {\n      font-size: 12px;\n      color: #999;\n      line-height: 1.6;\n      text-align: center;\n    }\n\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    /* Mobile */\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n      .cta-wrap { flex-direction: column; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n\n    <div class=\"header\">\n      <div class=\"brand\">LoanDesk &mdash; Loan Offer</div>\n      <h1>You've been <span>approved</span><br>for a loan offer.</h1>\n    </div>\n\n    <div class=\"body\">\n\n      <p class=\"greeting\">Hello <strong>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.name }}</strong>,</p>\n\n      <p class=\"message\">\n        Great news \u2014 you meet our eligibility criteria. Based on the information you provided, we have prepared a personalised loan offer for you. Please review the details below and let us know your decision.\n      </p>\n\n      <div class=\"section-label\">Your Loan Offer Breakdown</div>\n\n      <table class=\"offer-table\">\n        <tr>\n          <td>Loan Amount Requested</td>\n          <td>\u20a6{{ $('Calculate interest for \u2060> 500k to 1 million').item.json['loan amount requested'] }}</td>\n        </tr>\n        <tr>\n          <td>Interest Rate</td>\n          <td>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.interest_rate_percent }} per month</td>\n        </tr>\n        <tr>\n          <td>Loan Term</td>\n          <td>{{ $json.loan_term_months }} months</td>\n        </tr>\n        <tr>\n          <td>Total Interest</td>\n          <td>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.applicant_id }}</td>\n        </tr>\n        <tr class=\"highlight\">\n          <td>Total Amount Payable</td>\n          <td>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.total_payable }}</td>\n        </tr>\n        <tr>\n          <td>Monthly Repayment</td>\n          <td>{{ $json.monthly_repayment }}</td>\n        </tr>\n        <tr>\n          <td>Reference</td>\n          <td>{{ $json.applicant_id }}</td>\n        </tr>\n      </table>\n\n      <hr class=\"divider\" />\n\n      <div class=\"cta-label\">Respond to this offer</div>\n\n      <div class=\"cta-wrap\">\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=accept\"class=\"btn btn-accept\">\u2705 Accept Offer</a>\n\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=decline\" class=\"btn btn-decline\">\u2715 Decline Offer</a>\n      </div>\n\n      <p class=\"cta-note\">\n        This offer expires in <strong>48 hours</strong>. Simply click your preferred button above \u2014 no login required.<br>\n        Once you respond, we will send you a confirmation email immediately.\n      </p>\n\n      <hr class=\"divider\" />\n\n      <div class=\"closing\">\n        If you have any questions about this offer before deciding, kindly contact support.\n        <strong>The LoanDesk Team</strong>\n      </div>\n\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        This offer was generated based on your loan application to LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        -64,
        96
      ],
      "id": "b727ea5b-595b-46ad-97b7-3489a94dda31",
      "name": "Send loan offer email",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "=",
        "subject": "Your loan request was approved!",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Your Loan Offer</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n\n    body {\n      background-color: #f0ede8;\n      font-family: 'DM Sans', sans-serif;\n      padding: 40px 16px;\n      color: #1a1a1a;\n    }\n\n    .wrapper {\n      max-width: 580px;\n      margin: 0 auto;\n      background: #ffffff;\n      border-radius: 4px;\n      overflow: hidden;\n      box-shadow: 0 4px 24px rgba(0,0,0,0.08);\n    }\n\n    /* Header */\n    .header {\n      background: #1a2e22;\n      padding: 40px 48px 36px;\n      position: relative;\n      overflow: hidden;\n    }\n\n    .header::before {\n      content: '';\n      position: absolute;\n      top: -40px; right: -40px;\n      width: 200px; height: 200px;\n      border-radius: 50%;\n      background: rgba(255,255,255,0.04);\n    }\n\n    .brand {\n      font-size: 13px;\n      font-weight: 600;\n      letter-spacing: 0.15em;\n      text-transform: uppercase;\n      color: #8dbe9a;\n      margin-bottom: 20px;\n    }\n\n    .header h1 {\n      font-family: 'DM Serif Display', serif;\n      font-size: 32px;\n      color: #ffffff;\n      line-height: 1.2;\n      font-weight: 400;\n    }\n\n    .header h1 span { color: #8dbe9a; }\n\n    /* Body */\n    .body { padding: 44px 48px; }\n\n    .greeting {\n      font-size: 16px;\n      color: #555;\n      margin-bottom: 16px;\n      line-height: 1.6;\n    }\n\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n\n    .message {\n      font-size: 15px;\n      line-height: 1.75;\n      color: #444;\n      margin-bottom: 32px;\n    }\n\n    /* Offer breakdown table */\n    .section-label {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #999;\n      margin-bottom: 16px;\n    }\n\n    .offer-table {\n      width: 100%;\n      border-collapse: collapse;\n      margin-bottom: 36px;\n    }\n\n    .offer-table tr {\n      border-bottom: 1px solid #f0f0f0;\n    }\n\n    .offer-table tr:last-child { border-bottom: none; }\n\n    .offer-table td {\n      padding: 14px 0;\n      font-size: 14px;\n    }\n\n    .offer-table td:first-child {\n      color: #888;\n      width: 55%;\n    }\n\n    .offer-table td:last-child {\n      color: #1a2e22;\n      font-weight: 600;\n      text-align: right;\n    }\n\n    .offer-table .highlight td {\n      background: #f6f9f6;\n      padding: 16px 16px;\n      border-radius: 6px;\n      border-bottom: none;\n    }\n\n    .offer-table .highlight td:first-child {\n      color: #1a2e22;\n      font-weight: 600;\n      border-radius: 6px 0 0 6px;\n    }\n\n    .offer-table .highlight td:last-child {\n      font-size: 18px;\n      color: #1a2e22;\n      border-radius: 0 6px 6px 0;\n    }\n\n    .divider {\n      border: none;\n      border-top: 1px solid #ebebeb;\n      margin: 32px 0;\n    }\n\n    /* CTA Buttons */\n    .cta-label {\n      font-size: 11px;\n      font-weight: 600;\n      letter-spacing: 0.12em;\n      text-transform: uppercase;\n      color: #999;\n      margin-bottom: 16px;\n      text-align: center;\n    }\n\n    .cta-wrap {\n      display: flex;\n      gap: 12px;\n      margin-bottom: 20px;\n    }\n\n    .btn {\n      display: block;\n      width: 100%;\n      padding: 16px;\n      border-radius: 4px;\n      text-align: center;\n      font-size: 15px;\n      font-weight: 600;\n      text-decoration: none;\n      font-family: 'DM Sans', sans-serif;\n    }\n\n    .btn-accept {\n      background: #1a2e22;\n      color: #ffffff;\n    }\n\n    .btn-decline {\n      background: #f6f6f6;\n      color: #666;\n      border: 1px solid #e0e0e0;\n    }\n\n    .cta-note {\n      font-size: 12px;\n      color: #aaa;\n      text-align: center;\n      line-height: 1.6;\n      margin-bottom: 32px;\n    }\n\n    .closing {\n      font-size: 14px;\n      color: #666;\n      line-height: 1.7;\n    }\n\n    .closing strong {\n      display: block;\n      color: #1a2e22;\n      font-size: 15px;\n      margin-top: 20px;\n      font-weight: 600;\n    }\n\n    /* Footer */\n    .footer {\n      background: #f6f9f6;\n      padding: 24px 48px;\n      border-top: 1px solid #e8ede8;\n    }\n\n    .footer p {\n      font-size: 12px;\n      color: #999;\n      line-height: 1.6;\n      text-align: center;\n    }\n\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    /* Mobile */\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n      .cta-wrap { flex-direction: column; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n\n    <div class=\"header\">\n      <div class=\"brand\">LoanDesk &mdash; Loan Offer</div>\n      <h1>You've been <span>approved</span><br>for a loan offer.</h1>\n    </div>\n\n    <div class=\"body\">\n\n      <p class=\"greeting\">Hello <strong>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.name }}</strong>,</p>\n\n      <p class=\"message\">\n        Great news \u2014 you meet our eligibility criteria. Based on the information you provided, we have prepared a personalised loan offer for you. Please review the details below and let us know your decision.\n      </p>\n\n      <div class=\"section-label\">Your Loan Offer Breakdown</div>\n\n      <table class=\"offer-table\">\n        <tr>\n          <td>Loan Amount Requested</td>\n          <td>\u20a6{{ $('Calculate interest for \u2060> 500k to 1 million').item.json['loan amount requested'] }}</td>\n        </tr>\n        <tr>\n          <td>Interest Rate</td>\n          <td>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.interest_rate_percent }} per month</td>\n        </tr>\n        <tr>\n          <td>Loan Term</td>\n          <td>{{ $json.loan_term_months }} months</td>\n        </tr>\n        <tr>\n          <td>Total Interest</td>\n          <td>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.applicant_id }}</td>\n        </tr>\n        <tr class=\"highlight\">\n          <td>Total Amount Payable</td>\n          <td>{{ $('Calculate interest for \u2060> 500k to 1 million').item.json.total_payable }}</td>\n        </tr>\n        <tr>\n          <td>Monthly Repayment</td>\n          <td>{{ $json.monthly_repayment }}</td>\n        </tr>\n        <tr>\n          <td>Reference</td>\n          <td>{{ $json.applicant_id }}</td>\n        </tr>\n      </table>\n\n      <hr class=\"divider\" />\n\n      <div class=\"cta-label\">Respond to this offer</div>\n\n      <div class=\"cta-wrap\">\n        <a href=\"{{ $json.$resumeUrl }}?accept=true\" class=\"btn btn-accept\">\u2705 Accept Offer</a>\n        <a href=\"{{ $json.$resumeUrl }}?accept=false\" class=\"btn btn-decline\">\u2715 Decline Offer</a>\n      </div>\n\n      <p class=\"cta-note\">\n        This offer expires in <strong>48 hours</strong>. Simply click your preferred button above \u2014 no login required.<br>\n        Once you respond, we will send you a confirmation email immediately.\n      </p>\n\n      <hr class=\"divider\" />\n\n      <div class=\"closing\">\n        If you have any questions about this offer before deciding, feel free to reply to this email and our team will assist you.\n        <strong>The LoanDesk Team</strong>\n      </div>\n\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        This offer was generated based on your loan application to LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        -64,
        384
      ],
      "id": "73dfb6d3-a5e8-4114-8107-c2ae42baefec",
      "name": "Send offer email",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 3
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -464,
        1296
      ],
      "id": "51573c94-5551-4f1a-9fbb-d901ac5786ed",
      "name": "Schedule Trigger",
      "disabled": true
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -464,
        1040
      ],
      "id": "b735ab05-96a0-451f-bf64-48e1eeb62207",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -144,
        1152
      ],
      "id": "110e27c6-10b3-42be-b83d-4bc5b05bcc32",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 3
          },
          "conditions": [
            {
              "id": "95a3cb1c-4daf-43e3-a082-16160f6a4967",
              "leftValue": "={{ $json['response status'] }}",
              "rightValue": "no response",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "2d885cbd-b672-4440-a79d-862cefcda456",
              "leftValue": "={{ $json['follow up count'] }}",
              "rightValue": "2",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        112,
        1152
      ],
      "id": "10cbf59e-a949-4d91-954e-1d0a062f3457",
      "name": "Check for who hasn't responded"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.salary }}",
                    "rightValue": "\u2060> 500k to 1 million",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "d3145bad-b529-4b07-9781-9b1eaf21a21a"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "\u2060> 500k to 1 million"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "051e49b2-9d70-4be6-abfb-088ff47b48a8",
                    "leftValue": "={{ $json.salary }}",
                    "rightValue": "\u2060> 1 million",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "\u2060> 1 million"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        368,
        1152
      ],
      "id": "1453917a-50e9-4bb3-85e0-ba4b1384f1dd",
      "name": "Switch"
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "Your loan offer is still waiting for you.",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Your Loan Offer is Still Open</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n    body { background-color: #f0ede8; font-family: 'DM Sans', sans-serif; padding: 40px 16px; color: #1a1a1a; }\n    .wrapper { max-width: 580px; margin: 0 auto; background: #ffffff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }\n\n    .header { background: #1a2e22; padding: 40px 48px 36px; position: relative; overflow: hidden; }\n    .header::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.04); }\n    .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 20px; }\n\n    /* Nudge badge */\n    .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,200,100,0.12); border: 1px solid rgba(255,200,100,0.25); border-radius: 20px; padding: 6px 14px; margin-bottom: 20px; }\n    .badge span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #f5c842; }\n\n    .header h1 { font-family: 'DM Serif Display', serif; font-size: 30px; color: #ffffff; line-height: 1.2; font-weight: 400; }\n    .header h1 span { color: #8dbe9a; }\n\n    .body { padding: 44px 48px; }\n    .greeting { font-size: 16px; color: #555; margin-bottom: 16px; line-height: 1.6; }\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n    .message { font-size: 15px; line-height: 1.75; color: #444; margin-bottom: 32px; }\n\n    .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; }\n\n    /* Offer recap */\n    .offer-recap { background: #f6f9f6; border-radius: 6px; padding: 24px; margin-bottom: 32px; }\n    .offer-recap table { width: 100%; border-collapse: collapse; }\n    .offer-recap table tr { border-bottom: 1px solid #eaf0ea; }\n    .offer-recap table tr:last-child { border-bottom: none; }\n    .offer-recap table td { padding: 12px 0; font-size: 14px; }\n    .offer-recap table td:first-child { color: #888; width: 55%; }\n    .offer-recap table td:last-child { color: #1a2e22; font-weight: 600; text-align: right; }\n\n    /* Expiry warning */\n    .expiry-warn { background: #fffbf0; border: 1px solid #f5c842; border-radius: 6px; padding: 16px 20px; margin-bottom: 32px; display: flex; gap: 12px; align-items: flex-start; }\n    .expiry-warn .icon { font-size: 18px; margin-top: 1px; }\n    .expiry-warn p { font-size: 14px; color: #7a6200; line-height: 1.6; }\n    .expiry-warn p strong { color: #5a4800; }\n\n    /* CTA */\n    .cta-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; text-align: center; }\n    .cta-wrap { display: flex; gap: 12px; margin-bottom: 12px; }\n    .btn { display: block; width: 100%; padding: 16px; border-radius: 4px; text-align: center; font-size: 15px; font-weight: 600; text-decoration: none; font-family: 'DM Sans', sans-serif; }\n    .btn-accept { background: #1a2e22; color: #ffffff; }\n    .btn-decline { background: #f6f6f6; color: #666; border: 1px solid #e0e0e0; }\n    .cta-note { font-size: 12px; color: #aaa; text-align: center; line-height: 1.6; margin-bottom: 32px; }\n\n    .divider { border: none; border-top: 1px solid #ebebeb; margin: 32px 0; }\n    .closing { font-size: 14px; color: #666; line-height: 1.7; }\n    .closing strong { display: block; color: #1a2e22; font-size: 15px; margin-top: 20px; font-weight: 600; }\n\n    .footer { background: #f6f9f6; padding: 24px 48px; border-top: 1px solid #e8ede8; }\n    .footer p { font-size: 12px; color: #999; line-height: 1.6; text-align: center; }\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n      .cta-wrap { flex-direction: column; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n    <div class=\"header\">\n      <div class=\"badge\"><span>\u23f3 &nbsp;Reminder \u2014 Action Required</span></div>\n      <div class=\"brand\">LoanDesk &mdash; Follow-up</div>\n      <h1>Your loan offer is<br>still <span>waiting for you.</span></h1>\n    </div>\n\n    <div class=\"body\">\n      <p class=\"greeting\">Hello <strong>{{ $json.name }}</strong>,</p>\n      <p class=\"message\">\n        We noticed you haven't responded to the loan offer we sent you. We wanted to follow up to make sure you didn't miss it \u2014 your personalised offer is still active and ready for your decision.\n      </p>\n\n      <div class=\"section-label\">Your Offer Recap</div>\n      <div class=\"offer-recap\">\n        <table>\n          <tr><td>Loan Amount Requested</td><td>\u20a6{{ $json['loan amount requested'] }}</td></tr>\n          <tr><td>Interest Rate</td><td>{{ $json['interest rate'] }} per month</td></tr>\n          <tr><td>Total Payable</td><td>{{ $json['total payable'] }}</td></tr>\n          <tr><td>Monthly Repayment</td><td>{{ $json.monthly_repayment }}</td></tr>\n          <tr><td>Reference</td><td>{{ $json.applicant_id }}</td></tr>\n        </table>\n      </div>\n\n      <div class=\"expiry-warn\">\n        <div class=\"icon\">\u26a0\ufe0f</div>\n        <p>This offer will <strong>expire soon</strong>. Once it expires you will need to reapply. Please respond as soon as possible to secure your loan.</p>\n      </div>\n\n      <div class=\"cta-wrap\">\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=accept\"class=\"btn btn-accept\">\u2705 Accept Offer</a>\n\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=decline\" class=\"btn btn-decline\">\u2715 Decline Offer</a>\n      </div>\n      <p class=\"cta-note\">No login required \u2014 simply click your choice above and we'll handle the rest.</p>\n\n      <hr class=\"divider\" />\n      <div class=\"closing\">\n        If you have any questions about the offer or need clarification before deciding, please reply to this email and our team will be happy to help.\n        <strong>The LoanDesk Team</strong>\n      </div>\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        You are receiving this because you have a pending loan offer with LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        848,
        864
      ],
      "id": "2ca6e83b-bba7-4669-b380-067752c99a8a",
      "name": "Follow up with >500 to 1mil",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "03f255b4-5ff4-44f1-9b61-a3afb5c7e6e1",
              "leftValue": "={{ $json.query.response }}",
              "rightValue": "accept",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        768,
        80
      ],
      "id": "3f750f68-9adc-4f8e-8157-3fbce8796747",
      "name": "If loan offer was accepted"
    },
    {
      "parameters": {
        "path": "YOUR_WEBHOOK_ID",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        560,
        80
      ],
      "id": "2916b928-fa06-447a-a6e1-a1a7042a9078",
      "name": "Get loan offer response"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "dda9758a-6bf7-4398-bb62-1429eedc07da",
              "name": "applicant_id",
              "value": "={{ $json.query.applicant_id }}",
              "type": "string"
            },
            {
              "id": "15edafb4-1931-4aba-bf72-56c3c2f1de76",
              "name": "offer response",
              "value": "={{ $json.query.response }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1104,
        224
      ],
      "id": "7252a064-bfa3-4f73-b762-3612d8444edb",
      "name": "Get declined response"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "dda9758a-6bf7-4398-bb62-1429eedc07da",
              "name": "applicant_id",
              "value": "={{ $json.query.applicant_id }}",
              "type": "string"
            },
            {
              "id": "15edafb4-1931-4aba-bf72-56c3c2f1de76",
              "name": "offer response",
              "value": "={{ $json.query.response }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1104,
        -48
      ],
      "id": "23abe193-e830-4794-a237-571d8d25875f",
      "name": "Get accepted response and applicant ID"
    },
    {
      "parameters": {
        "respondWith": "text",
        "responseBody": "=<html>\n<head>\n<title>Offer Accepted</title>\n<style>\nbody { font-family: Arial; text-align: center; padding: 60px; }\n.success { color: #0f5132; }\n</style>\n</head>\n<body>\n<h2 class=\"success\">Offer Accepted</h2>\n<p>Your response has been recorded successfully.</p>\n<p>You will receive a confirmation email shortly.</p>\n</body>\n</html>",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/html"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.5,
      "position": [
        1520,
        -48
      ],
      "id": "20bf6569-f745-4da5-85bd-75bc9f72fd6a",
      "name": "offer accepted response"
    },
    {
      "parameters": {
        "respondWith": "text",
        "responseBody": "=<html>\n<head>\n<title>Offer Accepted</title>\n<style>\nbody { font-family: Arial; text-align: center; padding: 60px; }\n.success { color: #0f5132; }\n</style>\n</head>\n<body>\n<h2 class=\"success\">Offer Accepted</h2>\n<p>Your response has been recorded successfully.</p>\n<p>You will receive a confirmation email shortly.</p>\n</body>\n</html>",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/html"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.5,
      "position": [
        1536,
        224
      ],
      "id": "403f2b9a-26ed-4d8f-ba4e-3670dd612855",
      "name": "offer declined response"
    },
    {
      "parameters": {
        "content": "## Loan offer accepted response route",
        "height": 288,
        "width": 1136,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -144
      ],
      "typeVersion": 1,
      "id": "b0830f02-310d-44ac-aa69-9399e2ea61a4",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Loan offer declined response route",
        "height": 288,
        "width": 1136,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        176
      ],
      "typeVersion": 1,
      "id": "74e2bb16-6514-4607-a50e-43188bed8f8a",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "content": "## Offer response system",
        "height": 608,
        "width": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -144
      ],
      "typeVersion": 1,
      "id": "cc1225c6-0c41-4f17-9b2e-c491f441722a",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "=Your loan request was approved!",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Loan Offer Accepted</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n    body { background-color: #f0ede8; font-family: 'DM Sans', sans-serif; padding: 40px 16px; color: #1a1a1a; }\n    .wrapper { max-width: 580px; margin: 0 auto; background: #ffffff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }\n\n    .header { background: #1a2e22; padding: 40px 48px 36px; position: relative; overflow: hidden; }\n    .header::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.04); }\n    .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 20px; }\n    .header h1 { font-family: 'DM Serif Display', serif; font-size: 32px; color: #ffffff; line-height: 1.2; font-weight: 400; }\n    .header h1 span { color: #8dbe9a; }\n\n    /* Checkmark badge */\n    .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(141,190,154,0.15); border: 1px solid rgba(141,190,154,0.3); border-radius: 20px; padding: 6px 14px; margin-bottom: 20px; }\n    .badge span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8dbe9a; }\n\n    .body { padding: 44px 48px; }\n    .greeting { font-size: 16px; color: #555; margin-bottom: 16px; line-height: 1.6; }\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n    .message { font-size: 15px; line-height: 1.75; color: #444; margin-bottom: 32px; }\n\n    .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; }\n\n    .summary-table { width: 100%; border-collapse: collapse; margin-bottom: 36px; }\n    .summary-table tr { border-bottom: 1px solid #f0f0f0; }\n    .summary-table tr:last-child { border-bottom: none; }\n    .summary-table td { padding: 13px 0; font-size: 14px; }\n    .summary-table td:first-child { color: #888; width: 55%; }\n    .summary-table td:last-child { color: #1a2e22; font-weight: 600; text-align: right; }\n\n    .next-steps { background: #f6f9f6; border-radius: 6px; padding: 24px 28px; margin-bottom: 32px; }\n    .next-steps p { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 14px; }\n    .step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }\n    .step:last-child { margin-bottom: 0; }\n    .step-num { width: 24px; height: 24px; min-width: 24px; background: #1a2e22; color: #fff; border-radius: 50%; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-top: 1px; }\n    .step-text { font-size: 14px; color: #555; line-height: 1.6; }\n    .step-text strong { color: #1a2e22; font-weight: 600; }\n\n    .divider { border: none; border-top: 1px solid #ebebeb; margin: 32px 0; }\n    .closing { font-size: 14px; color: #666; line-height: 1.7; }\n    .closing strong { display: block; color: #1a2e22; font-size: 15px; margin-top: 20px; font-weight: 600; }\n\n    .footer { background: #f6f9f6; padding: 24px 48px; border-top: 1px solid #e8ede8; }\n    .footer p { font-size: 12px; color: #999; line-height: 1.6; text-align: center; }\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n    <div class=\"header\">\n      <div class=\"badge\"><span>\u2713 &nbsp;Offer Accepted</span></div>\n      <div class=\"brand\">LoanDesk &mdash; Confirmation</div>\n      <h1>Welcome aboard,<br><span>{{ $json.name }}.</span></h1>\n    </div>\n\n    <div class=\"body\">\n      <p class=\"greeting\">Hello <strong>{{ $json.name }}</strong>,</p>\n      <p class=\"message\">\n        Congratulations! We have successfully received your acceptance of the loan offer. Your application is now being processed and our team will be in touch with the next steps shortly.\n      </p>\n\n      <div class=\"section-label\">Accepted Offer Summary</div>\n      <table class=\"summary-table\">\n        <tr><td>Reference</td><td>{{ $json.applicant_id }}</td></tr>\n        <tr><td>Loan Amount</td><td>{{ $json['total payable'] }}</td></tr>\n        <tr><td>Monthly Repayment</td><td>{{ $json.monthly_repayment }}</td></tr>\n        <tr><td>Interest Rate</td><td>{{ $json['interest rate'] }}% per month</td></tr>\n        <tr><td>Loan Term</td><td>{{ $json.loan_term_months }} months</td></tr>\n        <tr><td>Status</td><td>\u2705 Accepted</td></tr>\n      </table>\n\n      <div class=\"next-steps\">\n        <p>What happens next</p>\n        <div class=\"step\">\n          <div class=\"step-num\">1</div>\n          <div class=\"step-text\"><strong>Documentation</strong> \u2014 Our team will reach out requesting any required documents to finalise your loan.</div>\n        </div>\n        <div class=\"step\">\n          <div class=\"step-num\">2</div>\n          <div class=\"step-text\"><strong>Verification</strong> \u2014 Your details will be verified and the loan agreement prepared for signing.</div>\n        </div>\n        <div class=\"step\">\n          <div class=\"step-num\">3</div>\n          <div class=\"step-text\"><strong>Disbursement</strong> \u2014 Once complete, funds will be disbursed to your nominated account.</div>\n        </div>\n      </div>\n\n      <hr class=\"divider\" />\n      <div class=\"closing\">\n        If you have any questions in the meantime, simply reply to this email and our team will assist you promptly.\n        <strong>The LoanDesk Team</strong>\n      </div>\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        This confirmation relates to your loan application with LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1952,
        -48
      ],
      "id": "3d9d3eb2-2638-4c62-9194-b2dcc820eb7b",
      "name": "Send accepted acknowledment email",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "applicant_id",
              "lookupValue": "={{ $json.applicant_id }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1744,
        -48
      ],
      "id": "261ee273-a694-4c04-9b80-c063111d2b55",
      "name": "Find applicant",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "applicant_id",
              "lookupValue": "={{ $json.applicant_id }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1744,
        224
      ],
      "id": "756c2f6b-deaf-4c39-aa75-86fa9955b94d",
      "name": "Find applicant1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "=We've noted your decision.",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Loan Offer Declined</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n    body { background-color: #f0ede8; font-family: 'DM Sans', sans-serif; padding: 40px 16px; color: #1a1a1a; }\n    .wrapper { max-width: 580px; margin: 0 auto; background: #ffffff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }\n\n    .header { background: #2a2a2a; padding: 40px 48px 36px; position: relative; overflow: hidden; }\n    .header::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.03); }\n    .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #aaa; margin-bottom: 20px; }\n    .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 6px 14px; margin-bottom: 20px; }\n    .badge span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #bbb; }\n    .header h1 { font-family: 'DM Serif Display', serif; font-size: 32px; color: #ffffff; line-height: 1.2; font-weight: 400; }\n    .header h1 span { color: #d4d4d4; }\n\n    .body { padding: 44px 48px; }\n    .greeting { font-size: 16px; color: #555; margin-bottom: 16px; line-height: 1.6; }\n    .greeting strong { color: #1a1a1a; font-weight: 600; }\n    .message { font-size: 15px; line-height: 1.75; color: #444; margin-bottom: 32px; }\n\n    .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; }\n\n    .summary-card { background: #f9f9f9; border-radius: 6px; padding: 24px; margin-bottom: 32px; }\n    .summary-card table { width: 100%; border-collapse: collapse; }\n    .summary-card table tr { border-bottom: 1px solid #efefef; }\n    .summary-card table tr:last-child { border-bottom: none; }\n    .summary-card table td { padding: 11px 0; font-size: 14px; }\n    .summary-card table td:first-child { color: #888; width: 55%; }\n    .summary-card table td:last-child { color: #1a1a1a; font-weight: 600; text-align: right; }\n\n    .reapply-box { border: 1px solid #e8ede8; border-radius: 6px; padding: 24px 28px; margin-bottom: 32px; }\n    .reapply-box p { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 12px; }\n    .reapply-box ul { list-style: none; padding: 0; }\n    .reapply-box ul li { font-size: 14px; color: #555; line-height: 1.7; padding-left: 16px; position: relative; }\n    .reapply-box ul li::before { content: '\u2192'; position: absolute; left: 0; color: #8dbe9a; font-size: 12px; }\n\n    .divider { border: none; border-top: 1px solid #ebebeb; margin: 32px 0; }\n    .closing { font-size: 14px; color: #666; line-height: 1.7; }\n    .closing strong { display: block; color: #1a1a1a; font-size: 15px; margin-top: 20px; font-weight: 600; }\n\n    .footer { background: #f9f9f9; padding: 24px 48px; border-top: 1px solid #ebebeb; }\n    .footer p { font-size: 12px; color: #999; line-height: 1.6; text-align: center; }\n    .footer a { color: #1a1a1a; text-decoration: none; font-weight: 500; }\n\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n    <div class=\"header\">\n      <div class=\"badge\"><span>\u2715 &nbsp;Offer Declined</span></div>\n      <div class=\"brand\">LoanDesk &mdash; Confirmation</div>\n      <h1>We've noted your<br><span>decision.</span></h1>\n    </div>\n\n    <div class=\"body\">\n      <p class=\"greeting\">Hello <strong>{{ $json.name }}</strong>,</p>\n      <p class=\"message\">\n        We respect your decision and have officially closed this loan offer. No further action is required from you and you will not receive any more emails regarding this application.\n      </p>\n\n      <div class=\"section-label\">Closed Application Summary</div>\n      <div class=\"summary-card\">\n        <table>\n          <tr><td>Reference</td><td>{{ $json.applicant_id }}</td></tr>\n          <tr><td>Loan Amount Requested</td><td>\u20a6{{ $json['loan amount requested'] }}</td></tr>\n          <tr><td>Offer Total Payable</td><td>{{ $json.total_payable }}</td></tr>\n          <tr><td>Decision</td><td>\u2715 Declined</td></tr>\n          <tr><td>Status</td><td>Closed</td></tr>\n        </table>\n      </div>\n\n      <div class=\"reapply-box\">\n        <p>You can always come back</p>\n        <ul>\n          <li>This decision does not affect any future applications</li>\n          <li>You are welcome to reapply at any time</li>\n          <li>Our loan products and terms may change \u2014 check back for better offers</li>\n          <li>Feel free to contact us if you'd like to discuss other options</li>\n        </ul>\n      </div>\n\n      <hr class=\"divider\" />\n      <div class=\"closing\">\n        We appreciate you considering LoanDesk and hope to be of service to you in the future. If you declined by mistake or have changed your mind, please contact our support team immediately.\n        <strong>The LoanDesk Team</strong>\n      </div>\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        This email confirms your decision regarding your LoanDesk application.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1936,
        224
      ],
      "id": "cf6ddde0-001d-4e7e-94b2-cf6440210f4c",
      "name": "Send declined acknowledment email",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "applicant_id": "={{ $('Switch').item.json.applicant_id }}",
            "follow up count": "1",
            "name": "={{ $('Switch').item.json.name }}",
            "email": "={{ $('Switch').item.json.email }}",
            "phone": "={{ $('Switch').item.json.phone }}",
            "salary": "={{ $('Switch').item.json.salary }}",
            "loan amount requested": "={{ $('Switch').item.json['loan amount requested'] }}",
            "loan_term_months": "={{ $('Switch').item.json.loan_term_months }}",
            "reason for loan": "={{ $('Switch').item.json['reason for loan'] }}",
            "eligibility status": "={{ $('Switch').item.json['eligibility status'] }}",
            "interest rate": "={{ $('Switch').item.json['interest rate'] }}",
            "total payable": "={{ $('Switch').item.json['total payable'] }}",
            "monthly_repayment": "={{ $('Switch').item.json.monthly_repayment }}",
            "response status": "={{ $('Switch').item.json['response status'] }}",
            "loan request submitted at": "={{ $('Switch').item.json['loan request submitted at'] }}",
            "last follow up date": "={{ new Date().toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false }) }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "last follow up date",
              "displayName": "last follow up date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1072,
        864
      ],
      "id": "aa64c96d-5e98-4478-abba-db41f51267d7",
      "name": "update follow up count to 1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "applicant_id": "={{ $json.applicant_id }}",
            "response status": "accepted",
            "follow up count": "not required"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1312,
        -48
      ],
      "id": "9c0c7101-91c5-414c-abb7-a17f86f9bda1",
      "name": "update response status to accepted",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "applicant_id": "={{ $json.applicant_id }}",
            "response status": "accepted",
            "follow up count": "not required"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1328,
        224
      ],
      "id": "d0272a44-6d52-4917-8291-01f3fc78cd9c",
      "name": "updated offer response status to declined",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "follow up count": "2",
            "last follow up date": "={{ new Date().toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false }) }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "last follow up date",
              "displayName": "last follow up date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1280,
        1136
      ],
      "id": "7bb5c9bd-c84e-4c54-8c57-f774bc29c82e",
      "name": "update follow up count to 2 and end",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "Your loan offer is still waiting for you.",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Your Loan Offer is Still Open</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n    body { background-color: #f0ede8; font-family: 'DM Sans', sans-serif; padding: 40px 16px; color: #1a1a1a; }\n    .wrapper { max-width: 580px; margin: 0 auto; background: #ffffff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }\n\n    .header { background: #1a2e22; padding: 40px 48px 36px; position: relative; overflow: hidden; }\n    .header::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.04); }\n    .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 20px; }\n\n    /* Nudge badge */\n    .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,200,100,0.12); border: 1px solid rgba(255,200,100,0.25); border-radius: 20px; padding: 6px 14px; margin-bottom: 20px; }\n    .badge span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #f5c842; }\n\n    .header h1 { font-family: 'DM Serif Display', serif; font-size: 30px; color: #ffffff; line-height: 1.2; font-weight: 400; }\n    .header h1 span { color: #8dbe9a; }\n\n    .body { padding: 44px 48px; }\n    .greeting { font-size: 16px; color: #555; margin-bottom: 16px; line-height: 1.6; }\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n    .message { font-size: 15px; line-height: 1.75; color: #444; margin-bottom: 32px; }\n\n    .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; }\n\n    /* Offer recap */\n    .offer-recap { background: #f6f9f6; border-radius: 6px; padding: 24px; margin-bottom: 32px; }\n    .offer-recap table { width: 100%; border-collapse: collapse; }\n    .offer-recap table tr { border-bottom: 1px solid #eaf0ea; }\n    .offer-recap table tr:last-child { border-bottom: none; }\n    .offer-recap table td { padding: 12px 0; font-size: 14px; }\n    .offer-recap table td:first-child { color: #888; width: 55%; }\n    .offer-recap table td:last-child { color: #1a2e22; font-weight: 600; text-align: right; }\n\n    /* Expiry warning */\n    .expiry-warn { background: #fffbf0; border: 1px solid #f5c842; border-radius: 6px; padding: 16px 20px; margin-bottom: 32px; display: flex; gap: 12px; align-items: flex-start; }\n    .expiry-warn .icon { font-size: 18px; margin-top: 1px; }\n    .expiry-warn p { font-size: 14px; color: #7a6200; line-height: 1.6; }\n    .expiry-warn p strong { color: #5a4800; }\n\n    /* CTA */\n    .cta-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; text-align: center; }\n    .cta-wrap { display: flex; gap: 12px; margin-bottom: 12px; }\n    .btn { display: block; width: 100%; padding: 16px; border-radius: 4px; text-align: center; font-size: 15px; font-weight: 600; text-decoration: none; font-family: 'DM Sans', sans-serif; }\n    .btn-accept { background: #1a2e22; color: #ffffff; }\n    .btn-decline { background: #f6f6f6; color: #666; border: 1px solid #e0e0e0; }\n    .cta-note { font-size: 12px; color: #aaa; text-align: center; line-height: 1.6; margin-bottom: 32px; }\n\n    .divider { border: none; border-top: 1px solid #ebebeb; margin: 32px 0; }\n    .closing { font-size: 14px; color: #666; line-height: 1.7; }\n    .closing strong { display: block; color: #1a2e22; font-size: 15px; margin-top: 20px; font-weight: 600; }\n\n    .footer { background: #f6f9f6; padding: 24px 48px; border-top: 1px solid #e8ede8; }\n    .footer p { font-size: 12px; color: #999; line-height: 1.6; text-align: center; }\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n      .cta-wrap { flex-direction: column; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n    <div class=\"header\">\n      <div class=\"badge\"><span>\u23f3 &nbsp;Reminder \u2014 Action Required</span></div>\n      <div class=\"brand\">LoanDesk &mdash; Follow-up</div>\n      <h1>Your loan offer is<br>still <span>waiting for you.</span></h1>\n    </div>\n\n    <div class=\"body\">\n      <p class=\"greeting\">Hello <strong>{{ $json.name }}</strong>,</p>\n      <p class=\"message\">\n        We noticed you haven't responded to the loan offer we sent you. We wanted to follow up to make sure you didn't miss it \u2014 your personalised offer is still active and ready for your decision.\n      </p>\n\n      <div class=\"section-label\">Your Offer Recap</div>\n      <div class=\"offer-recap\">\n        <table>\n          <tr><td>Loan Amount Requested</td><td>\u20a6{{ $json['loan amount requested'] }}</td></tr>\n          <tr><td>Interest Rate</td><td>{{ $json['interest rate'] }} per month</td></tr>\n          <tr><td>Total Payable</td><td>{{ $json['total payable'] }}</td></tr>\n          <tr><td>Monthly Repayment</td><td>{{ $json.monthly_repayment }}</td></tr>\n          <tr><td>Reference</td><td>{{ $json.applicant_id }}</td></tr>\n        </table>\n      </div>\n\n      <div class=\"expiry-warn\">\n        <div class=\"icon\">\u26a0\ufe0f</div>\n        <p>This offer will <strong>expire soon</strong>. Once it expires you will need to reapply. Please respond as soon as possible to secure your loan.</p>\n      </div>\n\n      <div class=\"cta-wrap\">\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=accept\"class=\"btn btn-accept\">\u2705 Accept Offer</a>\n\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=decline\" class=\"btn btn-decline\">\u2715 Decline Offer</a>\n      </div>\n      <p class=\"cta-note\">No login required \u2014 simply click your choice above and we'll handle the rest.</p>\n\n      <hr class=\"divider\" />\n      <div class=\"closing\">\n        If you have any questions about the offer or need clarification before deciding, please reply to this email and our team will be happy to help.\n        <strong>The LoanDesk Team</strong>\n      </div>\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        You are receiving this because you have a pending loan offer with LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1056,
        1136
      ],
      "id": "c2bce5b9-ab5a-4794-9856-3b7da80e7cd5",
      "name": "send follow up again",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "105943f2-2253-40b9-bdd9-e07383ad8fac",
              "leftValue": "={{ $json['follow up count'] }}",
              "rightValue": "1",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "5cb45302-f94f-4283-91ef-ae40631a8d09",
              "leftValue": "={{ \n  (function() {\n    var parts = $json['last follow up date'].split(', ');\n    var dateParts = parts[0].split('/');\n    var timeParts = parts[1].split(':');\n    var d = new Date(dateParts[2], dateParts[1]-1, dateParts[0], timeParts[0], timeParts[1]);\n    return (Date.now() - d.getTime()) / (1000 * 60 * 60 * 24);\n  })()\n}}",
              "rightValue": 3,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        832,
        1152
      ],
      "id": "78bb8a14-4c73-48f9-b301-49f4d9e9a0b5",
      "name": "if follow up count is 1 and response status is \"no response\""
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 3
          },
          "conditions": [
            {
              "id": "105943f2-2253-40b9-bdd9-e07383ad8fac",
              "leftValue": "={{ \n  (function() {\n    var parts = $json['loan request submitted at'].split(', ');\n    var dateParts = parts[0].split('/');\n    var timeParts = parts[1].split(':');\n    var d = new Date(dateParts[2], dateParts[1]-1, dateParts[0], timeParts[0], timeParts[1]);\n    return (Date.now() - d.getTime()) / (1000 * 60 * 60 * 24);\n  })()\n}}",
              "rightValue": "=3",
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            },
            {
              "id": "8c29fac7-23be-4aa6-a501-34b7781c135d",
              "leftValue": "={{ $json['response status'] }}",
              "rightValue": "no response",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "fd316fd3-f6a5-4f3e-8a71-c8f2599ab6fd",
              "leftValue": "={{ $json['follow up count'] }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        640,
        992
      ],
      "id": "d19d2f88-6ab2-4c21-a2fd-d91f6173e612",
      "name": "if loan request was submitted >=3days"
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "Your loan offer is still waiting for you.",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Your Loan Offer is Still Open</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n    body { background-color: #f0ede8; font-family: 'DM Sans', sans-serif; padding: 40px 16px; color: #1a1a1a; }\n    .wrapper { max-width: 580px; margin: 0 auto; background: #ffffff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }\n\n    .header { background: #1a2e22; padding: 40px 48px 36px; position: relative; overflow: hidden; }\n    .header::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.04); }\n    .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 20px; }\n\n    /* Nudge badge */\n    .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,200,100,0.12); border: 1px solid rgba(255,200,100,0.25); border-radius: 20px; padding: 6px 14px; margin-bottom: 20px; }\n    .badge span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #f5c842; }\n\n    .header h1 { font-family: 'DM Serif Display', serif; font-size: 30px; color: #ffffff; line-height: 1.2; font-weight: 400; }\n    .header h1 span { color: #8dbe9a; }\n\n    .body { padding: 44px 48px; }\n    .greeting { font-size: 16px; color: #555; margin-bottom: 16px; line-height: 1.6; }\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n    .message { font-size: 15px; line-height: 1.75; color: #444; margin-bottom: 32px; }\n\n    .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; }\n\n    /* Offer recap */\n    .offer-recap { background: #f6f9f6; border-radius: 6px; padding: 24px; margin-bottom: 32px; }\n    .offer-recap table { width: 100%; border-collapse: collapse; }\n    .offer-recap table tr { border-bottom: 1px solid #eaf0ea; }\n    .offer-recap table tr:last-child { border-bottom: none; }\n    .offer-recap table td { padding: 12px 0; font-size: 14px; }\n    .offer-recap table td:first-child { color: #888; width: 55%; }\n    .offer-recap table td:last-child { color: #1a2e22; font-weight: 600; text-align: right; }\n\n    /* Expiry warning */\n    .expiry-warn { background: #fffbf0; border: 1px solid #f5c842; border-radius: 6px; padding: 16px 20px; margin-bottom: 32px; display: flex; gap: 12px; align-items: flex-start; }\n    .expiry-warn .icon { font-size: 18px; margin-top: 1px; }\n    .expiry-warn p { font-size: 14px; color: #7a6200; line-height: 1.6; }\n    .expiry-warn p strong { color: #5a4800; }\n\n    /* CTA */\n    .cta-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; text-align: center; }\n    .cta-wrap { display: flex; gap: 12px; margin-bottom: 12px; }\n    .btn { display: block; width: 100%; padding: 16px; border-radius: 4px; text-align: center; font-size: 15px; font-weight: 600; text-decoration: none; font-family: 'DM Sans', sans-serif; }\n    .btn-accept { background: #1a2e22; color: #ffffff; }\n    .btn-decline { background: #f6f6f6; color: #666; border: 1px solid #e0e0e0; }\n    .cta-note { font-size: 12px; color: #aaa; text-align: center; line-height: 1.6; margin-bottom: 32px; }\n\n    .divider { border: none; border-top: 1px solid #ebebeb; margin: 32px 0; }\n    .closing { font-size: 14px; color: #666; line-height: 1.7; }\n    .closing strong { display: block; color: #1a2e22; font-size: 15px; margin-top: 20px; font-weight: 600; }\n\n    .footer { background: #f6f9f6; padding: 24px 48px; border-top: 1px solid #e8ede8; }\n    .footer p { font-size: 12px; color: #999; line-height: 1.6; text-align: center; }\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n      .cta-wrap { flex-direction: column; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n    <div class=\"header\">\n      <div class=\"badge\"><span>\u23f3 &nbsp;Reminder \u2014 Action Required</span></div>\n      <div class=\"brand\">LoanDesk &mdash; Follow-up</div>\n      <h1>Your loan offer is<br>still <span>waiting for you.</span></h1>\n    </div>\n\n    <div class=\"body\">\n      <p class=\"greeting\">Hello <strong>{{ $json.name }}</strong>,</p>\n      <p class=\"message\">\n        We noticed you haven't responded to the loan offer we sent you. We wanted to follow up to make sure you didn't miss it \u2014 your personalised offer is still active and ready for your decision.\n      </p>\n\n      <div class=\"section-label\">Your Offer Recap</div>\n      <div class=\"offer-recap\">\n        <table>\n          <tr><td>Loan Amount Requested</td><td>\u20a6{{ $json['loan amount requested'] }}</td></tr>\n          <tr><td>Interest Rate</td><td>{{ $json['interest rate'] }} per month</td></tr>\n          <tr><td>Total Payable</td><td>{{ $json['total payable'] }}</td></tr>\n          <tr><td>Monthly Repayment</td><td>{{ $json.monthly_repayment }}</td></tr>\n          <tr><td>Reference</td><td>{{ $json.applicant_id }}</td></tr>\n        </table>\n      </div>\n\n      <div class=\"expiry-warn\">\n        <div class=\"icon\">\u26a0\ufe0f</div>\n        <p>This offer will <strong>expire soon</strong>. Once it expires you will need to reapply. Please respond as soon as possible to secure your loan.</p>\n      </div>\n\n      <div class=\"cta-wrap\">\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=accept\"class=\"btn btn-accept\">\u2705 Accept Offer</a>\n\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=decline\" class=\"btn btn-decline\">\u2715 Decline Offer</a>\n      </div>\n      <p class=\"cta-note\">No login required \u2014 simply click your choice above and we'll handle the rest.</p>\n\n      <hr class=\"divider\" />\n      <div class=\"closing\">\n        If you have any questions about the offer or need clarification before deciding, please reply to this email and our team will be happy to help.\n        <strong>The LoanDesk Team</strong>\n      </div>\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        You are receiving this because you have a pending loan offer with LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        912,
        1312
      ],
      "id": "59356ca7-68e1-493f-84f4-936cb107569b",
      "name": "Follow up with >500 to 1mil1",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "applicant_id": "={{ $('Switch').item.json.applicant_id }}",
            "follow up count": "1",
            "name": "={{ $('Switch').item.json.name }}",
            "email": "={{ $('Switch').item.json.email }}",
            "phone": "={{ $('Switch').item.json.phone }}",
            "salary": "={{ $('Switch').item.json.salary }}",
            "loan amount requested": "={{ $('Switch').item.json['loan amount requested'] }}",
            "loan_term_months": "={{ $('Switch').item.json.loan_term_months }}",
            "reason for loan": "={{ $('Switch').item.json['reason for loan'] }}",
            "eligibility status": "={{ $('Switch').item.json['eligibility status'] }}",
            "interest rate": "={{ $('Switch').item.json['interest rate'] }}",
            "total payable": "={{ $('Switch').item.json['total payable'] }}",
            "monthly_repayment": "={{ $('Switch').item.json.monthly_repayment }}",
            "response status": "={{ $('Switch').item.json['response status'] }}",
            "loan request submitted at": "={{ $('Switch').item.json['loan request submitted at'] }}",
            "last follow up date": "={{ new Date().toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false }) }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "last follow up date",
              "displayName": "last follow up date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1136,
        1312
      ],
      "id": "af1a49f1-6cd7-4365-87e8-4124b99923c5",
      "name": "update follow up count to ",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SHEET_ID_HERE",
          "mode": "list",
          "cachedResultName": "n8n_practice",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_TAB_ID",
          "mode": "list",
          "cachedResultName": "Loan eligibility",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=792244757"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "follow up count": "2",
            "last follow up date": "={{ new Date().toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false }) }}"
          },
          "matchingColumns": [
            "applicant_id"
          ],
          "schema": [
            {
              "id": "applicant_id",
              "displayName": "applicant_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "phone",
              "displayName": "phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "salary",
              "displayName": "salary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan request submitted at",
              "displayName": "loan request submitted at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan amount requested",
              "displayName": "loan amount requested",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "loan_term_months",
              "displayName": "loan_term_months",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "reason for loan",
              "displayName": "reason for loan",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "eligibility status",
              "displayName": "eligibility status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "interest rate",
              "displayName": "interest rate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "total payable",
              "displayName": "total payable",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "monthly_repayment",
              "displayName": "monthly_repayment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "response status",
              "displayName": "response status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "last follow up date",
              "displayName": "last follow up date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow up count",
              "displayName": "follow up count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1344,
        1568
      ],
      "id": "1dc9bca0-bf9f-402c-9983-8432c97e3a7f",
      "name": "update follow up count to 2 and end1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "Your loan offer is still waiting for you.",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <title>Your Loan Offer is Still Open</title>\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');\n    * { margin: 0; padding: 0; box-sizing: border-box; }\n    body { background-color: #f0ede8; font-family: 'DM Sans', sans-serif; padding: 40px 16px; color: #1a1a1a; }\n    .wrapper { max-width: 580px; margin: 0 auto; background: #ffffff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }\n\n    .header { background: #1a2e22; padding: 40px 48px 36px; position: relative; overflow: hidden; }\n    .header::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.04); }\n    .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #8dbe9a; margin-bottom: 20px; }\n\n    /* Nudge badge */\n    .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,200,100,0.12); border: 1px solid rgba(255,200,100,0.25); border-radius: 20px; padding: 6px 14px; margin-bottom: 20px; }\n    .badge span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #f5c842; }\n\n    .header h1 { font-family: 'DM Serif Display', serif; font-size: 30px; color: #ffffff; line-height: 1.2; font-weight: 400; }\n    .header h1 span { color: #8dbe9a; }\n\n    .body { padding: 44px 48px; }\n    .greeting { font-size: 16px; color: #555; margin-bottom: 16px; line-height: 1.6; }\n    .greeting strong { color: #1a2e22; font-weight: 600; }\n    .message { font-size: 15px; line-height: 1.75; color: #444; margin-bottom: 32px; }\n\n    .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; }\n\n    /* Offer recap */\n    .offer-recap { background: #f6f9f6; border-radius: 6px; padding: 24px; margin-bottom: 32px; }\n    .offer-recap table { width: 100%; border-collapse: collapse; }\n    .offer-recap table tr { border-bottom: 1px solid #eaf0ea; }\n    .offer-recap table tr:last-child { border-bottom: none; }\n    .offer-recap table td { padding: 12px 0; font-size: 14px; }\n    .offer-recap table td:first-child { color: #888; width: 55%; }\n    .offer-recap table td:last-child { color: #1a2e22; font-weight: 600; text-align: right; }\n\n    /* Expiry warning */\n    .expiry-warn { background: #fffbf0; border: 1px solid #f5c842; border-radius: 6px; padding: 16px 20px; margin-bottom: 32px; display: flex; gap: 12px; align-items: flex-start; }\n    .expiry-warn .icon { font-size: 18px; margin-top: 1px; }\n    .expiry-warn p { font-size: 14px; color: #7a6200; line-height: 1.6; }\n    .expiry-warn p strong { color: #5a4800; }\n\n    /* CTA */\n    .cta-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #999; margin-bottom: 16px; text-align: center; }\n    .cta-wrap { display: flex; gap: 12px; margin-bottom: 12px; }\n    .btn { display: block; width: 100%; padding: 16px; border-radius: 4px; text-align: center; font-size: 15px; font-weight: 600; text-decoration: none; font-family: 'DM Sans', sans-serif; }\n    .btn-accept { background: #1a2e22; color: #ffffff; }\n    .btn-decline { background: #f6f6f6; color: #666; border: 1px solid #e0e0e0; }\n    .cta-note { font-size: 12px; color: #aaa; text-align: center; line-height: 1.6; margin-bottom: 32px; }\n\n    .divider { border: none; border-top: 1px solid #ebebeb; margin: 32px 0; }\n    .closing { font-size: 14px; color: #666; line-height: 1.7; }\n    .closing strong { display: block; color: #1a2e22; font-size: 15px; margin-top: 20px; font-weight: 600; }\n\n    .footer { background: #f6f9f6; padding: 24px 48px; border-top: 1px solid #e8ede8; }\n    .footer p { font-size: 12px; color: #999; line-height: 1.6; text-align: center; }\n    .footer a { color: #1a2e22; text-decoration: none; font-weight: 500; }\n\n    @media (max-width: 480px) {\n      .header, .body { padding: 32px 28px; }\n      .footer { padding: 20px 28px; }\n      .header h1 { font-size: 26px; }\n      .cta-wrap { flex-direction: column; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"wrapper\">\n    <div class=\"header\">\n      <div class=\"badge\"><span>\u23f3 &nbsp;Reminder \u2014 Action Required</span></div>\n      <div class=\"brand\">LoanDesk &mdash; Follow-up</div>\n      <h1>Your loan offer is<br>still <span>waiting for you.</span></h1>\n    </div>\n\n    <div class=\"body\">\n      <p class=\"greeting\">Hello <strong>{{ $json.name }}</strong>,</p>\n      <p class=\"message\">\n        We noticed you haven't responded to the loan offer we sent you. We wanted to follow up to make sure you didn't miss it \u2014 your personalised offer is still active and ready for your decision.\n      </p>\n\n      <div class=\"section-label\">Your Offer Recap</div>\n      <div class=\"offer-recap\">\n        <table>\n          <tr><td>Loan Amount Requested</td><td>\u20a6{{ $json['loan amount requested'] }}</td></tr>\n          <tr><td>Interest Rate</td><td>{{ $json['interest rate'] }} per month</td></tr>\n          <tr><td>Total Payable</td><td>{{ $json['total payable'] }}</td></tr>\n          <tr><td>Monthly Repayment</td><td>{{ $json.monthly_repayment }}</td></tr>\n          <tr><td>Reference</td><td>{{ $json.applicant_id }}</td></tr>\n        </table>\n      </div>\n\n      <div class=\"expiry-warn\">\n        <div class=\"icon\">\u26a0\ufe0f</div>\n        <p>This offer will <strong>expire soon</strong>. Once it expires you will need to reapply. Please respond as soon as possible to secure your loan.</p>\n      </div>\n\n      <div class=\"cta-wrap\">\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=accept\"class=\"btn btn-accept\">\u2705 Accept Offer</a>\n\n        <a href=\"https://your-n8n-instance.app.n8n.cloud/webhook-test/YOUR_WEBHOOK_ID?applicant_id={{ $json.applicant_id }}&response=decline\" class=\"btn btn-decline\">\u2715 Decline Offer</a>\n      </div>\n      <p class=\"cta-note\">No login required \u2014 simply click your choice above and we'll handle the rest.</p>\n\n      <hr class=\"divider\" />\n      <div class=\"closing\">\n        If you have any questions about the offer or need clarification before deciding, please reply to this email and our team will be happy to help.\n        <strong>The LoanDesk Team</strong>\n      </div>\n    </div>\n\n    <div class=\"footer\">\n      <p>\n        You are receiving this because you have a pending loan offer with LoanDesk.<br>\n        Ref: {{ $json.applicant_id }} &nbsp;|&nbsp; <a href=\"#\">Contact Support</a><br><br>\n        &copy; 2026 LoanDesk. All rights reserved.\n      </p>\n    </div>\n  </div>\n</body>\n</html>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1152,
        1568
      ],
      "id": "4379a2cf-3430-498f-a7df-7fe38344cf40",
      "name": "send follow up again1",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "105943f2-2253-40b9-bdd9-e07383ad8fac",
              "leftValue": "={{ $json['follow up count'] }}",
              "rightValue": "1",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "5cb45302-f94f-4283-91ef-ae40631a8d09",
              "leftValue": "={{ \n  (function() {\n    var parts = $json['last follow up date'].split(', ');\n    var dateParts = parts[0].split('/');\n    var timeParts = parts[1].split(':');\n    var d = new Date(dateParts[2], dateParts[1]-1, dateParts[0], timeParts[0], timeParts[1]);\n    return (Date.now() - d.getTime()) / (1000 * 60 * 60 * 24);\n  })()\n}}",
              "rightValue": 3,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        928,
        1584
      ],
      "id": "1e753a1f-0690-4e83-a369-4eb1bd211574",
      "name": "if follow up count is 1 and response status is \"no response\"1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 3
          },
          "conditions": [
            {
              "id": "105943f2-2253-40b9-bdd9-e07383ad8fac",
              "leftValue": "={{ \n  (function() {\n    var parts = $json['loan request submitted at'].split(', ');\n    var dateParts = parts[0].split('/');\n    var timeParts = parts[1].split(':');\n    var d = new Date(dateParts[2], dateParts[1]-1, dateParts[0], timeParts[0], timeParts[1]);\n    return (Date.now() - d.getTime()) / (1000 * 60 * 60 * 24);\n  })()\n}}",
              "rightValue": "=3",
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            },
            {
              "id": "8c29fac7-23be-4aa6-a501-34b7781c135d",
              "leftValue": "={{ $json['response status'] }}",
              "rightValue": "no response",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "fd316fd3-f6a5-4f3e-8a71-c8f2599ab6fd",
              "leftValue": "={{ $json['follow up count'] }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        704,
        1440
      ],
      "id": "0f4f6d90-bb17-4ecc-8f18-2d4f0403bcff",
      "name": "if loan request was submitted >=3days1"
    },
    {
      "parameters": {
        "content": "# Follow up  system",
        "height": 512,
        "width": 1104
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        960
      ],
      "typeVersion": 1,
      "id": "fa2ab009-61e4-4438-9c51-2f2cfb735638",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "content": "# Follow up for the first time",
        "height": 272,
        "width": 656
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        768
      ],
      "typeVersion": 1,
      "id": "1c14439b-850b-4942-9273-c1f511674b97",
      "name": "Sticky Note10"
    },
    {
      "parameters": {
        "content": "# Follow up 2",
        "height": 224,
        "width": 656
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        1072
      ],
      "typeVersion": 1,
      "id": "fadf4d89-7e74-4e3b-b38d-c08306ce5513",
      "name": "Sticky Note11"
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Concatenate name and give applicant ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Concatenate name and give applicant ID": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Send welcome email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send welcome email": {
      "main": [
        [
          {
            "node": "Check eligibility based on salary range",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check eligibility based on salary range": {
      "main": [
        [
          {
            "node": "Send rejection mail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Preserve loan details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preserve loan details": {
      "main": [
        [
          {
            "node": "seperate eligibility range",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "seperate eligibility range": {
      "main": [
        [
          {
            "node": "Calculate interest for \u2060> 500k to 1 million",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Calculate interest for \u2060\"> 1 million",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate interest for \u2060> 500k to 1 million": {
      "main": [
        [
          {
            "node": "update info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate interest for \u2060\"> 1 million": {
      "main": [
        [
          {
            "node": "Update sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send rejection mail": {
      "main": [
        [
          {
            "node": "Update status to ineligible",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sheet": {
      "main": [
        [
          {
            "node": "Send offer email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update info": {
      "main": [
        [
          {
            "node": "Send loan offer email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Check for who hasn't responded",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for who hasn't responded": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "if loan request was submitted >=3days",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "if loan request was submitted >=3days1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Follow up with >500 to 1mil": {
      "main": [
        [
          {
            "node": "update follow up count to 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If loan offer was accepted": {
      "main": [
        [
          {
            "node": "Get accepted response and applicant ID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get declined response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get loan offer response": {
      "main": [
        [
          {
            "node": "If loan offer was accepted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get declined response": {
      "main": [
        [
          {
            "node": "updated offer response status to declined",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get accepted response and applicant ID": {
      "main": [
        [
          {
            "node": "update response status to accepted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "offer accepted response": {
      "main": [
        [
          {
            "node": "Find applicant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "offer declined response": {
      "main": [
        [
          {
            "node": "Find applicant1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find applicant": {
      "main": [
        [
          {
            "node": "Send accepted acknowledment email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find applicant1": {
      "main": [
        [
          {
            "node": "Send declined acknowledment email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update follow up count to 1": {
      "main": [
        []
      ]
    },
    "update response status to accepted": {
      "main": [
        [
          {
            "node": "offer accepted response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "updated offer response status to declined": {
      "main": [
        [
          {
            "node": "offer declined response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "send follow up again": {
      "main": [
        [
          {
            "node": "update follow up count to 2 and end",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if follow up count is 1 and response status is \"no response\"": {
      "main": [
        [
          {
            "node": "send follow up again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if loan request was submitted >=3days": {
      "main": [
        [
          {
            "node": "Follow up with >500 to 1mil",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "if follow up count is 1 and response status is \"no response\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Follow up with >500 to 1mil1": {
      "main": [
        [
          {
            "node": "update follow up count to ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "send follow up again1": {
      "main": [
        [
          {
            "node": "update follow up count to 2 and end1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if follow up count is 1 and response status is \"no response\"1": {
      "main": [
        [
          {
            "node": "send follow up again1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if loan request was submitted >=3days1": {
      "main": [
        [
          {
            "node": "Follow up with >500 to 1mil1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "if follow up count is 1 and response status is \"no response\"1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "YOUR_VERSION_ID",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "YOUR_WORKFLOW_ID",
  "tags": []
}