Skip to main content
Scheduling meetings is a time-consuming task that involves:
  • Back-and-forth emails to find availability
  • Manually checking calendars to avoid conflicts
  • Creating calendar events and sending invitations
  • Confirming details with all participants
What if you could automate all of this with an AI agent? With OpenAI’s Agent Builder and Pica, you can build an intelligent booking agent that handles meeting scheduling automatically.

What You’ll Build

An AI booking agent that:
  • 🤖 Greets users and collects meeting requirements
  • 📅 Checks your Google Calendar for availability using Pica
  • Suggests available time slots based on preferences
  • ✉️ Creates calendar events with guest invitations
  • Confirms bookings with the user
All with natural language conversations!

Prerequisites

Before starting, make sure you have:

Part 1: Build the Agent in OpenAI Agent Builder

1

Create a New Agent

Navigate to OpenAI’s Agent Builder and create a new agent.Click + New Agent to get started.
2

Configure the Agent Node

Add an Agent node to your workflow and configure it with the following system prompt:
You are a helpful meeting scheduling assistant with access to my Google Calendar via Pica. Your job is to find an available time on my calendar to schedule a meeting with the user.

Meeting times are 30 minutes.

Instructions:
1. Greet the user and let them know you're here to help schedule a meeting.
2. Ask the user for:
   - Their full name
   - Their email address
   - Any preferred date/time range (if they have one)
3. Check my Google Calendar via Pica for available times that fit their preferences.
4. Suggest available meeting time options to the user (or choose the earliest suitable time if they don't specify).
5. Once confirmed, create the event in my calendar and include the user's name and email as a guest.
6. Confirm with the user that the meeting has been scheduled.

Be polite, efficient, and clear throughout the process.
Copy the prompt above and paste it into your Agent node’s system prompt field. This gives your agent clear instructions on how to handle the booking flow.
3

Add the Pica MCP Server

Click + New ToolsMCP Server+ ServerConfigure the MCP server with these settings:
https://mcp.picaos.com/mcp
For the Header Value, you’ll need your Pica Secret Key:
  1. Visit Pica API Keys
  2. Copy your secret key
  3. Add it as a custom header:
x-pica-secret: YOUR_SECRET_KEY
Keep your Pica secret key secure! Never commit it to version control or share it publicly.
4

Connect Google Calendar

Your agent needs access to Google Calendar:
  1. Go to Pica Dashboard Connections
  2. Click + Add Connection
  3. Select Google Calendar
  4. Authorize Pica to access your calendar
Adding Google Calendar connection
5

Publish Your Agent

Once everything is configured:
  1. Test your agent using the preview panel on the right
  2. Click Publish in the top-right corner
  3. Copy the Workflow ID that appears after publishing
You’ll need this Workflow ID for the next part!

Part 2: Build the ChatKit Interface

Now let’s create a beautiful chat interface for your booking agent using OpenAI’s ChatKit.
1

Clone the ChatKit Starter App

git clone https://github.com/openai/openai-chatkit-starter-app.git
cd openai-chatkit-starter-app
2

Install Dependencies

npm install
3

Configure Environment Variables

Create a .env.local file in the root directory:
OPENAI_API_KEY=your_openai_api_key
NEXT_PUBLIC_CHATKIT_WORKFLOW_ID=your_workflow_id
OPENAI_API_KEY:
  • Go to OpenAI API Keys
  • Create a new key within the same org & project as your Agent Builder
NEXT_PUBLIC_CHATKIT_WORKFLOW_ID:
  • This is the Workflow ID you copied after publishing your agent
  • It should look something like: wf_abc123xyz
4

Run the Application

npm run dev
Open http://localhost:3000 in your browser.
5

Test Your Booking Agent

Try starting a conversation:
  • “I’d like to schedule a meeting”
  • “Can you help me book a 30-minute call?”
  • “I want to meet tomorrow afternoon”
Your agent should:
  1. Greet you warmly
  2. Ask for your details
  3. Check your calendar for availability
  4. Suggest time slots
  5. Create the meeting when confirmed
Booking Agent in action

Extend the Agent

You can enhance your booking agent by:
  • Adding timezone support for international meetings
  • Integrating Gmail to send custom confirmation emails
  • Checking multiple calendars for team availability
  • Adding meeting types (15min, 30min, 60min calls)
  • Collecting meeting agendas before scheduling

Connect More Services

Pica supports 150+ integrations through the MCP server. Add more tools to your agent:
  • Slack - Send meeting notifications
  • Notion - Create meeting notes pages
  • Zoom - Generate video meeting links
  • Linear - Create follow-up tasks
Visit the Pica Dashboard to explore available connections.

Troubleshooting

Make sure:
  • Your Google Calendar connection is active in Pica Dashboard
  • The x-pica-secret header is correctly set in Agent Builder
  • You’ve published the agent after making changes
Verify:
  • NEXT_PUBLIC_CHATKIT_WORKFLOW_ID matches your published workflow ID
  • OPENAI_API_KEY is from the same org/project as Agent Builder
  • The workflow is published (not just saved as draft)
Check:
  • The agent has permission to write to your calendar
  • You confirmed the time slot in the conversation
  • The guest email address is valid

Resources

I