How to Connect an AI Phone Agent to n8n
Published
Your echowin agent can call an n8n workflow in the middle of a phone call: it collects details from the caller, sends them to an n8n Webhook trigger with the Call API (Webhooks) tool, and reads the workflow's reply back to the caller. This guide builds a support-ticket flow, but the same pattern works for any workflow you can build in n8n.
What you need
- An echowin agent with a phone number.
- An n8n instance (n8n Cloud or self-hosted) reachable over HTTPS.
- About 15 minutes.
How it fits together
| Step | Where | What happens |
|---|---|---|
| 1 | Phone call | The agent collects the caller's name, email and issue. |
| 2 | echowin | The Call API tool sends a POST request to your n8n webhook URL. |
| 3 | n8n | The workflow creates the ticket and responds with JSON. |
| 4 | Phone call | The agent reads fields from that JSON back to the caller. |
Step 1: Create the webhook in n8n
- Create a new workflow in n8n and add a Webhook trigger node.
- Set HTTP Method to
POST. - Set Respond to Using 'Respond to Webhook' Node, so the workflow can send data back to the agent.
- Under Authentication, choose Header Auth and create a credential with a header name (for example
X-Echowin-Key) and a long random value. Anyone who has the URL can call an unauthenticated webhook. - Copy the Production URL. The test URL only works while you are listening for a test event in the editor.
Step 2: Build the workflow and respond
Add the nodes that do the work, such as creating a ticket in your helpdesk, then end the workflow with a Respond to Webhook node that returns JSON:
{
"success": true,
"ticket": {
"id": "TICKET-1042",
"status": "open"
}
}
Keep the response small. Your agent only needs the fields it will say out loud.
Publish (activate) the workflow so the production URL accepts requests.
Step 3: Add the Call API tool to your agent
In your agent's tools, add Call API (Webhooks) and configure it:
- Description:
Create Support Ticket - URL: your n8n production URL
- Method:
POST - Headers:
{
"X-Echowin-Key": "your-random-value",
"Content-Type": "application/json"
}
- Body:
{
"name": "$name",
"email": "$email",
"issue": "$issue"
}
- Response Identifiers:
ticket.id,ticket.status
Each $variable is filled in by the agent from the conversation. Response identifiers use dot notation and limit which parts of the n8n response the agent can see.
If you already have a cURL command for your webhook, paste it into Import from cURL to fill in the URL, method, headers and body.
Step 4: Test before you take calls
Use the built-in Test Playground:
- Enter sample values for
$name,$emailand$issue. - Send the request and check that n8n shows a successful execution.
- Click
ticket.idin the JSON response to add it to the response identifiers.
The playground sends requests through echowin's proxy, so you can test from the configuration panel without CORS errors.
Step 5: Tell the agent when to use it
Add an instruction to your agent's prompt:
Collect the caller's name, email, and a short description of their issue. Then use the "Create Support Ticket" tool with $name, $email and $issue. Tell the caller their ticket ID. If the tool fails, apologise and tell the caller the team will follow up by email.
The last sentence matters: always tell the agent what to do when the workflow is down or returns an error.
Troubleshooting
- The agent says the tool failed. Check that the workflow is published and that you used the production URL, not the test URL.
- n8n returns 401 or 403. The header name or value in echowin doesn't match the n8n Header Auth credential.
- The agent doesn't mention the ticket ID. Make sure
ticket.idis in the response identifiers and that the instruction asks the agent to read it out. - The request times out. The caller is waiting on the line while n8n runs. Respond as soon as you have the data the agent needs, and move slow steps after the Respond to Webhook node.
Next steps
- Read the full Call API (Webhooks) reference for query strings, GET requests and response mapping.
- Prefer Zapier? See the Zapier tool.
- New to n8n webhooks? See the n8n Webhook node documentation.