Content

How to Stop an AI Agent From Booking the Same Meeting Twice

A scheduling agent that checks availability and then books the slot has a gap between those two steps — and a retry can fall straight into it. Here's how Swytchcode closes that gap.

EngineeringNov 4, 2026

Key takeaways

  • -Booking a meeting is a two-step action — check availability, then create the event — and the gap between those steps is where a double-booking usually comes from, not the retry alone.
  • -A "create event" call is a classic non-idempotent write: call it twice and most calendar APIs will happily create two events in the same slot rather than recognizing a repeat.
  • -Swytchcode only auto-retries a calendar write when an idempotency key is attached to that call, so an unclear response to a booking attempt is surfaced instead of silently repeated.
  • -For bookings that matter — an external meeting, a shared resource, a slot that can't be undone easily — a policy can hold the create for a person to confirm before the invite actually goes out.
  • -Every booking attempt is logged, so when someone asks "did this actually get booked, and how many times," the answer comes from a record instead of checking two calendars by hand.

A scheduling agent checks a calendar, finds an open slot, and books it. If the booking call is slow to respond, or the connection drops before confirmation comes back, the agent doesn't know whether the meeting actually got created. It tries again. Now there are two invites for the same meeting — or worse, two different meetings sitting in the same slot, because the second attempt re-checked availability against a calendar that hadn't caught up yet.

Everyone on the thread gets a confusing second notification, and someone has to work out which invite is the real one.

Why booking is a two-step problem, not a one-step problem

Most scheduling flows are really two separate calls: check availability, then create the event. Each one is a moment where things can go wrong on its own, but the dangerous part is the gap between them. By the time the second call fires, the information from the first call might already be stale — someone else grabbed the slot, or the agent's own retry is racing against its first attempt that actually succeeded. A "create event" call, taken on its own, is a textbook non-idempotent write: call it twice with the same details and most calendar APIs will cheerfully create two separate events rather than noticing they're the same request.

How Swytchcode prevents the retry from creating a second invite

The rule here is the same one that governs every other write: Swytchcode only retries a calendar create automatically when an idempotency key is attached to that specific call. Where the calendar provider honors one, a retry after a dropped response returns the original event instead of making a new one. Where it doesn't — and plenty of calendar APIs don't — a failed or unclear response is surfaced as an error instead of quietly retried, because guessing that it's safe to book again is exactly how a slot ends up double-booked.

Setting it up

swy search <calendar-provider>
swy discover "create a calendar event" --project <calendar-provider>
swy info <calendar-provider>.<method>

swy info on the specific create-event method tells you whether that call is idempotency-aware before an agent is anywhere near it — not a generic statement about the provider, but the exact behavior of the exact call being used to book.

Policy: holding external or high-stakes bookings for confirmation

An idempotency key fixes the retry problem. It doesn't fix the other way a double-booking happens: the agent books correctly, once, but books the wrong thing — the wrong room, the wrong external attendee, a slot that conflicts with something not visible in the calendar it checked. For bookings where that matters — anything involving an outside party, a shared resource, or a meeting that's awkward to unwind — a policy can hold the create for a person to confirm in Slack or Telegram before the invite actually goes out.

The two controls do different jobs: idempotency makes a retry of a confirmed booking safe, and approval makes sure the booking was the right one before any invite is sent. For a routine internal sync, the idempotency check alone is usually enough. For anything external, the approval step is worth the extra few minutes.

Every booking attempt — the original call, any retry, any hold-for-approval — is written to a local log. When someone asks whether a meeting actually got booked, or booked twice, that log answers it directly instead of someone opening two calendars and comparing them by eye.

A double-booked meeting is almost never the agent choosing to book twice — it's a retry landing on a create call that was never made safe to repeat, in a flow where the check and the booking were always two separate moments. Close the gap with an idempotent create where the provider allows it, and put a person in front of the bookings that are expensive to get wrong.

FAQ

Can I build a scheduling agent with Swytchcode and trust it not to double-book?

Yes, with the same two-part answer as everywhere else in this series: the idempotency check keeps a retry from creating a second invite, and an approval policy on external or high-stakes bookings catches the cases where the booking itself, not the retry, was the problem.

Can I add a policy that requires approval for any booking with an external attendee?

Yes. A rule can match on attendee domain, room, or any other field in the booking request and hold it for a person to confirm before the invite is sent, the same mechanism used for high-value payment approvals.

If a booking call times out, does Swytchcode retry it automatically?

Only if that call carries an idempotency key. Without one, the timeout is surfaced as a failure rather than retried, since retrying an unprotected booking call is exactly how a slot ends up with two events in it.

Does checking availability first fully prevent a double-booking?

No, on its own. The check and the booking are two separate calls, and the gap between them is where a retry or a race against another process can still land. Treat the check as a hint, not a guarantee, and let the create call's own idempotency — or an approval step — do the actual protecting.

More content