Calendly booking chatbot for n8n
An n8n chatbot that answers questions, picks the right Calendly event type, offers real availability and books the slot the visitor confirms. Needs a paid Calendly plan.
Prerequisites
- An n8n instance, cloud or self-hosted
- A paid Calendly plan (the Scheduling API is not available on the free plan)
- A Calendly personal access token
- Two event types in Calendly: one for new enquiries, one for support calls
- An OpenAI API key (or another chat model credential)
- SMTP credentials in n8n for the booking notification email
- Your FAQ or services copy as plain text
A chat widget that answers visitor questions, works out whether they want a sales call or a support call, and books them into the right Calendly event type without sending them to a separate booking page.
What you'll build
The same shape as the Cal.com booking recipe, aimed at Calendly. A visitor asks a question or two, then the conversation turns to wanting time on your calendar. The bot works out which kind of call fits, checks real availability, offers a few times and books the one the visitor confirms, then emails you a heads-up.
If you have read that Calendly cannot book through its API, that was true before its Scheduling API. Calendly's developer documentation now describes this conversational booking pattern as an intended use. What differs from Cal.com is entirely on the Calendly side: event types are identified by a full URI rather than a short slug, and the booking API needs a paid plan.
How it works
- A webhook receives each widget message and checks a shared secret.
- An AI agent has two tools. check_availability reads open times and can be called freely. book_slot creates the booking by adding the visitor as an invitee.
- Each tool is a separate workflow that calls the Calendly API.
Note: The confirmation gate is a rule in the system prompt, not code. There is no mechanical way for n8n to verify that a visitor really agreed to one specific time, so the agent is instructed never to book until they have clearly confirmed it. That is a different guarantee from the consent gate in the CRM recipes, which is ordinary n8n branching. If you edit the prompt, keep the confirmation wording intact or the bot may book on a vague yes.
What it costs
The workflow is free to download and use. Your AI provider charges per conversation, and your n8n hosting and the plan for the service you connect apply as normal. For N8N Chat UI plans, see pricing. Calendly's paid plan is the one real cost gate on this recipe, because the booking API does not work on the free plan.
Set it up
- Look up your event type URIs. Calendly identifies event types by a full URI such as
https://api.calendly.com/event_types/XXXXXXXX. Make an authenticated GET tohttps://api.calendly.com/users/meto find your user URI, then a GET tohttps://api.calendly.com/event_types?user=YOUR_USER_URI, and note theuriof each event type you want. - Create a token. In Calendly go to Integrations → API & Webhooks and create a personal access token. Copy it now.
- Create the credential. In n8n, create an HTTP Header Auth credential with Name
Authorizationand ValueBearer YOUR_PERSONAL_ACCESS_TOKEN. - Import the workflow. Download the file with the button at the top of this page and import it with Workflows → Import from File. It holds the main chatbot and its tool workflows on one canvas, each in a labelled section.
- Move each tool into its own workflow. n8n tools call a separate workflow, so for each tool section below the main flow: select its nodes, copy them, create a new empty workflow and paste. Save it, then open the matching tool node under the agent and select that workflow. Attach the credential to Call Calendly availability API in the check availability workflow, and to Call Calendly Create Event Invitee and Re-check availability in the book slot workflow. Attach your SMTP credential to Notify by email.
- Fill in Chatbot settings. Set
company_name,event_type_new_projectandevent_type_support(the URIs from step 1),timezone,days_ahead,knowledgeand a randomwebhook_secret. - Fill in each tool's settings. In check availability, open Tool settings and set
timezoneanddays_ahead. In book slot, open Tool settings (book slot) and set the same two plushandoff_email, where booking notifications go. - Add your AI credential. Open GPT-4.1 mini model and add your OpenAI credential. Swap the node for another chat model if you prefer.
days_ahead matters: Calendly's availability endpoint caps how far a single query can look, roughly a week. A larger value does not error, it just stops reflecting reality beyond the cap, so keep it at 7. timezone labels the times shown to the visitor and is sent as the invitee's timezone when booking. The times themselves come from your Calendly account's own availability settings.
Warning: If your event type defines a location, Calendly requires a location object in the booking request, and this workflow does not send one yet. If bookings come back with a 400, add it to the JSON body of Call Calendly Create Event Invitee. This has not yet been confirmed against a live account.
Test it
Send a test message before you connect a widget. n8n's built-in chat panel needs a Chat Trigger, so it will not open for this workflow. Instead, click Test workflow, then send a POST request to the Test URL shown on the Chat webhook node:
curl -X POST 'YOUR_TEST_URL' \
-H 'Content-Type: application/json' \
-d '{"chatInput":"Hello","sessionId":"test-1","metadata":{"webhook_secret":"YOUR_SECRET"}}'The test URL listens for one request each time you click Test workflow. For a longer conversation, activate the workflow and send requests to the production URL, then read each run under Executions. Reuse the same sessionId to continue a conversation, because memory is kept per session.
Things to try:
- Ask a question covered by
knowledge. It should answer without mentioning booking. - Say you would like to book a call with no other context. The bot should ask which kind before offering times.
- Ask for availability. The times offered should match what is open in your calendar.
- Confirm one specific slot. The booking appears in your calendar and your notification email arrives.
- Ask a vague question, then say yes. The bot should not book anything, because nothing specific was confirmed. This is the check people skip, and a bot that books on a vague yes is worse than one that asks once more.
- Try to book a slot you have just taken manually. The bot should recover with alternatives instead of erroring.
Add it to your site
Activate the workflow and use its production webhook URL as your widget's chat endpoint. Send the same secret in the widget metadata, for example metadata: { page_url: window.location.href, webhook_secret: 'YOUR_SECRET' }. The metadata docs explain how metadata reaches n8n.
Any chat front end that can POST chatInput, sessionId and metadata to a webhook and read { "output": "..." } back will work. N8N Chat UI is built for exactly this.
What happens when a slot goes stale
Someone else can book a time in the gap between the bot offering it and the visitor confirming. If the booking call comes back with an error, the tool does not show a raw error. It checks availability again and hands the agent a fresh set of options, which the agent presents as: that time is not available, here is what is open.
Any error is treated as a reason to recover, and the message is deliberately non-committal: not available right now rather than just taken. That is because the calendar API can reject a slot that was not really taken, so the recipe does not claim more certainty than it has. The visitor sees a normal recovery, not a broken bot.
Troubleshooting
I get a 403 from Calendly
Almost always the plan gate. The Scheduling API needs a paid plan, so check your Calendly plan before anything else.
The bot offers times that do not match my availability
Check days_ahead first, because of the cap described above. If the times themselves are wrong, that comes from your Calendly account's availability settings for the event type, not from this workflow.
Bookings are not appearing in Calendly
Check the credential is attached to the HTTP nodes in both tool workflows, and that your event type values in the settings are full URIs, not slugs or short links.
Why two event types?
Routing a prospect and an existing customer into different calendars up front avoids a manual reshuffle later. If you only run one kind of call, use the same URI for both.
Does this also write a CRM contact?
Not in this version. The natural place to add that is the successful path of book slot, calling a lead capture tool from the HubSpot or ActiveCampaign recipes.
My conversations reset when n8n restarts
Memory is an in-memory buffer so the template works as soon as you import it. A restart or redeploy drops conversations in progress. Before a busy launch, swap Conversation memory for Postgres Chat Memory. Nothing else changes.
I get a 401 as soon as I test
The Request from your widget? check compares metadata.webhook_secret in the request with webhook_secret in Chatbot settings. If they differ, or the request has no metadata, the workflow returns a 401 before the agent runs.
Take it further
The chat side is identical for any scheduler. A Cal.com version is available if that fits your stack better.