Quick overview
This workflow receives loan applications via webhook, uses Anthropic Claude to verify document text and generate an underwriting recommendation, calculates an explainable risk score in code, logs each application to Google Sheets, and sends decision emails through SendGrid before returning a JSON response.
How it works
- Receives a loan application via a POST webhook, including applicant details and extracted text from ID, income proof, and bank statement documents.
- Uses Anthropic Claude to extract key fields from the documents and cross-checks them against the applicant’s declared name, employer, and income to produce a verification score and inconsistency list.
- Stops early and returns a “Documents Insufficient” webhook response when the verification score is below the threshold.
- Calculates verified income, estimated monthly installment, debt-to-income and loan-to-income ratios, and a weighted 0–100 risk score and tier from credit score, ratios, employment tenure, bank health, and document consistency.
- Waits briefly, then uses Anthropic Claude to generate an eligibility recommendation (Approve, Conditional Approval, Manual Review, or Decline) with reasoning, conditions, suggested loan amount, and confidence.
- Formats the final decision record and appends a tracking row to a Google Sheets LoanApplications tab.
- Sends an approval email to the applicant for Approve/Conditional Approval, or emails the underwriting team and a status update to the applicant for Manual Review/Decline, and responds to the webhook with the full decision JSON.
Setup
- Add an Anthropic API credential and select it for both Claude model steps.
- Provide a SendGrid API key and replace
YOUR_SENDGRID_API_KEY in all SendGrid HTTP Request steps, and update the From address/domain as needed.
- Configure Google Sheets access by supplying an OAuth2 credential for the Google Sheets API and replacing
YOUR_SHEET_ID in the Sheets append request.
- Create a Google Sheet with a
LoanApplications tab and headers matching the workflow’s appended columns (for example: Application ID, Applicant Name, Applicant Email, Loan Amount, Loan Purpose, Term Months, Verified Monthly Income, Debt-to-Income Ratio, Risk Score, Risk Tier, Recommendation, Suggested Loan Amount, Decided At).
- Update the internal notification recipient address (default
[email protected]) and copy the webhook URL into your application intake form or test client that POSTs the required fields.