Use casesRecipes

Fitness & Wellness Class Booking

Let members browse class schedules, view trainer profiles, choose a membership tier or pay per session, and book — over WhatsApp and web chat.

DifficultyIntermediate
TrackBuilder Track or Developer Track
ChannelsWhatsAppWeb Chat
IntegrationsGoogle Calendar (class schedule)Stripe (payments)Trainer/class data (knowledge base)

What you'll build

An agent that handles the full class booking flow: browse the weekly schedule, read trainer profiles and class descriptions, check live availability via Google Calendar, choose a membership tier or pay per session via Stripe, and receive a booking confirmation. Members and drop-ins are both handled in the same conversation.

Prerequisites

  • BimpeAI account with an API key (sk_…)
  • Read Anatomy of a workflow agent first — this recipe skips steps covered there
  • Google Calendar and Stripe connected in the Console dashboard (see Step 4)
  • WhatsApp Business number and/or web chat widget connected in the Console dashboard (see Step 4)

Steps

1. Find the workflow

import { BimpeAI } from "@bimpeai/sdk";

const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });

const page = await bimpe.workflows.list({ scope: "public", search: "fitness" });
const workflow = page.data[0];
console.log(workflow.id, workflow.name);
import os
from bimpeai import BimpeAI

client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])

page = client.workflows.list(scope="public", search="fitness")
workflow = page.data[0]
print(workflow.id, workflow.name)

2. Create the agent

const agent = await bimpe.agents.create(
  {
    name: "Fitness booking agent",
    system_prompt:
      "You help clients browse and book fitness and wellness classes. " +
      "Describe class types, trainer profiles, and membership tiers from the knowledge base. " +
      "Check class availability and remaining spaces via the Google Calendar integration. " +
      "For pay-per-session clients, collect payment via Stripe before confirming the booking. " +
      "For members, confirm their membership tier and book directly into the calendar. " +
      "Always state the cancellation policy before finalising a booking.",
    agent_workflow_id: workflow.id,
  },
  { idempotencyKey: "create-fitness-booking-agent-v1" },
);

console.log(agent.id);
agent = client.agents.create(
    name="Fitness booking agent",
    system_prompt=(
        "You help clients browse and book fitness and wellness classes. "
        "Describe class types, trainer profiles, and membership tiers from the knowledge base. "
        "Check class availability and remaining spaces via the Google Calendar integration. "
        "For pay-per-session clients, collect payment via Stripe before confirming the booking. "
        "For members, confirm their membership tier and book directly into the calendar. "
        "Always state the cancellation policy before finalising a booking."
    ),
    agent_workflow_id=workflow.id,
    idempotency_key="create-fitness-booking-agent-v1",
)

print(agent.id)

3. Add knowledge bases

Three knowledge bases cover the class catalogue, trainer profiles, and membership tiers. The agent uses all three to answer questions and guide the payment step.

// Class schedule and descriptions
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Classes",
  content:
    "YOGA FLOW — Mon/Wed/Fri 07:00 and 18:30 — 60 min — all levels — max 16 — with Priya\n" +
    "HIIT CIRCUIT — Tue/Thu 06:30 and 17:30 — 45 min — intermediate — max 20 — with Marcus\n" +
    "PILATES REFORMER — Mon/Wed 10:00 and Sat 09:00 — 55 min — beginner friendly — max 10 — with Sofia\n" +
    "SPIN — Tue/Thu/Sat 07:00 and 19:00 — 45 min — all levels — max 24 — with Dani\n" +
    "MEDITATION & BREATHWORK — Sun 09:00 — 45 min — all levels — max 20 — with Priya\n" +
    "BOXING FITNESS — Tue/Thu 18:00 — 60 min — beginner friendly — max 12 — with Marcus\n\n" +
    "Cancellation policy: cancel at least 6 hours before the class to avoid a missed-class charge. " +
    "Pay-per-session cancellations: credit applied to next booking. Member cancellations: counted against monthly allowance.",
});

// Trainer profiles
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Trainers",
  content:
    "Priya — certified yoga instructor (500hr RYT) and mindfulness coach — 8 years experience — " +
    "specialises in vinyasa flow and restorative yoga\n" +
    "Marcus — strength and conditioning coach — NASM certified — specialises in HIIT and boxing fitness — " +
    "former semi-professional footballer\n" +
    "Sofia — STOTT Pilates certified instructor — 6 years experience — specialises in reformer Pilates " +
    "for rehabilitation and posture correction\n" +
    "Dani — indoor cycling instructor — certified spin coach — specialises in power and endurance rides — " +
    "creates bespoke playlists for each class",
});

// Membership tiers and pay-per-session pricing
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Membership and pricing",
  content:
    "PAY PER SESSION — £15/class — book and pay for individual classes with no commitment\n" +
    "STARTER MEMBERSHIP — £45/month — 4 classes per month — any class type — rolling monthly, cancel anytime\n" +
    "UNLIMITED MEMBERSHIP — £85/month — unlimited classes — priority booking 48h before general release — " +
    "includes 1 free guest pass per month\n" +
    "WELLNESS MEMBERSHIP — £110/month — unlimited classes + 1 x 60-min PT session per month + " +
    "10% discount on all retail products\n\n" +
    "Memberships auto-renew monthly. Cancel anytime with 30 days notice. " +
    "First month pro-rated if joining mid-month.\n" +
    "Student and NHS discount: 15% off all membership tiers — proof required at sign-up.",
});
# Class schedule and descriptions
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Classes",
    "content": (
        "YOGA FLOW — Mon/Wed/Fri 07:00 and 18:30 — 60 min — all levels — max 16 — with Priya\n"
        "HIIT CIRCUIT — Tue/Thu 06:30 and 17:30 — 45 min — intermediate — max 20 — with Marcus\n"
        "PILATES REFORMER — Mon/Wed 10:00 and Sat 09:00 — 55 min — beginner friendly — max 10 — with Sofia\n"
        "SPIN — Tue/Thu/Sat 07:00 and 19:00 — 45 min — all levels — max 24 — with Dani\n"
        "MEDITATION & BREATHWORK — Sun 09:00 — 45 min — all levels — max 20 — with Priya\n"
        "BOXING FITNESS — Tue/Thu 18:00 — 60 min — beginner friendly — max 12 — with Marcus\n\n"
        "Cancellation policy: cancel at least 6 hours before the class to avoid a missed-class charge. "
        "Pay-per-session cancellations: credit applied to next booking. Member cancellations: counted against monthly allowance."
    ),
})

# Trainer profiles
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Trainers",
    "content": (
        "Priya — certified yoga instructor (500hr RYT) and mindfulness coach — 8 years experience — "
        "specialises in vinyasa flow and restorative yoga\n"
        "Marcus — strength and conditioning coach — NASM certified — specialises in HIIT and boxing fitness — "
        "former semi-professional footballer\n"
        "Sofia — STOTT Pilates certified instructor — 6 years experience — specialises in reformer Pilates "
        "for rehabilitation and posture correction\n"
        "Dani — indoor cycling instructor — certified spin coach — specialises in power and endurance rides — "
        "creates bespoke playlists for each class"
    ),
})

# Membership tiers and pay-per-session pricing
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Membership and pricing",
    "content": (
        "PAY PER SESSION — £15/class — book and pay for individual classes with no commitment\n"
        "STARTER MEMBERSHIP — £45/month — 4 classes per month — any class type — rolling monthly, cancel anytime\n"
        "UNLIMITED MEMBERSHIP — £85/month — unlimited classes — priority booking 48h before general release — "
        "includes 1 free guest pass per month\n"
        "WELLNESS MEMBERSHIP — £110/month — unlimited classes + 1 x 60-min PT session per month + "
        "10% discount on all retail products\n\n"
        "Memberships auto-renew monthly. Cancel anytime with 30 days notice. "
        "First month pro-rated if joining mid-month.\n"
        "Student and NHS discount: 15% off all membership tiers — proof required at sign-up."
    ),
})

4. Connect channels and integrations (dashboard)

Google Calendar, Stripe, and channels are configured in the dashboard

The API cannot create integrations or channel connections. Connect Google Calendar, Stripe, and your messaging channels in the Console dashboard. The SDK lets you list what is active but cannot modify the connections.

  1. Open Console dashboardAgents → select your agent.
  2. Under Channels, connect your WhatsApp Business number.
  3. Under Channels, enable the web chat widget and paste the embed snippet into your fitness studio website.
  4. Under Integrations, connect Google Calendar. Each class should appear as a recurring event with attendee capacity tracked so the agent can check remaining spaces.
  5. Under Integrations, connect Stripe to collect pay-per-session payments and process new membership sign-ups.

5. Verify and go live

const integrations = await bimpe.agents.integrations.list(agent.id);
const channels = await bimpe.agents.channels.list(agent.id);
console.log("Integrations:", integrations.map((i) => i.name));
console.log("Channels:", channels.map((c) => c.type));
integrations = client.agents.integrations.list(agent.id)
channels = client.agents.channels.list(agent.id)
print("Integrations:", [i.name for i in integrations])
print("Channels:", [c.type for c in channels])

Full example

import { BimpeAI } from "@bimpeai/sdk";

const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });

// 1. Find workflow
const page = await bimpe.workflows.list({ scope: "public", search: "fitness" });
const workflow = page.data[0];

// 2. Create agent
const agent = await bimpe.agents.create(
  {
    name: "Fitness booking agent",
    system_prompt:
      "You help clients book fitness classes. Describe classes, trainers, and membership tiers. " +
      "Check availability via Google Calendar. Collect Stripe payment for pay-per-session bookings. " +
      "State the cancellation policy before confirming.",
    agent_workflow_id: workflow.id,
  },
  { idempotencyKey: "create-fitness-booking-agent-v1" },
);

// 3. Add knowledge bases
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Classes",
  content:
    "Yoga Flow — Mon/Wed/Fri 07:00 and 18:30 — 60 min — with Priya\n" +
    "HIIT Circuit — Tue/Thu 06:30 and 17:30 — 45 min — with Marcus\n" +
    "Spin — Tue/Thu/Sat 07:00 and 19:00 — 45 min — with Dani",
});

await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Membership and pricing",
  content:
    "Pay per session: £15/class\n" +
    "Starter: £45/month (4 classes)\n" +
    "Unlimited: £85/month\n" +
    "Wellness: £110/month (unlimited + monthly PT session)",
});

// 4. Verify integrations and channels (configured via dashboard)
const integrations = await bimpe.agents.integrations.list(agent.id);
const channels = await bimpe.agents.channels.list(agent.id);
console.log("Agent ID:", agent.id);
console.log("Integrations:", integrations.map((i) => i.name));
console.log("Channels:", channels.map((c) => c.type));

// 5. Stream incoming booking conversations
const controller = new AbortController();

for await (const event of bimpe.conversations.messages.stream(
  agent.id,
  "<conversation_id>",
  { signal: controller.signal },
)) {
  console.log(event.role, event.message);
}
import os
from bimpeai import BimpeAI

client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])

# 1. Find workflow
page = client.workflows.list(scope="public", search="fitness")
workflow = page.data[0]

# 2. Create agent
agent = client.agents.create(
    name="Fitness booking agent",
    system_prompt=(
        "You help clients book fitness classes. Describe classes, trainers, and membership tiers. "
        "Check availability via Google Calendar. Collect Stripe payment for pay-per-session bookings. "
        "State the cancellation policy before confirming."
    ),
    agent_workflow_id=workflow.id,
    idempotency_key="create-fitness-booking-agent-v1",
)

# 3. Add knowledge bases
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Classes",
    "content": (
        "Yoga Flow — Mon/Wed/Fri 07:00 and 18:30 — 60 min — with Priya\n"
        "HIIT Circuit — Tue/Thu 06:30 and 17:30 — 45 min — with Marcus\n"
        "Spin — Tue/Thu/Sat 07:00 and 19:00 — 45 min — with Dani"
    ),
})

client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Membership and pricing",
    "content": (
        "Pay per session: £15/class\n"
        "Starter: £45/month (4 classes)\n"
        "Unlimited: £85/month\n"
        "Wellness: £110/month (unlimited + monthly PT session)"
    ),
})

# 4. Verify integrations and channels (configured via dashboard)
integrations = client.agents.integrations.list(agent.id)
channels = client.agents.channels.list(agent.id)
print("Agent ID:", agent.id)
print("Integrations:", [i.name for i in integrations])
print("Channels:", [c.type for c in channels])

# 5. Stream incoming booking conversations
for event in client.conversations.messages.stream(agent.id, "<conversation_id>"):
    print(event.role, event.message)

Deploy

Store your API key in BIMPEAI_API_KEY. Confirm that both Google Calendar and Stripe appear in integrations.list before opening bookings — Stripe is required for pay-per-session checkout. Update the class schedule knowledge base whenever the timetable changes using knowledgeBases.update. Use a stable idempotencyKey to prevent duplicate agents on redeploy.

Variations

  • Add a new-joiner discount knowledge base entry for the agent to apply automatically when a client mentions it is their first visit.
  • Send a class reminder to WhatsApp 2 hours before the session using conversations.messages.send from a scheduled script.
  • Create a separate agent for corporate wellness packages with a bespoke pricing knowledge base and a dedicated web chat channel on a B2B landing page.

On this page