When I first started connecting external tools to our voice backend, my instinct was to poll. Every minute, a script asked the CRM if any new leads had arrived. Most of the time the answer was no, and when a lead did arrive, there was a delay before we noticed.
A webhook flips this around. Instead of our server asking the CRM, the CRM sends an HTTP POST request to our server the moment something happens.
In this post I’ll share how I’m approaching a two-way webhook flow between Zoho CRM and a voice agent. The code will come in the next post.
The flow
New lead created in Zoho CRM
-> CRM sends a webhook to our server
-> Our server receives the lead and replies quickly
-> Voice agent calls the lead
-> Call ends and the result is processed (summary, intent, status)
-> Lead is updated in Zoho CRM
The last step, writing the result back to Zoho, is the part I’m still working on.
Step 1: Send a webhook from the CRM
In Zoho, I created a workflow rule on the Leads module that runs when a record is created. Its instant action is a webhook: a POST to our server, with an authorization header and a JSON body containing the lead’s name, phone number and Zoho lead id.
Step 2: Receive the webhook
Three rules I’m following:
Check the sender. A webhook URL is public, so anyone who finds it can send fake requests. I check an API key before reading the data.
Reply fast, work after. Senders expect a response within a few seconds. So the server saves the lead, replies right away, and starts the call in the background.
Expect duplicates. If a sender thinks a webhook failed, it sends it again. I use locks and checks so the same lead does not trigger two calls.
Step 3: Start the call and carry the lead id along
When the call starts, I pass the lead id with it. Matching results by phone number alone is fragile, because numbers are formatted differently and can be shared. With the id attached, the result always finds its own lead.
Step 4: Use the result
When the call ends, the transcript is analysed to get a summary, the caller’s intent and a status. That result goes to the lead record. One detail to watch: the CRM’s lead status is a fixed list of values, so my own labels like “interested” must be mapped to the CRM’s exact words.
Problems I’m watching for
Wrong data center: Zoho uses different domains for different regions (.com, .in, .eu). A token from one will not work on another.
Expired tokens: the access token lasts about an hour, so it has to be refreshed.
Phone formats: people type numbers in many ways. They need to be cleaned to one format, with the country code, before dialing.
Lost webhooks: if the receiving server is restarting, an event can be missed. Retrying failed deliveries helps.
Questions for you
What confused you first when you started working with webhooks?
When connecting a CRM, do you push updates from your own backend, or use a tool like n8n or Zapier in the middle?
How do you handle phone number formats when leads come from different countries?
Top comments (0)