8
n8n 中文网amn8n.com

使用 Jotform、GPT-4 分析和 Gmail 通知自动化贷款预审批

高级

这是一个自动化工作流,包含 21 个节点。主要使用 If, Set, Code, Gmail, GoogleSheets 等节点。 使用 Jotform、GPT-4 分析和 Gmail 通知自动化贷款预审批

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "277842713620d9f5554de3b1518b865a152c8c4db680008bd8aec536fc18b4a8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "dcd9d4c8-a065-46c1-974f-d3a8042ed8bd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -96
      ],
      "parameters": {
        "color": 4,
        "width": 360,
        "height": 632,
        "content": "## 🏦 贷款申请系统"
      },
      "typeVersion": 1
    },
    {
      "id": "64ff6562-d154-4b39-afd7-b6232a2e02f3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -128
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 624,
        "content": "## 📝 表单字段"
      },
      "typeVersion": 1
    },
    {
      "id": "d106adca-3600-4df9-8057-bf70a4c652ae",
      "name": "提取申请数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -16,
        288
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "bad60885-2792-4f80-b545-5938e44fa5c7",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -96
      ],
      "parameters": {
        "color": 6,
        "width": 484,
        "height": 552,
        "content": "## 🤖 AI 财务分析"
      },
      "typeVersion": 1
    },
    {
      "id": "5d01d4bc-2940-496a-adb1-7fc33fbe5650",
      "name": "AI 财务分析",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        160,
        240
      ],
      "parameters": {
        "text": "=Analyze this loan application:\n\nApplicant: {{ $json['Customer name'] }}\nMonthly Income: {{ $json['Monthly Income'] }}\nMonthly Debts: {{ $json['Current debts'] }}\nLoan Amount: {{ $json['Loan Amount Requested'] }}\nDown Payment: {{ $json.Downpayment }}\nProperty Value: {{ $json['Property Value'] }}\nEmployment: {{ $json['Employment Status'] }}\n\nReturn JSON:\n{\n\"debtToIncomeRatio\": 0.35,\n\"loanToValueRatio\": 0.80,\n\"approvalLikelihood\": \"high/medium/low\",\n\"riskScore\": 1-100,\n\"recommendedStatus\": \"pre-approved/conditional/denied\",\n\"monthlyPaymentEstimate\": 2500,\n\"requiredDocuments\": [\"paystubs\", \"tax returns\"],\n\"conditionsForApproval\": [\"condition1\"],\n\"reasoningNotes\": \"explanation\",\n\"interestRateRange\": \"3.5-4.0%\"\n}",
        "agent": "conversationalAgent",
        "options": {
          "systemMessage": "You are a mortgage underwriting AI. Analyze loan applications objectively based on standard lending criteria."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "0c50a9a5-658e-4265-859b-ed6aea84e1a4",
      "name": "解析 AI 分析",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        240
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "Analysis",
              "stringValue": "={{ $json.output }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "4f990f13-dca5-49f7-b7dd-9bc1c5b8ae88",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -80
      ],
      "parameters": {
        "color": 2,
        "width": 320,
        "height": 632,
        "content": "## 💳 信用检查"
      },
      "typeVersion": 1
    },
    {
      "id": "7e1f7975-da4b-42a6-a276-bb4f0b7e0f91",
      "name": "模拟信用检查",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        256
      ],
      "parameters": {
        "jsCode": "const income = $('Extract Application Data').first().json.monthlyIncome;\nconst debts = $('Extract Application Data').first().json.monthlyDebts;\nconst dti = $('Parse AI Analysis').first().json.debtToIncomeRatio;\n\nlet creditScore = 720;\nif (dti < 0.30 && income > 8000) creditScore = 760;\nelse if (dti > 0.43 || income < 4000) creditScore = 650;\n\nconst creditData = {\n  creditScore: creditScore,\n  paymentHistory: creditScore > 700 ? 'excellent' : creditScore > 650 ? 'good' : 'fair',\n  creditUtilization: creditScore > 700 ? 25 : 45,\n  recentInquiries: creditScore > 700 ? 1 : 3,\n  creditCheckDate: new Date().toISOString(),\n  ...$('Parse AI Analysis').first().json,\n  ...$('Extract Application Data').first().json\n};\n\nreturn [{ json: creditData }];"
      },
      "typeVersion": 2
    },
    {
      "id": "a0554431-c558-4a3b-9200-15edf155858d",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -80
      ],
      "parameters": {
        "color": 7,
        "height": 472,
        "content": "## 🎯 批准决策"
      },
      "typeVersion": 1
    },
    {
      "id": "a73df01e-588e-4428-99f9-f15640c02aec",
      "name": "检查批准状态",
      "type": "n8n-nodes-base.if",
      "position": [
        1056,
        288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c1",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.recommendedStatus }}",
              "rightValue": "pre-approved"
            },
            {
              "id": "c2",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.creditScore }}",
              "rightValue": 680
            },
            {
              "id": "c3",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.debtToIncomeRatio }}",
              "rightValue": 0.43
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ab117b82-a32d-40a9-8b13-2a975b5d795a",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        -112
      ],
      "parameters": {
        "color": 3,
        "width": 300,
        "height": 468,
        "content": "## ✅ 预批准路径"
      },
      "typeVersion": 1
    },
    {
      "id": "c0f70116-85b3-454a-91f8-7619e980cebb",
      "name": "发送预批准函",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1328,
        128
      ],
      "webhookId": "eea286dd-ea39-4c4c-94fb-2bac6ff431d5",
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "message": "=<div style='font-family: Arial; max-width: 650px; margin: 0 auto;'>\n<div style='background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; padding: 40px; text-align: center;'>\n<h1 style='margin: 0;'>Congratulations!</h1>\n<p style='margin: 10px 0 0 0; font-size: 18px;'>You are Pre-Approved</p>\n</div>\n<div style='padding: 30px;'>\n<p>Dear {{ $json.applicantName }},</p>\n<p>Great news! Your loan application has been pre-approved.</p>\n<div style='background: #d4edda; padding: 20px; margin: 20px 0; border-radius: 8px; border-left: 4px solid #28a745;'>\n<h3 style='margin-top: 0; color: #155724;'>Loan Details</h3>\n<p style='margin: 5px 0;'><strong>Loan Amount:</strong> ${{ $json.loanAmount.toLocaleString() }}</p>\n<p style='margin: 5px 0;'><strong>Estimated Monthly Payment:</strong> ${{ $json.monthlyPaymentEstimate.toLocaleString() }}</p>\n<p style='margin: 5px 0;'><strong>Interest Rate Range:</strong> {{ $json.interestRateRange }}</p>\n<p style='margin: 5px 0;'><strong>Debt-to-Income Ratio:</strong> {{ ($json.debtToIncomeRatio * 100).toFixed(1) }}%</p>\n</div>\n<div style='background: #fff3cd; padding: 20px; margin: 20px 0; border-radius: 8px;'>\n<h3 style='margin-top: 0; color: #856404;'>Required Documents</h3>\n<ul style='color: #856404;'>\n<li>Last 2 months paystubs</li>\n<li>Last 2 years tax returns</li>\n<li>Bank statements (60 days)</li>\n<li>Photo ID</li>\n<li>Proof of down payment</li>\n</ul>\n</div>\n<p><strong>Next Steps:</strong></p>\n<ol>\n<li>Upload required documents within 5 business days</li>\n<li>Complete property appraisal</li>\n<li>Final underwriter review</li>\n<li>Schedule closing date</li>\n</ol>\n<p>Application ID: {{ $json.submissionId }}</p>\n<p>Questions? Call us at (555) 123-4567</p>\n</div>\n</div>",
        "options": {},
        "subject": "=Pre-Approval: Congratulations {{ $json.applicantName.split(' ')[0] }}!"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2f7eb615-f4f9-4157-8d64-6d4063517506",
      "name": "通知承销商",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1328,
        256
      ],
      "webhookId": "b76cebb3-e3b8-4673-b51e-a7c0dbb1a1c2",
      "parameters": {
        "sendTo": "underwriter@company.com",
        "message": "=<div style='font-family: Arial;'>\n<h2>New Pre-Approved Loan Application</h2>\n<p><strong>Applicant:</strong> {{ $json.applicantName }}</p>\n<p><strong>Loan Amount:</strong> ${{ $json.loanAmount.toLocaleString() }}</p>\n<p><strong>Credit Score:</strong> {{ $json.creditScore }}</p>\n<p><strong>DTI Ratio:</strong> {{ ($json.debtToIncomeRatio * 100).toFixed(1) }}%</p>\n<p><strong>LTV Ratio:</strong> {{ ($json.loanToValueRatio * 100).toFixed(1) }}%</p>\n<p><strong>Risk Score:</strong> {{ $json.riskScore }}/100</p>\n<p><strong>Employment:</strong> {{ $json.employmentStatus }}</p>\n<p>Please review for final approval.</p>\n</div>",
        "options": {},
        "subject": "=New Pre-Approved Application: {{ $json.applicantName }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "681e4be6-fb63-41ae-ac9d-9ef6530b22b2",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        400
      ],
      "parameters": {
        "width": 300,
        "height": 420,
        "content": "## ⚠️ 条件性/拒绝路径"
      },
      "typeVersion": 1
    },
    {
      "id": "b789aa66-b4da-4e61-8359-b3bb72a8ce76",
      "name": "检查是否为条件性",
      "type": "n8n-nodes-base.if",
      "position": [
        1360,
        656
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "caseSensitive": true
          },
          "conditions": [
            {
              "id": "c4",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.recommendedStatus }}",
              "rightValue": "conditional"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e05e0a09-5dca-4b45-96ff-859ec77e5bbe",
      "name": "发送条件性信函",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1712,
        528
      ],
      "webhookId": "9aa1e6c0-79ea-446c-ae6d-eea96010a27e",
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "message": "=<div style='font-family: Arial; max-width: 650px; margin: 0 auto;'>\n<div style='background: #ffc107; color: #333; padding: 40px; text-align: center;'>\n<h1 style='margin: 0;'>Conditional Approval</h1>\n</div>\n<div style='padding: 30px;'>\n<p>Dear {{ $json.applicantName }},</p>\n<p>Your loan application is conditionally approved pending the following requirements:</p>\n<div style='background: #fff3cd; padding: 20px; margin: 20px 0; border-radius: 8px;'>\n<h3 style='color: #856404;'>Required Actions</h3>\n<ul>\n<li>{{ $json.conditionsForApproval[0] }}</li>\n</ul>\n</div>\n<p>Please address these items within 10 business days.</p>\n<p>Application ID: {{ $json.submissionId }}</p>\n</div>\n</div>",
        "options": {},
        "subject": "=Conditional Approval: Action Required"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "3bc859db-ab7c-4877-8f41-6b4429d3f918",
      "name": "发送拒绝函",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1696,
        704
      ],
      "webhookId": "407cbcab-dda3-40a5-bb1c-13dd2f0f10c3",
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "message": "=<div style='font-family: Arial; max-width: 650px; margin: 0 auto;'>\n<div style='background: #dc3545; color: white; padding: 40px; text-align: center;'>\n<h1 style='margin: 0;'>Application Update</h1>\n</div>\n<div style='padding: 30px;'>\n<p>Dear {{ $json.applicantName }},</p>\n<p>After careful review, we are unable to approve your loan application at this time.</p>\n<p><strong>Reason:</strong> {{ $json.reasoningNotes }}</p>\n<div style='background: #d1ecf1; padding: 20px; margin: 20px 0; border-radius: 8px;'>\n<h3 style='color: #0c5460;'>Alternative Options</h3>\n<p>We recommend:</p>\n<ul>\n<li>Reduce existing debt to improve DTI ratio</li>\n<li>Increase down payment amount</li>\n<li>Consider co-borrower</li>\n<li>Reapply in 6 months after improving credit</li>\n</ul>\n</div>\n<p>Questions? Call (555) 123-4567</p>\n</div>\n</div>",
        "options": {},
        "subject": "=Loan Application Status Update"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "0b2c638e-1677-4e31-b99c-6f18a0c003e2",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        -48
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 536,
        "content": "## 📊 申请跟踪"
      },
      "typeVersion": 1
    },
    {
      "id": "c33156be-0706-4e32-9cd5-3c5957fc8b8a",
      "name": "记录申请",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1792,
        176
      ],
      "parameters": {
        "columns": {
          "value": {
            "email": "={{ $json.email }}",
            "phone": "={{ $json.phone }}",
            "dtiRatio": "={{ $json.debtToIncomeRatio }}",
            "ltvRatio": "={{ $json.loanToValueRatio }}",
            "riskScore": "={{ $json.riskScore }}",
            "timestamp": "={{ $json.submittedAt }}",
            "loanAmount": "={{ $json.loanAmount }}",
            "creditScore": "={{ $json.creditScore }}",
            "downPayment": "={{ $json.downPayment }}",
            "interestRate": "={{ $json.interestRateRange }}",
            "monthlyDebts": "={{ $json.monthlyDebts }}",
            "applicantName": "={{ $json.applicantName }}",
            "applicationId": "={{ $json.submissionId }}",
            "monthlyIncome": "={{ $json.monthlyIncome }}",
            "approvalStatus": "={{ $json.recommendedStatus }}",
            "monthlyPayment": "={{ $json.monthlyPaymentEstimate }}"
          },
          "mappingMode": "defineBelow"
        },
        "options": {
          "useAppend": true,
          "cellFormat": "USER_ENTERED"
        },
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Loan_Applications"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Kz2DdSp11rxqwlFt",
          "name": "Google Sheets account - Deepanshi"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "7adf0d8f-09ad-4872-9263-c9c540f5782e",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        432
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8IkhtT3EbXygnvcr",
          "name": "Klinsman OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fdf2f8e2-7dde-4bf3-b894-18d22b6ba321",
      "name": "Jotform 触发器",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -208,
        288
      ],
      "webhookId": "13b81a5e-3cb0-4d7d-8c29-6a34bee984f4",
      "parameters": {
        "form": "252894100907054"
      },
      "credentials": {
        "jotFormApi": {
          "id": "W7O1b225FpOwkwDT",
          "name": "Jotform account-Deepanshi"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Jotform Trigger": [
      {
        "DOB": "",
        "Email": "deepanshi@mediajade.com",
        "Address": {
          "city": "Hisar",
          "state": "Haryana",
          "postal": "125001",
          "addr_line1": "41, Aggarsein colony",
          "addr_line2": ""
        },
        "Downpayment": "",
        "Phone Number": {
          "full": "(070) 249-3591"
        },
        "Current debts": "0",
        "Customer name": "Deepanshi Singhal",
        "Monthly Income": "",
        "Property Value": "",
        "Employment Status": "",
        "Loan Amount Requested": ""
      }
    ]
  },
  "connections": {
    "Jotform Trigger": {
      "main": [
        [
          {
            "node": "Extract Application Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Financial Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Analysis": {
      "main": [
        [
          {
            "node": "Simulate Credit Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Conditional": {
      "main": [
        [
          {
            "node": "Send Conditional Letter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Denial Letter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Financial Analysis": {
      "main": [
        [
          {
            "node": "Parse AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Approval Status": {
      "main": [
        [
          {
            "node": "Send Pre-Approval Letter",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Underwriter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check If Conditional",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simulate Credit Check": {
      "main": [
        [
          {
            "node": "Check Approval Status",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Application",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Application Data": {
      "main": [
        [
          {
            "node": "AI Financial Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量21
分类-
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Jitesh Dugar

Jitesh Dugar

@jiteshdugar

AI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.

外部链接
在 n8n.io 查看

分享此工作流