# A LINE booking bot, set up from Codex.

> Have Codex set your LINE OA to take booking requests: the AI asks name, date, time and party size, and staff confirm. It doesn't check availability.

Web page: https://agentlab.cresclab.com/en/channels/line/codex-booking  
繁體中文 (Markdown): https://agentlab.cresclab.com/channels/line/codex-booking.md

Codex × LINE bookings · Agent Lab

When someone asks to book on LINE, the AI asks for name, date, time and party size one at a time, and your staff confirm from the chat. It can't see availability or write to a calendar, so the sample tells it to say “received”, never “confirmed”.

[Sign up free](https://app.agentlab.cresclab.com/?lang=en&intent=channels) [Don't code? We'll set it up](https://agentlab.cresclab.com/en/channels/line/codex-booking#demo)

Use Codex? [See the sample instructions](https://agentlab.cresclab.com/en/channels/line/codex-booking#recipe).

Codex sets the booking rules as a LINE Official Account's instructions, then reads which messages the test account sent. Illustration.

How it takes bookings

## It collects the details; staff confirm

### Asks one thing at a time

Name, date, time, party size: whatever the customer leaves out, it asks next.

### Follows your rules

Write in closed days, slots and party limit and it tells customers. It doesn't know today's date, so staff check dates.

### Told never to say “confirmed”

It can't see your availability, so the instructions make it say “received”. Book once yourself to check.

### Test first, then open

It answers only your test account until you approve, so book once yourself first.

What it can and can't do

## What the AI does, and what stays with staff

In a LINE booking bot: what the AI does and what staff do

| Each part of a booking | The AI | Your staff |
| --- | --- | --- |
| Name, date, time, party size | Asks for each, then repeats them back | Nothing |
| Checking availability | Can't: no link to a booking system or calendar | Read the chat and reply |
| Recording the booking | Can't: it writes to no system | Record it where you already do |
| Telling staff about a new request | Sends no alert | Check chats in LINE Official Account Manager (chat must be on) |
| Changes, cancellations | Asks for the original date and the change | Confirm and handle it |

Steps

## A LINE booking bot in four steps

1. ### Connect LINE from Codex
   Follow [the four steps](https://agentlab.cresclab.com/en/channels/line/codex). No Official Account yet? Start in the shared sandbox.
2. ### Write your booking rules down
   Edit the sample below: what to ask, which slots you don't take, what to say at the end.
3. ### Have Codex set them
   Paste the instructions to Codex. It updates them and the next message follows.
4. ### Test, then approve
   Ask from your test account the way a customer would, and fix what it gets wrong. Then approve answering every friend.

Sample

## Sample booking rules and prompt

Swap in your name, slots and party limit. Keep the last two lines: it can't see availability, so it must not promise.

Edit and use

### Sample instructions

```
You take booking requests for the LINE Official Account of "Komori Coffee".

Bookable: Tuesday to Sunday 11:00–17:00, closed Monday.
Up to 6 people per booking; for 7 or more, ask for a phone number and staff will call.

When someone wants to book, ask one at a time: name, date (with the day of the week), time, party size.
If the slot is outside the bookable hours, say so and ask for another time.
When you have all four, repeat them back, then reply:
"We've received your booking request. Our staff will confirm here."

You can't see availability. Never say "confirmed" or "reserved for you".
For a change or cancellation, ask for the original date and name, and say staff will confirm.
```

- `4,000 characters` the limit for the instructions.
- `12 messages` it reads the last 12 messages of a conversation, enough to complete one booking.
- `Dates` it doesn't know today's date, so it asks for the day of the week and staff check it.

Prompt

### Then say this to Codex

```
Set the text below as my LINE Official Account's instructions, answering only my test account for now. I'll then book once from the test account; and paste you its replies, so you can check that it asked for name, date, time and party size, and never said the booking was confirmed.

(paste your instructions)
```

When it doesn't work

## What went wrong, and what to do

Common problems when connecting LINE from Codex, their cause and the fix

| What you see | Why | What to do |
| --- | --- | --- |
| Codex has no line_ tools | The setup was added while Codex was running, or the token variable is empty. | Check that LINE_AGENT_SDK_TOKEN is set in the same shell, then restart Codex. |
| Codex can't connect: 401 | The agent token is missing, wrong or revoked. | Create a new one on the panel's Agent tokens page and put it in the variable. |
| Codex can't connect: 503 | The service isn't set up yet: a required variable such as GOOGLE_CLIENT_ID is missing. | Add it in the project's settings and restart the service. [Settings →](https://agentlab.cresclab.com/docs/en/channels/quickstart#settings) |
| It says the connection isn't live yet | A step is still waiting, usually for you: entering the channel or turning on Use webhook. | Ask Codex whose turn it is. It reads the progress and gives you the link for that step. |
| People get two replies | The Official Account's own auto-response is still on. | LINE Official Account Manager › Settings › Response settings › turn auto-response off. |
| It replies “Agent 收到…” instead of an answer | No model key is set, so it sends a fixed text. | Add AGENTLAB_GATEWAY_KEY in the project's settings and restart the service. |
| Only I get answers | By design: it answers your paired test account until you approve every friend. | Ask Codex to request going live, then approve it signed in. An account that forwards to an existing system can't answer every friend. |
| No reply to a photo or sticker | It answers text messages only. | A person replies to those for now. |

FAQ

## LINE booking bot with Codex: questions

**Can I build a LINE booking bot with Codex?**

You can build one that takes booking requests: the AI asks for name, date, time and party size on LINE, and your staff confirm from the chat. It doesn't check availability or write to a calendar, so confirming stays with a person. [Connect LINE from Codex →](https://agentlab.cresclab.com/en/channels/line/codex)

**Does a booking go into Google Calendar or a booking system?**

Not today. The AI answers from your instructions and the current conversation, and connects to no calendar or booking system. The details stay in the LINE chat, and staff record them where they already do.

**How do staff find out about a new request?**

It sends no alert. With chat turned on for the Official Account, staff can read what customers sent in LINE Official Account Manager and reply there once they've checked. The AI can't see what staff reply there.

**Does the AI remember details given across several messages?**

Yes. It reads the last 12 messages of the conversation, so when a customer gives the name, date and party size separately, it asks for whatever is still missing.

**Will the AI see my Channel Secret?**

No. The Channel ID and Secret are entered on the service's own page, and the AI tool only gets an agent token from an environment variable. Never paste a secret into the chat. [LINE OA MCP tools →](https://agentlab.cresclab.com/docs/en/channels/mcp-tools)

**Can I try it without a LINE Official Account?**

Yes. A shared sandbox gives you a join code: add it as a friend, send the code, and your AI answers you there. Creating a real Official Account is done by you in LINE Official Account Manager; LINE offers no API for it.

**Do AI replies count toward LINE's message quota?**

Under LINE's Official Account plans, replies to a user don't count toward the monthly message count; only push messages do. The agent replies by default and pushes only when the reply window has passed.

## Sign up free, or have us connect it.

[Sign up free](https://app.agentlab.cresclab.com/?lang=en&intent=channels)

Don't code? Tell us what you need and we'll connect your LINE OA:

- What the AI should answer: opening hours, common questions, bookings
- Whether you already have a LINE Official Account
- When you would like it live

Use Codex? [Connect it yourself in four steps](https://agentlab.cresclab.com/en/channels/line/codex-booking#how)
