CodeWords raises $9M seed round
BlogResources

How to add human handover to your WhatsApp AI agent

Learn how to add human handover to your WhatsApp AI agent — trigger types, what happens during handover, and how to build it with CodeWords in minutes.

Rebecca PearsonRebecca Pearson6 min read
How to add human handover to your WhatsApp AI agent

A great WhatsApp AI agent handles most conversations on its own. But some conversations need a human — and knowing when to step in is what separates a good bot from a frustrating one. Adding human handover to your WhatsApp AI agent is one of the highest-leverage things you can do, and it's simpler than most people expect.

TL;DR

  • Human handover pauses your bot and notifies you when a conversation needs a real person — so customers never get stuck.
  • Three trigger types cover almost every handover scenario: keyword triggers, confidence-based triggers, and time-based resumption.
  • CodeWords makes it conversational. Just tell Cody, your AI automation assistant, "pause when I reply manually" and the handover logic is built for you.

Why human handover matters

No AI agent gets it right 100% of the time. A customer might have a complex complaint that needs empathy. A sales prospect might be ready to buy and want to talk to a real person before committing. A support question might require account access the bot doesn't have.

Without a handover mechanism, your bot does one of two things: it either keeps trying to answer and gets it wrong, or it says "I don't know" with no way forward. Both outcomes damage trust.

Human handover solves this cleanly. The bot recognises it's out of its depth, pauses, alerts you, and gives you the full context to take over. The customer experiences a seamless transition — from bot to human — without repeating themselves.

The three trigger types

Keyword triggers

The simplest handover trigger is a keyword. When a customer types "agent", "human", "speak to someone", or "representative", the bot detects the intent and hands over immediately.

This is the most reliable trigger because it reflects explicit customer intent. The customer has decided they want a person. Respect that decision quickly.

You can define a list of keywords in your system prompt or logic layer. Common ones include:

  • "human"
  • "agent"
  • "speak to someone"
  • "call me"
  • "manager"

Confidence-based triggers

A more sophisticated trigger fires when the AI itself doesn't know the answer with sufficient confidence. This is harder to implement at the model level, but you can approximate it by instructing your agent to say a specific phrase — like "I need to check this with my team" — when it's uncertain, and then treating that phrase as a handover signal.

Alternatively, if you're building with a platform that exposes confidence scores, you can set a threshold. Any response below that threshold routes to a human rather than being sent to the customer.

Time-based resumption

After a human has replied, you don't always want the bot to resume immediately. A natural pause — say, two hours — gives the conversation room to breathe. If the human hasn't continued the conversation after that window, the bot can step back in automatically.

This works well for businesses where the owner handles escalations during business hours and the bot covers the rest. The bot pauses at handover, the human deals with the issue, and the bot resumes overnight when the human is offline.

What happens during handover

When a handover is triggered, three things should happen in sequence.

First, the bot sends an acknowledgement to the customer. Something like: "I'm going to connect you with a member of our team. You'll hear back shortly." This sets expectations and stops the customer from sending five more messages wondering what's going on.

Second, the bot notifies you. The notification should arrive via Slack or email — whichever you check most often — and include the full conversation transcript so you have context before you reply. A notification that just says "new handover" without the conversation history is unhelpful.

Third, the bot pauses. It stops monitoring that conversation for new messages. If the customer messages again while you're handling it, the bot doesn't jump back in and create confusion.

How to build this with CodeWords

CodeWords makes handover logic straightforward because you describe it in plain English. Cody, the AI automation assistant, translates your description into a working agent.

When you're setting up your WhatsApp agent in CodeWords, tell Cody something like:

"If the customer says 'human', 'agent', or 'speak to someone', pause the bot, send them a message saying we'll follow up shortly, and notify me on Slack with the full conversation transcript. Resume the bot automatically if I haven't replied within two hours."

Cody builds that logic for you. You don't need to configure webhooks, set up conditional branches, or write a line of code.

For the Business API connection, handover works by updating a flag in memory — CodeWords uses Redis to track conversation state, so the bot knows which conversations are paused and which are active.

For the Personal Device connection, the mechanism is slightly different: the bot detects when a reply has been sent from the phone directly (rather than from the agent) and uses that as the signal to pause.

Permanent handover vs temporary pause

There's an important distinction between a permanent handover and a temporary pause.

A temporary pause is the most common pattern. The bot pauses, a human handles the issue, and the bot resumes after a set time window or once the human explicitly reactivates it. This is right for most service and support scenarios.

A permanent handover removes the conversation from bot coverage entirely. You'd use this for a customer who has specifically asked never to be handled by a bot, or for a sensitive situation — a complaint, a refund dispute, a potential churn risk — where ongoing human attention is warranted.

In CodeWords, you can tell Cody to support both: "If the customer says 'no bots', remove them from automated replies permanently." Cody adds that customer to an exclusion list stored in memory.

When to resume the bot

Resuming too quickly creates a jarring experience. Resuming too slowly leaves you doing manual work that the bot should be handling.

The right resumption timing depends on your business:

  • High-volume support — resume after two hours if no human reply
  • Sales — resume the next business morning if no human reply
  • Personal assistant bots — don't auto-resume; manual reactivation only

You can also give the human an explicit resume command. Something like typing "resume bot" in the WhatsApp conversation triggers the system to hand back to the agent. This gives you control without requiring you to log into a dashboard.

Testing your handover flow

Before you go live, test the full handover sequence:

  1. Send a message that triggers handover (type "human")
  2. Confirm the bot sends the acknowledgement message
  3. Confirm you receive the Slack or email notification with the transcript
  4. Reply from your phone (for Personal Device) or from the dashboard (for Business API)
  5. Wait for the auto-resumption window to expire
  6. Confirm the bot picks up the next message normally

Edge cases to check: what happens if you reply while the bot is mid-sentence? What if the customer sends three messages before the handover acknowledgement arrives? These scenarios are worth testing before you have real customers in them.

Build a smarter agent that knows its limits

The best WhatsApp AI agents aren't the ones that try to handle everything — they're the ones that handle what they can and escalate gracefully when they can't. Human handover isn't a fallback for a bad bot; it's a feature of a great one.

If you're building your WhatsApp agent with CodeWords, you can describe your entire handover flow in plain English and have Cody build it for you. No code, no configuration files, no developer required.


Related reading

Get started today

Your first agent is free to build.

Describe what you need. Cody handles the build, the connections, and the deployment.