How to make switch node route to a specific path first

Describe the problem/error/question

Hi there. I am having issues with my n8n workflow doing ‘double appointment’ bookings.

To summarise, this workflow is designed to:

  • Trigger when a VAPI agent receives a booking request via webhook
  • Check cal.com calendar availability
  • Book an appointment once a slot is confirmed to be available

Currently, the Switch node has a chance to trigger the ‘Book Appointment’ route first before the “Get Open Slots” route.

This causes the workflow to:

  1. Book the appointment
  2. Check if the appointment slot is available (which is no longer case, because the appointment has just been booked)
  3. Cause the VAPI agent to recommend the closest available slot (via its AI prompt in VAPI), leading to double bookings

What is the error message (if any)?

No error mesage - I think I just need assistance is ‘tweaking’ the workflow so that double bookings no longer occur.

Please share your workflow

Share the output returned by the last node

Output is to be expected - a cal.com appointment is made. However, as explained above, the workflow sometimes leads to double bookings due to a potential ‘mistake’ I have done in putting this together.

Information on your n8n setup

  • n8n version: 1.110.0
  • Database (default: SQLite): Not sure
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Not sure
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Web browser (Microsoft Edge)
  • Operating system: Windows 11 Pro

Hi @LNZMAI, your flow “splits” and both sides run at the same time, so you’re asking n8n to book and check availability at the same time.

You should make the workflow run sequential:

Webhook > Get Open Slots > IF slot chosen is available > Book Appointment > done
Else > Suggest next slots (and do not call Book Appointment on this path).

1 Like

Hi @ntoll01. Thanks for the advice. I followed your suggestion and came up with the following updated flow:

I did some test bookings - no double bookings so far. What do you think?

Looks great!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.