n8n
Use an API Request tool when an assistant needs a result from an n8n workflow during a conversation. Vapi calls the workflow’s production Webhook URL and gives its JSON response to the assistant.
What is n8n
n8n is a workflow automation platform that connects services and processes data. Its Webhook node can receive an HTTP request, run a workflow, and return data to Vapi. This pattern does not require a Vapi-specific request or response envelope.
Connect n8n
The Vapi + n8n starter demonstrates a three-node request-response workflow: Webhook → Code → Respond to Webhook. It checks an editable business-hours schedule and returns whether the example business is open now.
Prerequisites
- A Vapi account and a private API key
- An n8n instance that can publish a workflow with an HTTPS Webhook URL
- Node.js 20.6 or newer to run the starter
Import the workflow
In the n8n workflow editor, open the top-right three-dot menu, select Import from File, and choose workflows/vapi-business-hours.json from the starter directory.
Set the example schedule
Open Check business hours and set timeZone, openDays, opensAt, and closesAt for your example business. The imported workflow uses Monday through Friday, 09:00–17:00 in America/Los_Angeles.
Publish the workflow
Select Publish. Open Receive Vapi request, select Production URL, and copy the HTTPS URL. The Test URL works only while n8n is listening for a test event; use the production URL for the Vapi tool.
Verify the result
A successful run prints n8n webhook OK, Vapi API Request confirmed, and a Vapi answer based on the returned hours. The open or closed result depends on the current time and the schedule you set. In n8n, open the workflow’s Executions tab to inspect production requests.
The response includes openNow, localTime, timeZone, the regular schedule, and checkedAt. The example does not account for holidays or appointment availability.
Settings reference
Choose another pattern
Authenticate private workflows
Keep authentication secrets out of exported workflow JSON and model-visible tool fields.
The starter uses an unauthenticated webhook for public example hours. For private data or actions, configure n8n Webhook Header Auth and a Vapi Custom Credential with a matching header name and value.
Set the inline API Request tool’s credentialId to the credential ID. If n8n expects the raw header value, disable the credential’s Bearer prefix.
The starter does not test this authenticated variant. Its preflight GET request sends no authentication header, so the unchanged runner fails against a protected webhook. Add the same header to the preflight request when testing this variant.
Troubleshoot the connection
When you finish testing, unpublish the n8n workflow to stop accepting production webhook requests. The starter creates no saved Vapi resources.