AI Lead Scoring from MLS Data via Webhook
Summary
This workflow automates lead scoring using MLS (Multiple Listing Service) data, combining vector search and a conversational AI agent. It receives lead or property data via a webhook, processes it into embeddings, stores it in a Pinecone vector database, and then uses a Hugging Face chat model to analyze or score the leads. The results are appended to a Google Sheet for easy tracking and further action.
Ideal for real estate professionals, this workflow turns raw MLS data into actionable intelligence, enabling quick identification of high-value leads, property matching, or automated responses.
Node-by-Node Breakdown
- Webhook (No auth) — Listens for incoming HTTP POST requests at path
/lead_scoring_with_mls_data. This is the trigger that starts the workflow whenever new data is sent. - Splitter (No auth) — A Character Text Splitter that breaks incoming text into chunks of 400 characters with 40-character overlap. This ensures long MLS descriptions are properly segmented for embedding.
- Embeddings (API Key auth) — Generates vector embeddings using OpenAI's default model. Requires an OpenAI API key configured in n8n credentials.
- Insert (API Key auth) — Inserts the generated embeddings into a Pinecone index named
lead_scoring_with_mls_data. This creates a searchable vector store of MLS data. - Query (API Key auth) — Queries the same Pinecone index to retrieve relevant documents. This node shares credentials with the Insert node and is used by the tool.
- Tool (API Key auth) — A Vector Store Tool that wraps the Pinecone query node, making it available to the AI agent as a callable function.
- Memory (No auth) — Buffer Window Memory that stores recent conversation context, allowing the agent to maintain state across interactions.
- Chat (API Key auth) — Hugging Face Chat Model (e.g., Llama, Mistral) used as the language model for the agent. Requires a Hugging Face API key.
- Agent (No auth) — An AI Agent that orchestrates the chat model, the vector store tool, and memory. It processes incoming data (from the webhook), decides when to query the vector store, and generates a response (e.g., a lead score).
- Sheet (OAuth2) — Google Sheets node that appends the agent's output to a sheet named "Log" in the document identified by
SHEET_ID. You must replaceSHEET_IDwith your actual Google Sheet ID and configure OAuth2 credentials for Google Sheets.
Setup Instructions
- Webhook: No setup required; the webhook URL will be generated when you activate the workflow in n8n.
- OpenAI: Create an account at platform.openai.com and generate an API key. Add this as a credential in n8n (
OpenAItype). - Pinecone: Sign up at pinecone.io, create an index named
lead_scoring_with_mls_data(dimensions matching OpenAI embeddings, e.g., 1536). Obtain your API key and environment. Add as a Pinecone credential in n8n. - Hugging Face: Create an account at huggingface.co and generate an access token. Add as a credential in n8n (
Hugging Facetype). - Google Sheets: Enable the Google Sheets API in your Google Cloud project, create OAuth2 credentials (Desktop app type), and add them in n8n. Replace the placeholder
SHEET_IDin the Sheet node with the actual ID of your Google Sheet. - Activate the workflow and send a POST request to the webhook URL with your MLS data (e.g., JSON with property details).
Use Cases & Variations
- Real Estate Lead Scoring: Incoming MLS leads are automatically analyzed and scored based on criteria like price, location, or features. The agent can output a score (0–100) and store it in Google Sheets.
- Property Matching: Instead of scoring, the agent can find similar properties from the vector store and recommend them.
- Multi-step Analysis: Add more tools (e.g., a calculator or CRM lookup) to enrich the agent's capabilities.
- Different Trigger: Replace the webhook with a schedule or event-driven trigger (e.g., new email or form submission).
- Alternative Vector DB: Swap Pinecone for Qdrant, Weaviate, or Supabase by changing the vector store type.
- Model Choice: Use OpenAI's chat model instead of Hugging Face by swapping the Chat node.
Workflow JSON
{
"name": "Mortgage Rate Alert",
"nodes": [
{
"parameters": {
"content": "## Mortgage Rate Alert",
"height": 520,
"width": 1100
},
"id": "e7f69fa7-a800-43bc-b113-061d37523f4d",
"name": "Sticky",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-500,
-250
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "mortgage_rate_alert"
},
"id": "3b8e8fe5-3986-44f2-9306-790e2ae3119f",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
-300,
0
]
},
{
"parameters": {
"chunkSize": 400,
"chunkOverlap": 40
},
"id": "dc561d99-0499-4c81-a7e5-e59ced66a2d5",
"name": "Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
"typeVersion": 1,
"position": [
-100,
0
]
},
{
"parameters": {
"model": "default"
},
// ... truncated (copy to see full JSON)How to Import This Workflow
- 1Copy the workflow JSON above using the Copy Workflow JSON button.
- 2Open your n8n instance and go to Workflows.
- 3Click Import from JSON and paste the copied workflow.
Don't have an n8n instance? Start your free trial at n8nautomation.cloud
Related Templates
Auto-Qualify Google Sheets Leads with OpenAI GPT-4
Overview This workflow automatically qualifies new leads submitted via Google Forms (or directly entered) into a Google Sheet. Using OpenAI's GPT-4, it evaluates each lead against custom criteria (e.g., decision-maker role, team size, email domain) and updates the sheet with a qualification rating and explanation. This saves manual review time and ensures consistent lead scoring for sales teams or community managers. Node-by-Node Breakdown Check for new entries (Google Sheets Trigger – OAuth2) - Listens for new rows added to a specific Google Sheet (connected to a Google Form or standalone). - Configured to poll every minute (adjustable). - Requires: A Google Sheet document ID and sheet name. Qualify leads with GPT (OpenAI – API Key auth) - Uses the chat model. - A system message defines qualification rules (decision-maker, team size, corporate email). - A user message injects the lead's name, email, business area, and team size from the trigger output. - Temperature set to 0.3 for consistent, deterministic responses. - Instructed to reply with a JSON object: . Extract JSON reply (Set Node – no auth) - Parses the from OpenAI's response using . - Stores the resulting object in a new field for downstream nodes. Merge (Merge Node – no auth) - Combines the original lead data (from the trigger) with the parsed GPT reply. - Uses “Combine” mode with “Merge by position” to join the two inputs horizontally. - Input 0 (from trigger) holds the row data; Input 1 (from Extract JSON reply) holds the GPT rating. Update lead status (Google Sheets – OAuth2) - Updates the same Google Sheet with the GPT's rating and explanation. - Matches rows by the column (to avoid updating the wrong row). - Writes the rating into a column (and optionally the explanation if you extend the schema). Setup Instructions Google Cloud / Sheets API - Create a Google Cloud project, enable the Google Sheets API, and create OAuth2 credentials (Desktop app or Web application). - In n8n, add a new Google Sheets credential (OAuth2) using your client ID and secret. OpenAI API Key - Sign up at OpenAI and create an API key. - In n8n, add a new OpenAI credential with your API key. Google Sheet - Use the provided template or create your own with columns: Timestamp, Email Address, Your name, Your business area, Your team size, Rating. - If using Google Forms, submissions will automatically populate the sheet. Configure the workflow - After importing, select each Google Sheets node and choose your credential and the correct sheet/document. - Adjust the polling interval if needed (default: every minute). - Modify the GPT system message to fit your own lead qualification criteria. Use Cases & Adaptations Sales lead scoring: Replace the criteria with your ICP (ideal customer profile) – e.g., industry, company size, budget. Community membership approval: Automatically accept or reject join requests based on responses. Event registration filtering: Qualify attendees for VIP access or follow-up. Extend output: Store the explanation in a separate column by adding it to the Update node's column mapping. Add notifications: Insert a Slack or email node after the Merge to alert your team when a high-quality lead is detected. Use a different model: Switch to for lower cost or for faster responses. This template is a starting point – tweak the prompt, polling frequency, and output columns to match your exact process.
Lead Capture to Notion CRM with Alerts in Slack
Overview This workflow instantly captures leads from any web form (Webflow, Tally, WordPress, custom HTML, etc.) and creates a new entry in your Notion CRM database while simultaneously sending a formatted alert to a Slack sales channel. It eliminates manual data entry and ensures your sales team can respond to leads within seconds of submission — no Zapier subscription required. How It Works The workflow is triggered by an incoming HTTP POST request (the webhook), then processes the lead data through two sequential actions: first creating a Notion database page, then posting a Slack message. The webhook responds immediately with a 200 status so the form never hangs or times out. Node-by-Node Breakdown Lead Webhook (No auth) — Listens for incoming POST requests at the path . Accepts both JSON and form-encoded payloads. When activated, n8n provides a unique production URL that you point your form's action attribute or integration to. The node responds automatically with HTTP 200 after all downstream nodes complete. Add to Notion CRM (OAuth2) — Creates a new database page in your specified Notion database. Configured parameters: - : The Notion database ID (must be replaced with your actual database ID) - : Set dynamically to (the lead's name from the webhook payload) - : Maps the lead's email to the "Email" property and sets a "Status" select property to "New" - Requires sharing your Notion database with the n8n integration Alert Sales Channel (OAuth2) — Posts a formatted Slack message to a specified channel. Configured parameters: - : The Slack channel ID (must be replaced with your actual channel) - : A dynamic message template using expressions: - Uses Slack's markdown formatting for bold text and blockquotes Setup Instructions Prerequisites An n8n instance (self-hosted or cloud) A Notion account with a Leads database (must contain at least Name, Email, and Status properties) A Slack workspace where you can create/choose a channel for lead alerts A web form or service that can send POST requests (Webflow, Tally, WordPress, Framer, custom HTML form, etc.) Step-by-Step Activate the workflow in n8n and copy the production webhook URL from the Lead Webhook node (it will look like ) Configure your form to send a POST request to that URL with fields: , , and (JSON or form-encoded both work) Connect Notion: - Create an integration at https://www.notion.so/my-integrations - Share your Leads database with that integration - In n8n, create a Notion credential (OAuth2) and select your database - Replace with your actual database ID Connect Slack: - Create a Slack app with and scopes - Install the app to your workspace - In n8n, create a Slack credential (OAuth2) - Replace with your actual channel ID (e.g., ) Test: Submit a test lead through your form and verify it appears in Notion and Slack Use Cases & Adaptations Primary Use Cases Marketing teams: Capture leads from landing pages, webinar registrations, or content downloads Sales teams: Get instant notifications when high-value prospects submit inquiries Startups: Build a lightweight CRM without expensive tools Variations to Try Add email automation: Insert a Gmail or SendGrid node after Notion to send an auto-reply to the lead Enrich lead data: Add an HTTP Request node to look up company info via Clearbit or Hunter.io Score leads: Use an n8n Code node to assign lead scores based on message content or source Multi-channel capture: Create additional webhook nodes for different forms, each routing to the same Notion database Error handling: Build a separate Error Trigger workflow that posts to Slack when any node fails Required Replacements Before running, you must replace these placeholder values: → Your Notion database ID → Your Slack channel ID
Daily Stripe Charges to Pipedrive Notes Sync
Overview This workflow automatically syncs successful Stripe charges to Pipedrive by creating notes on the corresponding organization records. It runs daily at 8 AM, fetching only new charges since the last execution, and enriches them with customer and organization data from both Stripe and Pipedrive. This is particularly useful for sales teams who want to keep their CRM updated with payment activity without manual data entry. Workflow Steps Every day at 8 am (Cron Trigger) — Runs the workflow daily at 8:00 AM. No authentication required. Get last execution timestamp (Function Item Node) — Tracks the last time the workflow ran using n8n's static data feature. On first run, it sets the timestamp to the current time. This ensures only new charges are fetched on subsequent runs. No authentication required. Search for charges in Stripe (HTTP Request Node) — Calls the Stripe API endpoint with a query parameter to find charges created after the last execution timestamp with status "succeeded". Uses Stripe API Key authentication (predefined credential type: ). Split array of charges to items (Item Lists Node) — Splits the array from the Stripe response into individual items so each charge can be processed separately. No authentication required. Get customers (Stripe Node) — For each charge, fetches the corresponding customer details from Stripe using the resource and operation. Uses Stripe API Key authentication (predefined credential type: ). Rename fields and keep only needed fields (Set Node) — Renames the Stripe customer fields: maps to and to . The option removes all other fields, keeping only these two. No authentication required. Add customer name to charge data (Merge Node) — Merges the charge data (from step 4) with the customer data (from step 6) using a key-based merge. It matches the charge's field with the customer's field. No authentication required. Search organisation (Pipedrive Node) — Searches Pipedrive for an organization matching the customer name using the resource and operation. Uses Pipedrive API Key authentication (predefined credential type: ). Add organisation Information to charge data (Merge Node) — Merges the charge+customer data with the Pipedrive organization data using index-based merge (inner join). This combines all information into a single data set. No authentication required. Create note with charge information (Pipedrive Node) — Creates a note in Pipedrive on the matched organization. The note content is formatted as (e.g., "Subscription payment: 29.99 USD"). The is set to the organization's ID from the search results. Uses Pipedrive API Key authentication. Set new last execution timestamp (Function Item Node) — Updates the static data with the current execution timestamp so the next run only fetches charges created after this run. The option ensures this runs only once even if multiple items are processed. No authentication required. Setup Instructions Prerequisites A Stripe account with API access A Pipedrive account with API access Credentials Setup Stripe API Key: In your Stripe dashboard, go to Developers > API keys and copy your secret key (sklive... or sktest...). In n8n, create a new Stripe credential and paste the key. Pipedrive API Key: In Pipedrive, go to Settings > Personal preferences > API and copy your personal API token. In n8n, create a new Pipedrive credential and paste the token. Workflow Configuration The workflow is pre-configured to run daily at 8 AM. You can change the trigger time in the Cron node. The note format can be customized in the "Create note with charge information" node by editing the field. The charge search query filters for "succeeded" status. You can modify this in the HTTP Request node's query parameters. Use Cases and Variations Primary Use Case Sales teams keeping Pipedrive CRM updated with payment activity from Stripe Account managers tracking which organizations have made recent payments Finance teams automating note creation for audit trails Possible Adaptations Change the trigger: Replace the Cron trigger with a webhook to run in real-time when a charge is created Add more data: Include charge metadata, invoice links, or payment method details in the note Different CRM: Replace Pipedrive nodes with HubSpot, Salesforce, or other CRM nodes Filter charges: Modify the Stripe query to filter by amount, currency, or specific products Add notifications: Insert a Slack or email node to alert the team when large payments are processed Bidirectional sync: Add logic to update Stripe metadata with Pipedrive organization IDs for cross-referencing