Opening Problem Statement
Meet Sarah, a busy sales manager at a growing roofing company. Every day, Sarah juggles dozens of new inbound and outbound leads. She needs to ensure every lead is contacted promptly, qualified accurately, and appointments scheduled without errors. Yet manually tracking each lead’s call status and follow-up is time-consuming and error-prone. Important leads sometimes fall through the cracks, costing her company potential revenue and wasting countless hours of manual work.
Sarah’s pain is real: her team spends hours sending reminder texts, making qualification calls, and updating spreadsheets. Miscommunications happen, follow-ups get delayed, and tracking call outcomes becomes a nightmare. What she desperately needs is an automated system that handles outbound lead calls, inbound call appointments, updates records, and sends clear summaries — all without manual intervention.
What This Automation Does
This n8n workflow solves Sarah’s problem by fully automating outbound lead qualification and inbound appointment scheduling using RetellAI, Google Sheets, OpenAI, and Gmail. When deployed, it achieves the following:
- Detects new outbound leads added to Google Sheets instantly.
- Sends SMS reminders to sales reps to call new leads within 5 minutes, ensuring timely outreach.
- Automates outbound calls through RetellAI’s API with dynamic lead data for qualification.
- Receives inbound calls routed via RetellAI and checks lead info in Google Sheets instantly.
- Updates lead qualification results back into Google Sheets automatically after each call.
- Generates intelligent call summaries using OpenAI to analyze call transcripts and highlight insights.
- Sends detailed emails summarizing calls to internal teams and confirmation emails to leads.
This workflow saves Sarah’s team hours of manual tracking, reduces errors by synchronizing data automatically, and accelerates sales cycles by qualifying leads faster and smarter.
Prerequisites ⚙️
- Active RetellAI API Key for placing and receiving calls.
- Google Sheets account with lead data properly formatted (phone numbers in E.164 format).
- Twilio account for sending SMS reminders.
- Gmail account configured with API credentials to send summary emails.
- OpenAI account with API access to generate call summaries.
- n8n account to create and run the workflow.
- Basic setup of API credentials within n8n for each tool above.
- Optional: Self-hosting n8n for full control (learn more at Hostinger guide).
Step-by-Step Guide
1. Set up Google Sheets Trigger to Detect New Leads
In n8n, add a Google Sheets Trigger node named “Detect new lead in Google Sheets.” Configure it to trigger on rowAdded event with polling every hour. Select your lead spreadsheet and worksheet where new leads arrive.
You should see this node activate whenever a new row is added with lead info such as name, UUID, and phone number.
Common mistake: Not formatting phone numbers in E.164, which breaks call functionality.
2. Send SMS Reminder to Sales Rep Using Twilio
Connect the trigger to a Twilio node to send an SMS reminder to the sales rep assigned to call the new lead. Map the lead’s phone number dynamically using {{ $json['Phone Number'] }}. Customize the message text with your service and timing (e.g., “Hello, thanks for your interest in our roofing services. We’ll be calling you shortly…”).
Twilio sends the SMS immediately to prompt rep action.
Common mistake: Using an incorrect “From” phone number not registered with Twilio.
3. Add a Wait Node to Delay Call by 5 Minutes
Link the SMS node to a Wait node configured to pause for 5 minutes (or your preferred call lead time). This ensures reps have time to prepare or follow up manually if needed.
You should see delayed output from this node before initiating the call.
4. Place Outbound Call Using RetellAI HTTP Request Node
Configure an HTTP Request node to make a POST request to https://api.retellai.com/v2/create-phone-call. Use dynamic JSON body to include from_number, to_number from the new lead’s phone number, and dynamic variables like UUID.
Set headers for Authorization: Bearer key_XXXXXXXXX and Content-Type: application/json. This triggers RetellAI to place the qualification call.
Common mistake: Forgetting to update your API key in headers.
5. Set up Webhook Node to Receive Inbound Calls
Add a Webhook node to receive incoming calls routed by RetellAI. Set the path and HTTP POST method. This node captures inbound call data.
Test this by configuring RetellAI to forward inbound calls to this webhook URL.
6. Verify Caller Phone Number Against Google Sheets
Link the webhook to a Google Sheets node configured to search if the inbound caller’s phone number exists in your leads sheet. Use the phone number from the webhook payload as a lookup value.
This verifies whether the inbound call is from an existing lead.
7. Respond to Inbound Call with Dynamic Variables
Connect the lookup node to a Respond to Webhook node. Set it to reply with JSON containing dynamic variables like the lead’s name. This personalizes call handling via RetellAI.
8. Capture Post-Call Data from RetellAI
Add another Webhook node to receive post-call analysis data from RetellAI. Configure with a unique path and POST method.
RetellAI sends detailed call analysis, including qualification results and transcripts.
9. Filter Analysis Events for Completed Calls
Use a Filter node to let only call_analyzed events pass through for further processing.
10. Conditional Check if Call was Outbound
Add an IF node to check if the call direction is outbound. This routes the flow for outbound calls separately from inbound.
11. Update Lead Qualification in Google Sheets
Connect the IF node to a Google Sheets node set to update the lead row by matching the UUID field. Map the qualification status accordingly.
This keeps your lead sheet up-to-date with call results automatically.
12. Generate Call Summary Using OpenAI
Add an OpenAI node configured to analyze the call transcript text using GPT-4.1. Use a prompt like:
Analyze this call transcript to identify how the call went and identify possible improvements to the voice prompt:
{{ $json.body.call.transcript }}This AI-powered summary provides rich insights and actionable feedback.
13. Send Call Summary Email Internally via Gmail
Use a Gmail node to send a plain-text email with lead details, qualification, and the AI-generated call summary to your sales manager or team email.
14. Send Confirmation Email to Lead
Optionally, send a second Gmail email confirming the appointment details to the lead, including availability and call summary.
Customizations ✏️
- Change SMS Content: In the Twilio node, modify the
messageparameter with your brand’s message and timeline. - Adjust Call Delay: Change the Wait node’s duration to control how soon the automated call happens after SMS reminder.
- Add More Lead Fields: In the Google Sheets nodes, add columns like “Lead Source” or “Priority” to track more details and update them post-call.
- Modify AI Prompt: Edit the OpenAI node’s prompt to tailor what kind of call analysis or improvements you want.
- Switch Email Recipients: Change the Gmail nodes’
sendTofields to notify different team members or the lead directly.
>
Troubleshooting 🔧
- Problem: “Google Sheets Trigger not firing on new rows”
Cause: Incorrect sheet ID or wrong event type set.
Solution: Double-check your Google Sheets document and worksheet IDs and ensure event is set to “rowAdded.” - Problem: “Twilio SMS not sent”
Cause: Misconfigured “From” number or invalid recipient number format.
Solution: Verify your Twilio phone number is SMS-enabled and recipient numbers use E.164 format (e.g., “+1234567890”). - Problem: “RetellAI call fails”
Cause: Invalid API key or incorrect HTTP request body format.
Solution: Confirm API key validity in the HTTP Request headers and ensure JSON body fields match RetellAI requirements. - Problem: “OpenAI summary not generated”
Cause: API quota exceeded or malformed prompt.
Solution: Check OpenAI API usage and test prompt formatting using tools like Postman or n8n’s node testing feature.
Pre-Production Checklist ✅
- Test Google Sheets trigger by adding a dummy lead row and verify SMS is sent.
- Check Twilio phone and message configurations are correct.
- Test HTTP request node with a sample API call to RetellAI.
- Confirm webhooks for inbound and post-call data receive proper payloads.
- Verify Google Sheets lookup and update nodes find and modify correct rows.
- Test OpenAI node with sample transcripts and check response.
- Send test summary emails to confirm formatting and recipients.
- Backup Google Sheets data before deploying live.
Deployment Guide
Once all configurations are verified, activate your workflow in n8n by toggling the activation switch at the top right. Monitor the execution logs initially to ensure no errors.
Ensure your API keys stay secure and renew or rotate keys as needed. Consider hosting n8n on a secure server for stable uptime and control.
FAQs
- Can I use a different SMS provider instead of Twilio?
Yes, you can replace the Twilio node with another SMS service that n8n supports, such as Vonage or Plivo, with appropriate configuration changes. - Does this workflow consume a lot of API calls?
API calls depend on your lead volume; ensure your RetellAI, Twilio, and OpenAI plans accommodate your expected usage. - Is the lead data secure?
This workflow handles data via secure API calls and OAuth credentials; always follow best practices for API key security and data privacy. - Can it scale to hundreds of leads daily?
Yes, n8n is capable of handling high volumes, but monitor account limits and possibly optimize by batching calls if needed.
Conclusion
You have now built a powerful automation that significantly simplifies managing outbound and inbound lead calls in your sales process using RetellAI, Google Sheets, OpenAI, and Gmail.
This workflow eliminates manual SMS reminders and follow-ups, ensures accurate call data tracking, and enriches insights with AI-generated summaries. Sarah’s team can save hours weekly, focus on closing more deals, and provide excellent customer experiences.
Next, consider extending this automation with CRM integrations or adding voice sentiment analysis to further enhance your sales operations.
Get started today and transform your lead qualification and appointment scheduling with smart automation!