Text back missed calls and answer after-hours SMS questions with Twilio, OpenAI and Google Sheets
Quick overview
Description
Quick overview I text back every missed call. In hours the text is plain. After hours it opens a short SMS chat that I answer only from your FAQ tab. I take the caller's name and need, then hand the lead to you by email. How it works Twilio posts each missed call to me. I check your Hours tab, which holds your weekly hours, holiday dates and overnight spans. In hours the caller gets a plain text-back. After hours the text invites them to reply. OpenAI answers each reply using only your FAQ tab, and only for a number that rang you in the last 24 hours. Before a reply goes I check it: valid JSON, 320 characters or fewer, FAQ rows that exist, and every price, time, number, link and address in it also in those rows, whole. Number words, discount words and booking or promise words must be in the rows too. A failure, a timeout, a rate limit or a cap sends a fixed message and hands over. When I have a name and a need, or the text is urgent, I add a row to your Leads tab and email you. An urgent lead alerts at once. The other overnight leads arrive in one digest when you open. New rows (claims, replies, leads, errors) are written through Google's append endpoint with INSERT_ROWS, so two texts in the same second cannot overwrite each other, and a save that wrote no row counts as failed. I handle STOP, START and HELP, a caller who rings five times, a withheld number and a landline. Once I hand a chat over, more texts from that person go onto the same lead and get no reply. Every turn is logged in your Conversations tab. The caller's words, any name and need they give, and your FAQ rows go to OpenAI with each turn. The caller's phone number does not. I start in preview mode, so each text arrives in your inbox until you switch to live. Setup Make a Google Sheet with the tabs Calls, Conversations, Leads, FAQ, Hours and Errors. The headers are in the README. Connect Google Sheets, Gmail, OpenAI and Twilio on the nodes that ask for them. Slack is optional. Open Your Settings and fill in owner_email, business_name, sheet_url and webhook_secret. I stop with a plain message until you do. Set your timezone in the workflow settings and the same name in Your Settings, set the Hours columns to plain text, and pick this workflow as its own error workflow. Point your Twilio number at the three webhook addresses in the README, each ending in ?key= and your secret. Then ring it and do not answer. Requirements n8n 1.x or 2.x, a Google account, a Twilio number that can send SMS and an OpenAI API key. Twilio charges for each text, and each chat turn is one small OpenAI call. Customization Your Settings holds the messages, the urgent words, the caps and the AI model. The Hours tab holds your hours and holidays. The FAQ tab is the only source of facts I will state. Additional info I ran the lanes on n8n test copies with real Google Sheets, real OpenAI and one real Slack post. The Twilio send has not been run live, because I had no Twilio account. In my test copy a Resend email stood in for each text and I read it back, so the conversation, the send expressions and my handling of a refused send are proven. Twilio's error codes were exercised against a stand-in, not against Twilio. Gmail's daily sending limit stopped my last runs, so the digest and failure alert emails were not delivered live and are checked from the run's own records. Start in preview mode. Support: support@fractionalhq.uk. An n8n automation workflow template by Jessy Mariau.
Community Metrics
Author
Jessy Mariau
Platform
web
Pricing model
paid
Categories
- Automation
Tags
- n8n
- workflow
- google-sheets
- http-request
- slack
- twilio
- gmail
- code
Capabilities
- 6 nodes