🔓 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

Twilio to Google Sheets, qualified leads by text

Lisa Granqvist Partner Workflow Automation Expert

New leads show up at the worst times. You glance at the form submission, tell yourself you’ll reply “in a minute,” and then two hours disappear into showings, calls, and admin.

This Twilio Sheets leads automation hits real estate agents first, but marketing managers routing inbound inquiries and small team owners running sales off a website form feel it too. The goal is simple: reply instantly, ask the right questions, and hand off a clean summary without digging through text threads.

You’ll see how this workflow starts an SMS conversation, keeps context across replies, and logs a qualified lead summary into Google Sheets so follow-up is fast and consistent.

How This Automation Works

Here’s the complete workflow you’ll be setting up:

n8n Workflow Template: Twilio to Google Sheets, qualified leads by text

Why This Matters: Speed-to-lead dies in your inbox

When someone fills out a “schedule a tour” form, they’re usually still in decision mode. If your reply comes later, they’ve already moved on, or worse, they’ve started five parallel conversations and you’re now competing on who responds fastest. The manual version also creates messy notes: a few texts here, a call log there, maybe a CRM entry if you remember. Then you’re trying to “reconstruct” budget, location, and timeline right before you call them. Honestly, it’s exhausting.

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

  • You don’t respond immediately, so the lead goes cold while you’re busy doing actual work.
  • Qualification questions get asked inconsistently, which means you chase people who were never a fit.
  • Conversations live in one-off SMS threads, so handoffs to another agent turn into screenshots and guesswork.
  • Even when you do qualify someone, the “summary” is scattered across tabs and memory, and mistakes slip in.

What You’ll Build: An SMS lead qualifier that logs clean summaries

This workflow turns a website form submission into an instant, two-way SMS conversation using Twilio. The moment a lead comes in, the workflow sends an intro text and starts a guided chat powered by an AI Agent, asking the exact questions you care about (budget, location, timeline, and anything else you add). As the lead replies, the workflow keeps context by storing chat history in PostgreSQL (often via Supabase), tied to the buyer’s phone number, so the conversation doesn’t “reset” with every message. When the agent detects the conversation is complete, it pulls the full history, generates a structured summary, and appends a clean row into Google Sheets. Finally, it notifies you (or your team) by SMS so you can follow up with confidence.

The workflow begins with a form trigger, then moves into outbound SMS and inbound reply handling via Twilio. Memory and chat history storage keep everything coherent across multiple messages. Once the qualification is done, OpenAI generates a readable handoff and Google Sheets becomes your single, searchable lead log.

What You’re Building

Expected Results

Say you get 10 inbound leads a week. Manually, you might spend about 10 minutes per lead just doing the basics: sending a first text, asking a few questions, and then copying notes into a sheet or CRM, which is roughly 100 minutes. With this workflow, the only “manual” time is scanning the Google Sheets summary and replying when needed, maybe 2 minutes per lead. That’s about an hour back every week, plus faster replies that you simply won’t manage consistently by hand.

Before You Start

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Twilio for sending and receiving SMS
  • Google Sheets to store the lead summary log
  • OpenAI API key (get it from your OpenAI dashboard)

Skill level: Intermediate. You’ll connect a few accounts, paste credentials, and test a webhook/SMS flow end-to-end.

Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).

Step by Step

A new form submission kicks things off. The workflow listens for a lead coming in (name, phone, maybe a property URL), then starts the automation immediately.

The lead gets an intro text via Twilio. After a short pause to avoid race conditions, it dispatches the first SMS so the lead knows you received their request and what happens next.

Replies are captured and the AI Agent runs the conversation. Inbound SMS messages trigger the workflow, which pulls conversation memory from PostgreSQL and feeds it to the OpenAI chat model so the agent can ask the next question naturally.

Once the conversation is “done,” the workflow writes the handoff. It aggregates the stored chat history, generates a structured summary, appends it to Google Sheets, and sends you a final SMS notification so you can follow up fast.

You can easily modify the qualification questions to match your market and your inventory. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Form and SMS Triggers

Set up the inbound entry points so leads can submit the form and reply by SMS.

  1. Open Form Submission Trigger and set Form Title to Real Estate Inquiry.
  2. In Form Submission Trigger, add a field with Field Label set to Phone and set Form Description to Please enter your phone number with country code (example +1).
  3. Open Inbound SMS Trigger and confirm Updates includes com.twilio.messaging.inbound-message.received.
  4. Keep Flowpast Branding as an optional sticky note for documentation; it has no effect on execution.

Step 2: Connect Twilio, Postgres, and Google Sheets

Attach credentials for the services used across the workflow so SMS, memory, and logging can run.

  1. In Inbound SMS Trigger, Dispatch Intro SMS, Send Thank You SMS, Send Agent Reply SMS, and Notify Owner via SMS, add credentials: Credential Required: Connect your twilioApi credentials.
  2. In Postgres Conversation Memory and Fetch Chat History, add credentials: Credential Required: Connect your postgres credentials.
  3. In Append to Google Sheet, add credentials: Credential Required: Connect your googleSheetsOAuth2Api credentials.
  4. For AI components, OpenAI Chat Model Alpha and OpenAI Chat Model Beta require: Credential Required: Connect your openAiApi credentials.

⚠️ Common Pitfall: Replace all [YOUR_ID] placeholders in Twilio From and Google Sheets Document ID with actual values before testing.

Step 3: Configure the Initial Outreach Flow

Send an introductory SMS shortly after the form is submitted.

  1. In Pause Briefly, set Amount to 10 to add a short delay after form submission.
  2. In Dispatch Intro SMS, set To to ={{ $json.Phone }}.
  3. Set From in Dispatch Intro SMS to [YOUR_ID].
  4. Set Message in Dispatch Intro SMS to Thanks for submitting the form on our website. Do you have a few minutes to answer a few questions?.

Tip: If you want faster engagement, reduce the Pause Briefly delay from 10 seconds.

Step 4: Set Up the AI Qualification Loop

Route inbound SMS replies into the AI agent for qualification and decide whether to continue or complete the conversation.

  1. Confirm the flow Inbound SMS TriggerHold for ReplyLead Qualification Agent is connected as shown in the workflow.
  2. In Postgres Conversation Memory, set Session Key to {{ $('Inbound SMS Trigger').item.json.data.from }} and Session ID Type to customKey. This memory node is attached to Lead Qualification Agent; ensure the Postgres credential is configured on Postgres Conversation Memory.
  3. In OpenAI Chat Model Beta, set Model to gpt-4o and attach it to Lead Qualification Agent as the language model.
  4. In Lead Qualification Agent, set Text to ={{ $json.data.body }} and keep Prompt Type as define.
  5. Set System Message in Lead Qualification Agent to =You are a friendly real estate assistant helping qualify new leads for a realtor. Ask only three brief questions, then end the conversation politely. Keep the tone warm and professional. Your goal is to gather basic information to help the realtor follow up later. 1. Ask for their name. 2. Ask what type of property they’re looking for (e.g., house, condo, rental). 3. Ask what city or neighborhood they’re interested in. Once all three answers are collected, thank them and let them know a realtor will follow up soon. also add *** to the response.
  6. In Conversation Completion Check, set the condition to String contains with Left Value ={{ $json.output }} and Right Value ***.
  7. If the condition is false, the flow continues to Send Agent Reply SMS. Set To to ={{ $('Inbound SMS Trigger').item.json.data.from }} and Message to ={{ $json.output }}.

Step 5: Configure Completion Actions and Logging

When the agent signals completion, summarize the conversation and log it while sending final notifications.

  1. Conversation Completion Check outputs to both Fetch Chat History and Send Thank You SMS in parallel.
  2. In Send Thank You SMS, set To to ={{ $('Inbound SMS Trigger').item.json.data.from }} and Message to =Thanks, I'll give you a call soon..
  3. In Fetch Chat History, set Operation to executeQuery and Query to SELECT * FROM n8n_chat_histories WHERE session_id = '{{ $('Inbound SMS Trigger').item.json.data.from }}'; .
  4. In Aggregate History Records, set Aggregate to aggregateAllItemData.
  5. In OpenAI Chat Model Alpha, set the model to gpt-4o-mini and attach it to Summarize Conversation as the language model.
  6. In Structured Output Parser, keep JSON Schema Example as { "transcript": "transcript", "summary": "summary" } and connect it to Summarize Conversation as the output parser (no credentials needed for the parser itself).
  7. In Summarize Conversation, set Text to ={{ $json.data }}, enable Has Output Parser, and set System Message to =output two fields a clean transcript of the conversation and a summary of the conversation.
  8. In Append to Google Sheet, set Operation to append, Document ID to [YOUR_ID], and Sheet Name to gid=0 (Sheet1). Map columns: Phone = ={{ $('Inbound SMS Trigger').item.json.data.from }}, Summary = ={{ $json.output.summary }}, Transcript = ={{ $json.output.transcript }}.
  9. In Notify Owner via SMS, set To to ={{ $('Inbound SMS Trigger').item.json.data.from }} and Message to =*** You just got a new lead. Here's a transcript of the interaction with our AI Bot. ***{{ $json.Summary }}***.

⚠️ Common Pitfall: Ensure the Google Sheet has columns named Phone, Summary, and Transcript to match the mapping in Append to Google Sheet.

Step 6: Test and Activate Your Workflow

Validate the full SMS loop, AI responses, and logging before turning the workflow on.

  1. Click Execute Workflow and submit a test entry via Form Submission Trigger with a real phone number.
  2. Confirm you receive the intro SMS sent by Dispatch Intro SMS, then reply to trigger Inbound SMS Trigger and the AI loop through Lead Qualification Agent.
  3. Verify that a non-completed conversation sends a reply from Send Agent Reply SMS, and that a completed conversation routes through the parallel path to Send Thank You SMS and Fetch Chat History.
  4. Check that Append to Google Sheet creates a new row with the phone number, summary, and transcript, then confirm Notify Owner via SMS sends the final notification.
  5. When everything works as expected, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Troubleshooting Tips

  • Twilio credentials can expire or need specific permissions. If things break, check the Twilio Console (Messaging settings and phone number webhooks) first.
  • If you’re using Wait nodes or external processing, timing varies. Bump up the wait duration if downstream nodes fail on empty responses.
  • OpenAI prompts that are left generic will feel “chatty” and off-brand. Add your voice and your must-ask questions early, or you will be editing summaries forever.

Quick Answers

What’s the setup time for this Twilio Sheets leads automation?

About 45 minutes if your Twilio number and Google Sheet are ready.

Is coding required for this lead qualification automation?

No. You’ll mostly connect accounts and adjust a few AI prompts and fields.

Is n8n free to use for this Twilio Sheets leads 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 dollars a month at low lead volume) and Twilio SMS fees per message.

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 modify this Twilio Sheets leads workflow for different use cases?

Yes, and you should. You can rewrite the questions in the Lead Qualification Agent, change what gets extracted by the Structured Output Parser, and map new columns in the Append to Google Sheet step. Many teams also swap the “notify owner” step so the handoff goes to a shared inbox, a second agent, or even Pipedrive instead of (or in addition to) Sheets.

Why is my Twilio connection failing in this workflow?

Usually it’s the webhook URL on your Twilio phone number not pointing to the right Inbound SMS Trigger in n8n, or an Auth Token/SID that was rotated. Double-check the Twilio Console for the Messaging webhook settings, then re-test by sending a real SMS from your phone. If it fails only sometimes, you may also be hitting messaging limits or the workflow is responding before memory/history is available, so increasing the wait can help.

What volume can this Twilio Sheets leads workflow process?

If you self-host, there’s no execution limit (it mainly depends on your server and Twilio throughput). On n8n Cloud, the practical limit depends on your plan’s monthly executions, since each SMS back-and-forth can trigger multiple runs. For most small teams doing a few leads a day, it’s comfortably within entry plans, but high-volume campaigns should budget for more executions and higher SMS spend.

Is this Twilio Sheets leads automation better than using Zapier or Make?

Often, yes. Two-way SMS plus “memory” is where simpler tools start to feel awkward, because each message needs context and branching logic. n8n handles that branching without nickel-and-diming you for paths, and you can self-host when volume grows. It also plays nicely with databases like Postgres for chat history, which is a big deal for conversations that span hours or days. Zapier or Make can still work if you only need a basic “send a text, log a row” flow with no real back-and-forth. Talk to an automation expert if you want help choosing.

Once this is live, your leads get an immediate, consistent experience and you get clean notes in one place. Set it up, test it twice, and let the workflow handle the repetitive parts.

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