AI scheduling API contract architecture

    AI Scheduling API Versioning: Change the Contract Without Stranding Open Meetings

    By Tevye Krynski18 min read

    Version two adds approved substitutes and a new participant state. The deployment is clean. New requests pass. Meanwhile, 183 open meetings resume from old checkpoints, one worker reads a missing field as false, and required people quietly become optional. Like the fools we are, we versioned the endpoint and forgot the work can stay alive for days.

    Version the API without rewriting an open hard meeting

    Use one meeting that remains open through a deployment: four required people, two optional people, Google and Microsoft calendars, one unconnected participant, three IANA zones, an outstanding reminder, a pending approval, one provider retry, and a new API contract that adds substitutes and changes error structure.

    1. 1

      Persist a versioned meeting-intent envelope before side effects

      Store meeting ID, authenticated organizer, purpose, duration, bounded date range, booking deadline, IANA meeting zone, required and optional participant entities, approved substitutes, working hours, buffers, outreach authority, disclosure, approval mode, organizer calendar, and terminal proof. Add immutable wire_schema_version, domain_schema_version, workflow_version, policy_version, and provider-adapter versions.
      • Required attendance cannot change because an absent field receives a new default.
      • The original request and normalized intent remain linked as provenance.
      • A missing identity, zone, or authority enters a typed exception instead of a guessed migration.
    2. 2

      Separate transport, domain, workflow, policy, and provider versions

      The REST or MCP input schema controls what clients may send. The domain schema controls how the meeting is stored. Workflow code controls valid transitions and durable waits. Policy controls attendance, reminders, approvals, evidence freshness, and disclosure. Provider adapters control Google and Microsoft request and response mapping. Give each boundary its own version so one compatible wire change does not silently alter an in-flight decision.
      • API documentation version is not treated as the workflow version.
      • A provider SDK upgrade cannot rewrite participant policy by accident.
      • Every terminal result records the versions that produced it.
    3. 3

      Make the edge additive and normalize once

      Prefer additive optional fields, explicit enums with unknown handling, and stable identifiers. Validate client input against the declared REST or MCP schema, then normalize it into one supported domain version before outreach. Reject incompatible ambiguity with a typed problem response. Never let every worker reinterpret raw client payloads under whichever code happens to be deployed that day.
      • New optional fields have declared semantics and do not change old defaults.
      • Unknown enum values survive or fail according to a documented compatibility rule.
      • OpenAPI or MCP validation proves shape, not organizer consent or meeting authority.
    4. 4

      Pin open meetings to deterministic workflow behavior

      When a meeting starts, bind its workflow and policy versions. Route every timer, participant reply, webhook wake-up, retry, approval, and provider result back to workers that understand those versions. Keep old code paths available while open instances depend on them. Microsoft’s Durable Functions guidance shows why adding, removing, or reordering durable calls can break replaying instances; scheduling workflows have the same practical risk even on another engine.
      • A deployment cannot insert a new reminder or calendar write into old execution history by surprise.
      • Old instances do not deserialize a changed activity result into a new incompatible type.
      • Routing and retention metrics show how many meetings remain on each version.
    5. 5

      Migrate only at a named safe checkpoint

      Define checkpoints such as intent accepted before outreach, evidence complete before proposal, or proposal expired before recompute. A migration reads old state, verifies organizer authority, maps participants and evidence without loss, writes a new revision plus migration receipt atomically, and schedules the next action under the new version. Do not migrate across an uncertain message delivery, provider write, consent change, or pending approval.
      • Every required and optional role has an exact target mapping.
      • Connected free/busy and conversational windows keep source, zone, freshness, consent, and expiry.
      • A failed migration leaves the old instance runnable rather than half-converted.
    6. 6

      Run old and new provider and fallback paths against fixtures

      Replay redacted fixtures for Google free/busy, Microsoft getSchedule, provider denial, revoked access, empty busy results, duplicate webhooks, and event-write timeouts. Run conversational replies with missing dates, ambiguous zones, correction, silence, opt-out, and late arrival. Compare normalized evidence and next decisions under both versions before shifting live meetings.
      • Provider response fields that disappear or change type fail closed.
      • Calendar connection remains optional; migration does not delete the no-sync path.
      • A response parser upgrade cannot turn unknown availability into a slot.
    7. 7

      Keep side-effect identity and consent stable across versions

      Namespace idempotency by logical meeting action, not deployment. A reminder already sent under version one remains the same reminder when version two receives the retry. Re-check current meeting revision, participant consent, evidence freshness, approval, and provider authority before every side effect. Reconcile uncertain writes before replay and keep old and new workers from claiming the same action concurrently.
      • A migration cannot send a second participant request for the same purpose and deadline.
      • Retry budgets and reminder caps survive version changes.
      • New code cannot widen participant, disclosure, time, or calendar scope during replay.
    8. 8

      Verify completion and retire a version with evidence

      Before reporting booked, read back the canonical organizer event and verify provider identity, calendar, start, end, zone, every required attendee, approved optional decisions, and conferencing or location. Trace the meeting from client contract through normalization, pinned workflow, participant evidence, migration if any, provider calls, retries, repair, and terminal proof. Retire old workers only when no runnable, waiting, repairable, or replayable meeting still references them.
      • A successful migration is progress, not meeting completion.
      • Dashboards expose version population, oldest open instance, migration failures, replay errors, and completion rate by version.
      • Rollback restores compatible workers and routing without changing action identities.

    Endpoint versioning is the smallest part of the problem

    A scheduling request can outlive an HTTP request, deploy, provider outage, participant vacation, and calendar credential. The wire contract may have returned 202 Accepted days before the meeting reaches approval or booking. Versioning only the URL leaves every durable checkpoint exposed to new domain defaults, workflow branches, activity signatures, and provider mappings.

    Treat an open meeting as a durable program with human and provider inputs. Pin the behavior needed to replay that program honestly. New clients can use a new contract while old meetings continue under the behavior they started with.

    Schema compatibility does not prove behavioral compatibility

    OpenAPI supplies a machine-readable contract and Schema Objects; MCP tools expose JSON Schema input and optional output structure. Those schemas are valuable for validation and generated clients. They cannot prove that changing an optional participant default, reminder policy, freshness window, or provider fallback preserves the same meeting outcome.

    Add behavioral fixtures beside schema tests. Given the same intent, replies, free/busy, time zones, consent, provider failures, and approval, old and new versions should produce an explicitly accepted difference or the same next action. Diff the meeting decision, not only the JSON shape.

    Migrations must preserve participant work

    A person already paid the coordination tax when they connected free/busy, returned bounded availability, declined outreach, approved a slot, or corrected a zone. A deployment is an internal event. It should not make participants repeat current work or receive duplicate reminders.

    Carry identity, role, evidence source, consent, reply time, freshness, expiry, correction history, and transport correlation into the new revision. Ask again only when the meeting changed, evidence expired, consent changed, or an authorized policy requires it.

    A poll, link, sync utility, or drafted message avoids this boundary

    A poll stores votes. A booking link exposes configured slots. A sync utility copies calendar state. A drafting assistant prepares the next message. Direct calendar APIs read and write provider resources. Each can be upgraded without owning the whole long-running participant state.

    Scheduling execution carries one instruction through required and optional people, connected and unconnected evidence, durable waits, approval, provider writes, repair, and verified invitations. The versioning burden comes with that completion boundary. WonderCal’s direction is to own it beneath an agent-facing contract rather than hand it to every developer.

    Run the deployment-in-the-middle acceptance test

    Start a version-one meeting, send one outreach message, wait on one Microsoft calendar, accept one conversational reply, and queue an approval. Deploy version two with a new substitute field, changed activity result, reordered reminder, new error object, and updated provider adapter. Duplicate one retry and hide the final event-write response.

    Pass when the open meeting stays on deterministic behavior or migrates at a proved checkpoint, participant work survives, no side effect duplicates, uncertain writes reconcile, and one correct event is verified. Fail when only new meetings pass because the test suite forgot the ones already waiting.

    Compare API versioning by what happens to open meetings

    The deciding test is whether a deployment can change contracts and workers while every waiting participant and uncertain provider action remains safe and recoverable.

    Execution completion

    One mutable API and worker fleet

    New requests may pass while open meetings resume under changed defaults, signatures, branches, and provider behavior.

    Custom versioned scheduling orchestrator

    Can pin or migrate each meeting from typed intent through durable waits, event write, read-back, and completion.

    WonderCal execution direction

    Target path keeps the agent contract and open hard meetings compatible through verified invitations or bounded recovery.

    Cross-company reach

    One mutable API and worker fleet

    Provider and participant changes land directly in one fleet, increasing the number of unversioned combinations.

    Custom versioned scheduling orchestrator

    The team can version Google, Microsoft, tenant, identity, and participant-channel adapters independently.

    WonderCal execution direction

    Target design covers required and optional people across providers, companies, and mixed connection states under one meeting revision.

    Optional-sync fallback

    One mutable API and worker fleet

    A new calendar field or provider adapter can become an accidental requirement for meetings that began with conversational evidence.

    Custom versioned scheduling orchestrator

    Can preserve no-sync replies and parser behavior as versioned evidence and workflow inputs.

    WonderCal execution direction

    Target model treats calendar connection as helpful while keeping consented conversation inside every supported contract version.

    Recovery and observability

    One mutable API and worker fleet

    Logs show deployment and request errors, but replay mismatch, stranded versions, duplicate side effects, and migration loss need more state.

    Custom versioned scheduling orchestrator

    Full control over routing, workers, migrations, fixtures, retries, traces, rollback, and retirement operations.

    WonderCal execution direction

    Target release should expose meeting version, pending state, migration, participant evidence, provider outcomes, repair, and proof.

    Time to ship

    One mutable API and worker fleet

    Fast until a contract change meets a days-long workflow and old checkpoints need emergency compatibility code.

    Custom versioned scheduling orchestrator

    Rational when durable scheduling contracts and migration operations are infrastructure the team wants to own.

    WonderCal execution direction

    Worth adopting when the live contract carries compatibility and completion work the product team does not need to build.

    Frequently asked questions

    Why does an AI scheduling API need workflow versioning?

    A hard meeting can wait on people and providers across several deployments. Changing activity signatures, durable branches, defaults, policies, or provider mappings can break an open meeting even when the HTTP endpoint remains available. Pin or safely migrate the behavior each meeting needs to resume.

    Is adding an optional API field always backward compatible?

    Not behaviorally. A new field can change defaults, participant roles, policy selection, storage, retries, or provider requests. Keep the wire change additive, normalize once, test old clients and open meetings, and require an explicit migration for any changed decision semantics.

    When is it safe to migrate an open scheduling workflow?

    Use a named checkpoint with no uncertain side effect or pending approval. Verify organizer authority, map every participant and evidence object without loss, write the new revision and migration receipt atomically, and keep the old instance runnable if conversion fails.

    How should idempotency keys behave across API versions?

    Bind them to the logical meeting action and authorized revision, not the deployed code version. A reminder, free/busy refresh, booking, reschedule, or cancellation remains the same logical action when a new worker handles its retry. Reconcile uncertain external writes before replay.

    Where can developers review WonderCal’s API direction?

    Visit WonderCal for AI agents. Verify the current wire contract, meeting state, compatibility policy, participant fallback, retries, migration behavior, observability, provider read-back, and completion proof before production use.

    Primary sources

    Related WonderCal reading

    Deploy while the meeting is waiting

    Change one schema, reorder one durable call, duplicate one reminder, update a provider adapter, and hide the event-write response. Require the open meeting to finish once.

    Review WonderCal for AI agents