> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newlead.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Continue a call on WhatsApp

> Send the caller a WhatsApp message when the call ends, so your text agent carries on in writing.

After a call, you can message the caller on WhatsApp so the conversation continues with your text agent. There's no switch for this in the dashboard: you build it with an n8n workflow, or with your own system, using the voice agent's webhook events.

## How it works

1. During the call, the voice agent asks whether the caller wants to continue on WhatsApp. You tell it to in its instructions.
2. When the call ends, the agent fills its custom fields and sends the **Variables collected** event.
3. Your workflow receives the event and sends an approved WhatsApp template from your text agent to the caller's number.
4. When the caller replies, your text agent takes over. The call and the WhatsApp conversation belong to the same contact.

## Before you start

* A text agent with WhatsApp connected and an approved template to open the conversation.
* n8n with the community node installed and connected with an API key of the subaccount. See [n8n](https://docs.newlead.ai/n8n.md).
* A voice agent that takes calls. See [Voice agents](https://docs.newlead.ai/guide/voice/voice-agents.md).

## Set it up

**1. Add a field to the voice agent**

In the voice agent, open **Custom fields** and add one such as `whatsapp_ok`, with **What it is** set to "Whether the caller agreed to continue on WhatsApp". For web calls, which have no phone number, add `whatsapp_phone` too.

**2. Ask for it in the instructions**

In **Instructions and greeting**, tell the agent to ask before hanging up whether the caller wants to continue on WhatsApp and, on a web call, to confirm the number.

**3. Listen for the call**

In n8n, add the **Newlead Trigger** node, set **Agent Type** to **Voice**, choose the voice agent and the **Call Analyzed** event.

**4. Check the answer**

Continue only when the event's `variables` show that the caller agreed.

**5. Get the number**

Use **Call › Get** with the event's `call_id`. On an incoming call, `from` is the caller's number; on an outgoing one, it's `to`. On a web call, use the `whatsapp_phone` field.

**6. Send the template**

Use **Template › Send** with your text agent, the template and the number, with its country code. Under **Options**, set **Source Lead ID** to the event's `lead_id` so both leads belong to the same contact, and set **Idempotency Key** to the `call_id` so each call sends one message at most.

## Good to know

* **Variables collected**, which n8n calls **Call Analyzed**, is only sent when the agent has custom fields, the call has a transcript and the analysis works. If it isn't sent, no message goes out.
* Test calls from the agent's page don't send events, so test the workflow with a real call.
* For phone calls, prefer the number from the call over one the caller dictated: a number read out loud can be misheard.
* A contact marked **Do not contact** doesn't get the template.
* What the events carry is in [Webhook events](https://docs.newlead.ai/webhook-events.md#call-analyzed), and the template options are in [Send a template](https://docs.newlead.ai/messages-and-calls.md#template-options).

## Related

* [Call fields and webhooks](https://docs.newlead.ai/guide/voice/fields-and-webhooks.md)
* [Calls](https://docs.newlead.ai/guide/voice/calls.md)
* [n8n](https://docs.newlead.ai/n8n.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.