Quick overview
This workflow receives inbound Twilio SMS replies, Twilio status callbacks, and Retell call_analyzed webhooks, then verifies the signature, handles opt-outs, qualifies candidates from structured answers, books interviews in Google Calendar, writes outcomes back to the ATS, and notifies recruiters via Slack and Gmail.
How it works
- Receives a POST request on a single webhook endpoint used by Twilio (inbound SMS and status callbacks) and Retell (call_analyzed events).
- Verifies the request signature (Twilio HMAC-SHA1 or Retell HMAC-SHA256) and rejects unsigned or invalid requests in live mode.
- Normalizes the incoming payload into a common event format, detects opt-out/positive/negative intent for SMS replies, and ignores non-actionable events like delivery receipts and non-final call events.
- If the message is an opt-out, records the phone number opt-out in Supabase (stopping all future outreach) and optionally sends a single confirmation message.
- Otherwise, evaluates Retell’s structured screening answers (and SMS intent where applicable) against the QUALIFY rules to mark the candidate as qualified, needs review, or not qualified.
- For qualified candidates, selects the job’s recruiter and proposes the next available interview slot, then books the interview in Google Calendar and records the appointment in Supabase when writeback is enabled.
- Queues and posts an outcome note (and optional status update) to the ATS, optionally alerts the recruiter via Slack and Gmail, logs the inbound event to Supabase, and returns a fast provider-friendly webhook response.
Setup
- Create and configure a Supabase project (including the required schema/RPC such as stop_all_outreach) and add your SUPABASE_URL, service key, and CLIENT_ID in the config.
- Add Twilio credentials and configure the Twilio webhook and status callback URL to this workflow’s production webhook URL (and set the same URL in TWILIO_STATUS_CALLBACK for signature verification).
- If using Retell, add your Retell API key/agent details, set RETELL_WEBHOOK_SECRET, and register the same webhook URL in the Retell dashboard.
- Connect Google Calendar credentials (and optionally Gmail) and ensure recruiter email addresses map to valid calendar IDs (or configure RECRUITER_CALENDARS).
- Provide your ATS base URL and token (for example Bullhorn) if you want ATS notes/status updates, and optionally set SLACK_WEBHOOK_URL for Slack alerts.
- Switch DEMO_MODE to false and TEST_RUN to false only when you are ready to send real messages, create calendar events, and write back to your ATS.
Customization