Retell AI Voice Agent Custom Function Handler - n8n Workflow

Use this core n8n workflow to integrate Retell AI voice agents with custom functions. Handle incoming webhooks, execute complex logic, and return dynamic, real-time responses directly to your AI agent.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers leveraging Retell AI to build robust voice applications.
Automation specialists seeking flexible n8n templates for real-time AI tool execution.
Users needing to connect AI voice agents to external systems like CRMs, databases, or payment gateways via a custom n8n node.
Organizations looking to centralize complex conversational logic within an n8n workflow.

Overview

This powerful n8n workflow serves as the backend endpoint for Retell AI's Custom Function feature. When a Retell Voice Agent reaches a point in the conversation that requires an external action (like checking inventory or confirming a booking), it sends a POST webhook to this n8n trigger. This allows for complex, real-world interactions to happen mid-conversation, dramatically extending the capabilities of the agent. This specific n8n template is designed for immediate deployment, providing a basic confirmation response, which users are encouraged to replace with advanced logic, potentially incorporating other n8n node integrations like database operations or LLM calls. Using this n8n workflow ensures reliable, scalable custom function handling.

How it Works

The process begins when a user interaction within the Retell Voice Agent conversation flow activates a Custom Function. This function is configured to hit the entry point of this n8n workflow, which is the Webhook n8n node.


  1. Webhook Trigger: The Webhook n8n trigger receives a POST request containing the full context of the call, including call ID, transcript, and any specific parameters defined in the Retell Custom Function (e.g., booking details like guest-name, room-type-booked, and total-cost).

  2. Logic Execution (Placeholder): The flow immediately moves to the [Replace me!] Set response n8n node. This is the designated area where the user must insert custom logic. This logic can involve complex steps—such as calling an external API, running a custom code script, or interacting with a database via another n8n node—before generating a result.

  3. Response Setting: The current Set n8n node creates a static success message ("Your booking has been confirmed!") which simulates a successful external action.

  4. Final Response: The data is then passed to the Respond to Webhook n8n node, which immediately sends the final JSON response back to the Retell AI agent, allowing the voice conversation to continue based on the outcome of the external function called by this n8n workflow.

Installation Guide

To start using this n8n workflow, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON code and import it directly into your n8n instance via the 'New' menu and selecting 'Import from JSON'.

  2. Activate the Webhook: Once imported, deploy the n8n workflow. The Webhook n8n node is configured with the path /hotel-retell-template.

  3. Obtain the URL: Copy the production webhook URL provided by the active n8n trigger (e.g., https://your-instance.app.n8n.cloud/webhook/hotel-retell-template).

  4. Configure Retell AI: Log into your Retell AI dashboard. Within the configuration of your Voice Agent's Custom Function, paste the n8n webhook URL obtained in the previous step.

  5. Customize Logic: Edit the placeholder [Replace me!] Set response n8n node. Replace the static Set node with your desired sequence of n8n nodes to handle external API calls, data validation, or AI-powered operations relevant to your voice agent’s needs. This ensures your n8n template is ready for production.

Node Details

This compact but powerful n8n workflow relies on three core n8n node types:

Webhook (n8n Trigger):
Function: Acts as the primary n8n trigger, listening for POST requests from the Retell Custom Function.
Key Configuration: Path is set to hotel-retell-template. It captures the incoming request body which contains all conversation and function arguments (like booking details).

[Replace me!] Set response (Set n8n Node):
Function: Currently, this n8n node assigns a static string value (response: Your booking has been confirmed!) to simulate the successful completion of a backend task. This node is intended to be the entry point for custom user logic, such as using an OpenAI n8n node or calling a CRM API.
Key Configuration: Sets a single string assignment named response.

Respond to Webhook (n8n Node):
Function: Sends the output generated by the preceding custom logic back to the waiting Retell Voice Agent in real-time. This is crucial for completing the custom function call within the voice conversation loop.
* Key Configuration: Sends the response payload to fulfill the incoming webhook request initiated by the n8n trigger.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by

We are a product studio that helps organizations leverage no-code and generative AI to automate internal processes and launch new digital products. LinkedIn: https://www.linkedin.com/in/baptistej/

Featured*