Skip to main content

Qualify mortgage leads and collect documents with Gemini, Gmail, Drive, Telegram, and Supabase

Workflow preview

Workflow preview
100%
Qualify mortgage leads and collect documents with Gemini, Gmail, Drive, Telegram, and Supabase preview
Open on n8n.io

1. Workflow Overview

This workflow serves as a complete "AI Receptionist" for mortgage brokers or high ticket service providers. It automates the messy process of qualifying leads, getting internal approval, and collec...

Best for

  • Lead Generation automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.googlegemini, n8n-nodes-base.gmail, n8n-nodes-base.code, n8n-nodes-base.googledrive, n8n-nodes-base.supabase, n8n-nodes-base.if, n8n-nodes-base.telegram, n8n-nodes-base.formtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Shashwat Singh.

Original n8n.io source

1.1 Workflow description

Title
Qualify mortgage leads and collect documents with Gemini, Gmail, Drive, Telegram, and Supabase
Workflow name
Qualify mortgage leads and collect documents with Gemini, Gmail, Drive, Telegram, and Supabase

This workflow serves as a complete "AI Receptionist" for mortgage brokers or high-ticket service providers. It automates the messy process of qualifying leads, getting internal approval, and collecting sensitive client documents securely.

The workflow is fully annotated with Sticky Notes to help you understand every step of the logic.

Key Features

  • Smart Qualification: automatically filters leads based on income thresholds (e.g., >$80k) before they reach your inbox.
  • Human-in-the-Loop: Uses Telegram buttons to ask the broker for "Approve/Decline" confirmation before generating client emails.
  • Generative AI: Uses Google Gemini (2.5-flash-lite) to write personalized, warm welcome emails based on the lead's specific loan type.
  • Google Workspace Automation: Automatically creates a unique Google Drive folder for the client and drafts the email in Gmail (with the upload link pre-inserted).
  • Document Collection Portal: Includes a validation loop that checks if the client uploaded all required files (ID, Payslip, Bank Statements) and notifies the broker of success or failure.
  • Database Logging: Keeps a "Source of Truth" log in Supabase for every lead action.

Prerequisites

To use this template, you will need credentials for:

  1. Google Cloud Console: Enable APIs for Drive, Gmail, and Gemini (PaLM).
  2. Telegram: A Bot Token and Chat ID for notifications.
  3. Supabase: A project URL and API Key (Database schema provided in the Sticky Notes).

How to Configure

  1. Credentials: Set up your Google, Telegram, and Supabase credentials in n8n.
  2. Supabase Table: Create a table named leads_consolidated (schema details are in the workflow notes).
  3. Triggers: Ensure your n8n instance is publicly accessible so the Webhook and Form triggers function correctly.
  4. Telegram ID: Update the Chat ID fields in the Telegram nodes to your own ID.

This template is designed to be modular—you can easily swap Supabase for Airtable or Gemini for OpenAI if preferred.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Generate Personalized Email

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1.1

Block 2 - Create Gmail Draft

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 3 - Aggregate Log Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Create Drive Folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 5 - Share Drive Folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 6 - Store in Database

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 7 - Validate Input

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 8 - Send Success Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Send Partial Failure Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 10 - Send Validation Error

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Upload ID1

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 12 - Upload Payslip1

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 13 - Upload Bank Statement1

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 14 - Send Email Created Confirmation

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 15 - Request Email Approval1

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 16 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.5

Block 17 - Check income threshold

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 18 - Check approval response

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 19 - Check all uploads successful

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 20 - Normalize lead name

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Evaluate upload results

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - Log declined lead

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 23 - Update upload error log

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 24 - Upload portal trigger

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.5

Showing the first 24 of 31 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Qualify mortgage leads and collect documents with Gemini, Gmail, Drive, Telegram, and Supabase
Complexity advanced
Nodes 31
Categories Lead Generation, AI Chatbot
Author Shashwat Singh
Published 13 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13387/13387.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Qualify mortgage leads and collect documents with Gemini, Gmail, Drive, Telegram, and Supabase do?

This workflow serves as a complete "AI Receptionist" for mortgage brokers or high ticket service providers. It automates the messy process of qualifying leads, getting internal approval, and collec...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, AI Chatbot use case.