🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

OpenAI + web chat widget: qualify real estate leads

Lisa Granqvist Partner Workflow Automation Expert

Your website chat is busy. But it’s not helpful busy. Prospects ask the same questions, your team repeats the same answers, and the “good” leads slip away because nobody asked the right follow-ups at the right time.

This kind of OpenAI lead qualification problem hits real estate marketers first, but founders running lean and sales coordinators managing inquiries feel it too. You want consistent screening, cleaner handoffs, and more booked site visits without living in the inbox.

This n8n workflow turns a simple web chat widget into a lead-qualifying conversation that remembers context, asks smart questions, and replies instantly. You’ll see what it automates, what results it produces, and how to plug it into your site.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: OpenAI + web chat widget: qualify real estate leads

The Problem: Your Chat Captures Leads, But Doesn’t Qualify Them

A web chat widget feels like “coverage,” until you look closely at what’s happening. Most chats start with vague intent (“2 BHK?”, “price?”, “location?”), and your team has to drag details out one message at a time. Some prospects disappear mid-thread, others come back days later expecting you to remember everything, and the conversation quality depends on who happened to reply. Meanwhile, you still need the basics: budget, timeline, decision-maker, and what they actually want. Without that, you’re not booking site visits. You’re just having conversations.

The friction compounds. Here’s where it breaks down most often.

  • Agents and marketers spend hours weekly repeating the same qualifying questions across dozens of chats.
  • Inconsistent follow-ups mean two prospects get two different experiences, even when they asked the same thing.
  • Context gets lost between messages, so returning visitors restart the conversation from scratch (and often leave).
  • “Looks interested” leads get pushed to calls too early, which wastes calendars and burns your team’s patience.

The Solution: An OpenAI-Powered Qualifier Inside Your Web Chat

This workflow connects your web chat widget to n8n, then routes each message into an OpenAI-driven conversation agent built to qualify real estate inquiries. A webhook receives the visitor’s message, n8n extracts the text, and a memory layer ties it to a session ID so the bot can remember what the person said earlier. From there, an AI Agent (configured with a pre-sales persona) asks consistent follow-up questions using proven sales frameworks like BANT and SPIN, while keeping the tone friendly and natural. Finally, n8n sends a clean JSON reply back to your widget so the visitor gets an instant response. The result is a chat experience that feels personal, stays on-track, and nudges serious prospects toward a site visit.

The workflow starts when your widget sends a POST message to an n8n webhook. OpenAI (GPT-4o-mini) generates the next reply using your persona and qualification logic, and the memory node keeps the conversation coherent. n8n then returns the response immediately to the website chat.

What You Get: Automation vs. Results

Example: What This Looks Like

Say your site gets 20 chat conversations a day. A human typically needs around 10 minutes per chat to ask basic qualifiers (budget, move-in timeline, preference like 2 BHK vs 3 BHK) and send links, so that’s about 3 hours daily. With this workflow, the visitor’s message hits the webhook instantly, OpenAI drafts the next question in under a minute, and your team only steps in when the lead is actually ready for a site visit or a call. You still get great coverage, but you stop paying for it with your time.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • OpenAI to generate qualifying chat responses
  • Web chat widget to send messages to the webhook
  • OpenAI API key (get it from your OpenAI account dashboard)

Skill level: Beginner. You’ll paste a webhook URL into your widget and add one API credential in n8n.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

Your website sends a message to a webhook. The chat widget makes a simple POST request to /webhook/chatbot-webhook with two fields: the visitor’s message and a session ID.

n8n captures and cleans the input. A Set node pulls message out of the JSON body and stores it as user_message, so your AI prompt stays consistent even if the widget payload changes later.

The agent replies with memory and rules. The Buffer Memory Store uses the session ID to keep context across messages, and the AI Agent uses the OpenAI Chat Model (GPT-4o-mini) to ask qualification questions and handle objections in a steady, on-brand way. Honestly, this is the part that makes it feel “human” instead of robotic.

Your widget gets a JSON response back. The Respond to Webhook node returns the bot’s message immediately, so the visitor experiences it like a normal live chat.

You can easily modify the agent persona to match your project, language, and qualifying criteria based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Webhook Trigger

Set up the inbound webhook that receives chat messages from your web client.

  1. Add the Incoming Webhook Trigger node and set HTTP Method to POST.
  2. Set the Path to chatbot-webhook.
  3. Set Response Mode to responseNode so the reply is sent by Return Webhook Reply.

Step 2: Capture Incoming User Text

Extract the message text from the webhook payload so the AI can use it.

  1. Add the Capture User Text node after Incoming Webhook Trigger.
  2. In Values → String, set Name to user_message.
  3. Set Value to the expression {{ $json.body.message }}.

Step 3: Set Up the AI Conversation Agent

Configure the AI agent, language model, and memory to generate conversational responses.

  1. Add the Conversation Agent node and connect it after Capture User Text.
  2. Set Text to {{$json["user_message"]}}.
  3. Set Prompt Type to define and paste the system message from the node: You are Khusboo, a friendly real estate pre-sales agent for Alcove New Kolkata Sangam. Your goal is to qualify leads and gently guide them toward a site visit. Use AIDA, BANT, SPIN, and PAS frameworks. Respond in Hinglish, be personal, share videos confidently, and never disclose price unless asked. Always aim to build trust and invite for a visit.
  4. Connect OpenAI Chat Engine to Conversation Agent as the language model.
  5. Set OpenAI Chat Engine Model to gpt-4o-mini.
  6. Connect Buffer Memory Store to Conversation Agent as memory.
  7. In Buffer Memory Store, set Session Key to ==memory_{{ $json.body.session_id || 'default' }} and Context Window Length to 20.

Credential Required: Connect your OpenAI credentials in OpenAI Chat Engine. This model powers Conversation Agent, and credentials must be added to the language model node (not the agent or memory sub-node).

Step 4: Configure the Webhook Response

Return the AI output to the caller as a JSON response.

  1. Add the Return Webhook Reply node after Conversation Agent.
  2. Set Respond With to json.
  3. Set Response Body to { "Respond Immediately": "{{ $json.output.replaceAll('\n', '\\n').replaceAll('\"', '\\\"') }}" }.

Step 5: Test and Activate Your Workflow

Validate the webhook flow end-to-end and activate the workflow for production use.

  1. Click Execute Workflow and send a POST request to the webhook URL with a JSON body like {"message":"Hi","session_id":"test123"}.
  2. Confirm Return Webhook Reply returns a JSON response containing the AI output under Respond Immediately.
  3. If the response is empty, verify Capture User Text is mapping {{ $json.body.message }} correctly and that OpenAI Chat Engine has valid credentials.
  4. Toggle the workflow to Active to enable production use of Incoming Webhook Trigger.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • OpenAI credentials can expire or be pasted incorrectly. If things break, check the OpenAI credential inside n8n and confirm your API key still works in your OpenAI dashboard first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this OpenAI lead qualification automation?

About 30 minutes if your chat widget can send webhooks already.

Do I need coding skills to automate OpenAI lead qualification?

No. You’ll connect your webhook and OpenAI credential, then paste a small JSON structure into your widget configuration.

Is n8n free to use for this OpenAI lead qualification workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs (often just a few cents per day at modest chat volume).

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this OpenAI lead qualification workflow for multiple real estate projects?

Yes, but you’ll want to do it deliberately. The easiest approach is to duplicate the workflow per project, then update the AI Agent node prompt (the “about project” details, links, and any media you share). You can also change the language behavior (for example, Hinglish vs. fully English) inside the agent’s system instructions. If you have one website with multiple projects, route by page or campaign and pass that into the webhook payload so the agent knows which script to use.

Why is my OpenAI connection failing in this workflow?

Usually it’s an invalid or expired API key in your n8n OpenAI credential. It can also be a model access issue (make sure GPT-4o-mini is available on your account) or a blocked outbound network on your host. If failures happen only under heavier traffic, rate limiting is a common culprit, so slow down retries or reduce how much text you send into the model.

How many chat messages can this OpenAI lead qualification automation handle?

If you self-host n8n, there’s no fixed execution limit (it mainly depends on your server and OpenAI limits). On n8n Cloud, your monthly execution cap depends on your plan, and this workflow uses roughly one execution per incoming message.

Is this OpenAI lead qualification automation better than using Zapier or Make?

Often, yes. A chat-based qualifier needs memory, branching logic, and a reliable webhook response, and n8n handles that without forcing you into a rigid “two-step zap.” You also get a self-host option, which is handy when message volume grows. Zapier or Make can still work if you only want a basic FAQ bot, but qualification is more than FAQs. Talk to an automation expert if you want help picking the simplest stack.

You set this up once, and your chat starts doing the job it was supposed to do. More qualified conversations, fewer dead-end threads, and a calmer path to booked site visits.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal