Log the call after it ends, a Twilio voice agent to HubSpot and WhatsApp with Zapier
This article was drafted with AI help and reviewed by the author. When a team adds a phone agent, the CRM wish list arrives quickly. Log every call in HubSpot. Update the contact. Send a WhatsApp recap. Tell sales in Slack. The tempting place to do all of that is in the middle of the call, because that is where the information is. It is also the worst place. Every second spent on CRM work during…
After a call ends, it's crucial to log the interaction and update relevant records in CRM systems like HubSpot. The preferred method is to have a voice agent handle the call and then use Zapier to process the data post-call. This approach avoids disrupting the caller by keeping all CRM-related tasks away from the call itself.
Zapier can interact with Twilio to process the call data, but it cannot output a custom response that would affect the call flow. Therefore, the Zapier steps run independently of Twilio's response. The voice agent should save a brief outcome record for each call, including details like call SID, caller phone number, direction (inbound or outbound), intent, outcome, and a summary of the conversation.
The outcome field should be limited to a select few options such as "booked," "callback requested," "not interested," or "wrong number." The WhatsApp consent must be explicitly captured and reflect what the caller agreed to, not what the model inferred.
The workflow starts with Twilio sending a completed status callback to a Zapier Catch Hook. This callback includes crucial information like the call SID and duration. This data is then filtered based on the call status, with only completed calls proceeding further.
Zapier checks if a record of the call already exists in a "processed calls" table. If so, it stops the Zap to avoid logging duplicate calls. If not, it creates a new record with the call SID and the current time. The outcome record is then fetched using the call SID and logged in HubSpot.
On HubSpot, the system checks if a contact exists for the provided phone number. If not, it creates a new contact with the phone number and marks the source as "phone agent." The call details, including the summary, outcome, and duration, are logged against this contact.
If the caller opted in to WhatsApp notifications and the outcome was to book a demo, an approved WhatsApp template is sent out. The template is customized using the outcome record to fill in placeholders for the demo date and time. This WhatsApp message is only sent if the caller opted in.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to