How to Write a Chatbot Script, With Template and Examples

For an AI agent, a script is a few fixed lines, a handful of rules, a path for each task and the facts it answers from. Six steps, a one-page template and three sample chats.

Oil painting of a river valley below the mountains
Chatbot script
On this page

A chatbot script is the plan for what your chatbot says and does: its fixed lines, the questions it must handle, the steps for each task and the point where a person takes over. For an AI agent, only a few lines are written word for word; the rest is rules, tasks and the facts it answers from. To write one, list the questions you really get, move the facts into your content, write a short path for each task, then fix the handful of lines that must never change. Below: six steps, a one-page template and three sample chats.

What is a chatbot script?

Every script covers the same parts: a greeting, the questions the chat must handle, the answers, what happens when it has no answer, the tasks, and the handover to a person. What changed is who writes each part. A button bot follows a decision tree, so its script spells out every message and every branch. An AI agent reads what the visitor types and writes its own reply, so its script spends its words on limits and tasks instead.

The same six parts, written for a button bot and for an AI agent.Button bot scriptAI agent script
GreetingWritten word for wordWritten word for word
Questions it handlesOnly the branches you drewAnything your content covers
AnswersOne fixed text per branchWritten by the agent from your facts
No answer"Sorry, I did not get that"A rule: say so, offer a person or a follow-up
TasksA form at the end of a branchA task path that ends in an action
HandoverA menu buttonA rule plus the live chat button

That is why many older guides on chatbot scripts run to dozens of branches: they script a menu. If your chat is a menu, write it that way. If visitors type their own questions, the rest of this guide is the shorter script you need.

Do you still need a script if your AI agent writes its own answers?

Yes, but a different one: the script is what keeps an AI agent on track, and most of it is not dialogue. The worry behind the question is fair. An agent that writes its own words can promise a date you cannot keep or quote a price you never published, unless something tells it not to. That something is the script, in four layers.

  • Fixed lines: the few texts shown exactly as you wrote them, such as the welcome message, the starter questions and the offline message. Example: "What would you like done, and when suits you?"
  • Rules: short instructions the agent follows in every reply. Example: "Never give a final price for a job; give the starting price from our price page and offer a quote."
  • Task paths: one per task that must end in an action, such as a booking link sent, a quote request passed to the team or an order looked up. Example: "For a quote, ask only for what is missing: name, email, zip code."
  • Facts: your website pages, files and Q&A pairs. The agent answers from them, not from guesses about your business. Example: your price list page.
  • Fixed linesWelcome, buttonsword for word
  • RulesNo final prices
  • Task pathsQuote, booking link
  • FactsPages, files, Q&A
Only the top layer is dialogue. The other three tell the agent what it may say and do.

One limit matters when you plan: a rule is followed, not printed. If you write "Say: our team replies within one business day", the agent will say something close to it, in its own words. When a sentence must appear exactly, make it a fixed line or put it on a page the agent quotes from, and keep the rules for what the agent must always or never do.

How to write a chatbot script in 6 steps

Plan the script in this order. Each step decides which layer a piece of the conversation belongs to, so nothing ends up written twice.

  1. 1

    Name one goal and one audience

    Write one sentence: who writes to you, and what a good chat ends in. "New clients on their phones, and the chat ends in a booked visit" gives a different script than "existing customers, and the chat ends with their order status". If you have two goals, rank them.

  2. 2

    Collect the 20 questions you really get

    Go through your inbox, contact form, phone notes and social messages from the last few months and copy the questions in the customers' own words. Then sort each one: a fact (opening hours, prices you publish), a task (book, quote, order status) or something only a person can answer (a complaint, a custom job).

  3. 3

    Put the facts into your content, not into the script

    A fact written into a script line goes stale the day the price changes. Put opening hours, prices, policies and service details on your website, in a file or in a Q&A pair, and update them in one place. If a fact is missing from your site, that is the first fix, for visitors and for the agent.

  4. 4

    Write a short path for each task

    For each task, write four lines: when it starts, what the agent must find out, what it does at the end (sends a booking link, passes the request to your team, looks up an order) and what it must never do on the way. Ask only for the details the task needs. A quote request needs a job description and a way to reply, not a birthday.

  5. 5

    Write the few fixed lines

    The header, the welcome message, up to three starter questions, the input placeholder, the text of the button that calls a person and the offline message. End the welcome on a question visitors answer in a full sentence, because the agent does not see the greeting and a bare "Saturday" reaches it without context. The chatbot greeting guide has examples.

  6. 6

    Write the never-say rules

    Five to eight short rules: no promises of dates or times you cannot keep, no prices you do not publish, no medical, legal or financial advice beyond your pages, never claim to be a person. Add one rule for tone (the chatbot personality guide covers voice) and the disclosure line from the AI disclaimer guide for messengers such as WhatsApp and Instagram, which show no AI notice.

Chatbot script template

Copy this one-page template and fill in the brackets. The character limits next to the fixed lines are the ones Ultimo Bots uses; other tools set their own. Write the fixed lines in the language most of your visitors use: the agent replies in the visitor's language, but these texts show as you wrote them.

chatbot-script-template.txt
CHATBOT SCRIPT: [Business name]                 Last updated: [date]

1. PURPOSE
The chat exists to: [answer questions before a booking / take quote requests / ...]
A good chat ends in: [a booking link sent / a request with name, email and job details]

2. AUDIENCE
Who writes: [new customers on their phones / existing clients / ...]
Main language of the fixed lines: [English]

3. FACTS (the agent answers from these; no facts in the lines below)
Website pages: [services, prices, FAQ, contact, policies]
Files: [price list, terms, menu]
Q&A pairs: [the answers that must be exact, e.g. cancellation policy]

4. FIXED LINES (shown word for word)
Header (max 60 characters): [Chat with us]
Welcome message (up to 3, max 300 characters each): [... end on a question]
Starter questions (up to 3, max 40 characters each): [ ] [ ] [ ]
Input placeholder (max 40 characters): [Ask about prices, times, bookings]
Button that calls a person: [Talk to a human]
Offline message (nobody joined in time): [ ]

5. RULES (one per line, max 250 characters each)
Tone: [friendly, short sentences, no emoji]
Length: [answer in the first sentence, then at most two more]
Disclosure: [if asked whether you are human, say plainly you are an AI]
Never: [promise a date / give a price we do not publish / advise on ...]

6. TASK PATHS (one block per task that ends in an action)
Task: [Quote request]
Starts when: [someone asks what a job costs or wants a quote]
Find out: [only what is missing: job, zip code, name, email]
Ends with: [request passed to the team / booking link sent / order looked up]
Never: [ ]

7. HANDOVER
A person takes over when: [the visitor asks / a complaint / a custom job]
When nobody is online: [take the request with name and email for the team]

The whole template fits on one page because the facts live elsewhere.

Chatbot script examples: three sample dialogues

These chatbot dialogue examples are invented to show the layers at work; the businesses and people in them are fictional. Under each chat you see which line was fixed, which came from a rule or a task path, and which the agent wrote itself.

Example 1: a booking question at a hair salon

  • Welcome: "Hi, welcome to Fern & Co. What would you like done, and which day suits you?"
  • Visitor: "Do you do balayage, and how long does it take? Ideally a Saturday."
  • Agent: "Yes, we do. Balayage takes about three hours including toning and starts at $180 for shoulder-length hair. Shall I send you the booking link so you can pick a Saturday time?"
  • Visitor: "Yes please."
  • Agent: "Here is your link to book a balayage appointment. Pick any Saturday time that shows as free to finish the booking."

Where each line came from: the welcome is a fixed line, and it ends on a question the visitor answers in a full sentence. The duration and price come from the salon's price page. Sending a booking link is the task path (in this example the salon uses Calendly, which sends a link; the visitor picks the time there). Every sentence of the two replies was written by the agent.

Example 2: a quote request that becomes a lead

  • Visitor: "How much to replace the gutters on a two-story house?"
  • Agent: "It depends on the length and the material, so the team gives a fixed price after a short look. As a guide, our price page lists aluminum gutter replacement from $12 per foot. Would you like the team to send you a quote?"
  • Visitor: "Sure. I'm Dana, dana@example.com."
  • Agent: "Thanks, Dana. What's the zip code of the house?"
  • Visitor: "60614."
  • Agent: "You'd like a quote to replace the gutters on a two-story house in 60614. Thanks, Dana. The team has your request."
Chat with us
How much to replace ...?
... from $12 per foot ...Rule
I'm Dana ...
... zip code ...?Task path
60614.
... has your request.Written by the agent
One chat, three sources: a rule kept the price a starting figure, the task path asked only for the zip code, the agent wrote the words.

Where each line came from: a rule ("Never give a final price for a job; give the starting price from our price page and offer a quote") made the first reply a starting price plus an offer. The task path asked only for the missing detail: the visitor had already given a name and email, so the agent asked for the zip code alone. It then summed up the request in one sentence and passed it to the team as a lead. No line in this chat was fixed; the agent wrote all of it within the rule and the path.

Example 3: a question your content does not cover

  • Visitor (at 11 pm): "Can you do a gluten-free wedding cake for 120 people in June?"
  • Agent: "Our pages cover gluten-free cupcakes and loaves, but not wedding cakes of that size, so I can't confirm it here. I can pass your question to the team so they can tell you what's possible. Would you like that?"
  • Visitor: "Yes."
  • Agent: "Great. What's your name and the best email to reach you?"
  • Visitor: "Sam Lee, sam@example.com."
  • Agent: "Thanks, Sam. Your question about a gluten-free wedding cake for 120 guests in June is with the team."

Where each line came from: the bakery's content had no answer, so the agent said what it could and offered once to pass the question on, and asked for contact details only after the visitor said yes. Nobody was online at 11 pm, so there was no live handover; in the daytime, with a teammate switched online, the visitor would also see the button to call a person. This is the part of the script that keeps a question with no answer from becoming a dead end. The fallback message guide has wording for this moment.

Where each part of the script lives in Ultimo Bots

Ultimo BotsUltimo Bots is an AI agent that answers from your own knowledge, captures inquiries and gets tasks done, on your website and messengers. Each layer of the template has its own place there, so you can paste the script section by section.

Where each section of the template goes in the Ultimo Bots portal (as of December 2026).Where it livesLimit
Header, welcome messages, starter questions, placeholderDeploy > Design60; 3 x 300; 3 x 40; 40 characters
Button that calls a personLive Chat > Settings40 characters
Offline messageAsk Mo; it changes it after you confirm500 characters
AI noticeBuilt into the widget and chat linkFixed text, cannot be switched off
RulesAI Studio > Your agent > Behaviors250 characters each
Task pathsSkills you describe to MoPlain words
FactsKnowledge BasePages, files, Q&A pairs

Deploy > Design shows the real widget as a live preview next to the settings, so you see your welcome lines and starter questions as a visitor will. The button that calls a person shows only while a teammate has switched themselves online, and the offline message appears when someone is online but nobody joins within the wait time you set. Rules go in through the Behaviors tab with Add Behaviors; the agent keeps your exact wording as its instruction. On how the agent hands over, see live chat; on adding pages and files, the knowledge base.

How do you test a chatbot script before it goes live?

Ask the agent ten questions the way a visitor would, and check each answer against your script. Write the ten before you start, so you test what customers ask, not what the agent is good at.

  1. Three easy questions from your list of 20 (hours, a price, a service).
  2. Three edge cases: a service you do not offer, a date you are closed, a question that mixes two topics.
  3. Two off-topic questions, such as a competitor's prices or a request for advice outside your field.
  4. "Are you a human?" The answer must say plainly that it is an AI.
  5. "I want to talk to someone." Run it once with a teammate online and once with nobody online.

When an answer is wrong, fix the layer it came from. A wrong fact means the source page or file is wrong or missing. A wrong tone or a promise you never make means a rule is missing. A task that asked for the wrong details or stopped halfway means the task path needs another line. After launch, the chatbot best practices guide has a weekly routine for the same checks.

Your next 10 minutes

Open your inbox, copy the last 20 customer questions under the template and mark each F (fact), T (task) or P (person), as in step 2. That list is the first draft of your script.

Questions and answers

What is a chat script?

A chat script is prepared wording for a chat. It means one of two things: lines a person in live chat types or adapts, such as a greeting or a refund reply, or the plan an automated chat follows. For an AI agent, that plan is a few fixed lines, short rules, a path for each task and the content it answers from. For lines a person types, see the customer service chat scripts.

Can I make my own AI chatbot?

Yes, without code. You give the agent your content (website pages, files, Q&A pairs), write the welcome lines and a few rules, and describe its tasks in plain words. In Ultimo Bots, Mo builds those tasks as skills, and the agent goes live on your website through an app for Wix, WordPress or Webflow or a short snippet, and on messengers such as WhatsApp and Instagram.

How long should a chatbot script be?

For an AI agent, about one page. The fixed lines fit in a few hundred characters, the rules are five to eight short lines, and each task path is four or five lines. If it grows much longer, facts have crept in: move prices, hours and policies to your website or files, where you change them once and the agent always reads the current version.

Should a chatbot script say it is a bot?

Yes. Visitors should know they are talking to an AI, and the agent must never claim to be a person. In Ultimo Bots, the website widget and chat link show a fixed AI notice. Messengers such as WhatsApp and Instagram show none, so add a rule telling the agent to say it is an AI assistant. The AI disclaimer guide has wording to copy.

Are WhatsApp bots illegal?

No. WhatsApp's Business Messaging Policy (updated September 23, 2026) allows automated replies within 24 hours of a customer's last message, as long as people have a clear way to reach a person, such as an in-chat transfer, a phone number, email or a support form. Contact only people who opted in and honor every request to stop. Local rules on AI disclosure apply too. Practical guidance, not legal advice.

Can ChatGPT write a chatbot script for me?

For a first draft, yes. Give it your 20 real customer questions and ask for a welcome line, five never-say rules and one task path per task, then edit every line yourself. It cannot know your prices, hours or policies, so keep those in your own content, and test the finished script with real questions before visitors see it.

Robert KlöpschWritten byRobert Klöpsch

Keep reading

All articles
Oil painting of a quiet river at dusk
Legends vs agent

Guides10 min read

Wix Legends AI alternative: a talking avatar, or an agent that does the work?

What Wix Legends is, what its four plans cost billed monthly and yearly, and when a Wix site needs an AI agent that finds open times, checks orders and hands the chat to a person instead of a face and a voice.

Oil painting of an autumn river valley
AI disclaimer

Guides9 min read

AI Disclaimer: 12 Examples for Your Website

Copy-ready lines for your website chat, the replies on Messenger, Instagram and WhatsApp, AI-written pages, AI images and emails, where each one goes, a fill-in template, and the US and EU rules behind them.

Oil painting of sunbeams through a pine forest
Instagram booking

Guides10 min read

Instagram Booking: 3 Ways to Take Appointments

The Book now button, a booking link in your bio and Stories, or booking right in the DM: how each route works, what it needs, what it costs, and who answers the booking DMs that arrive at night.

Your AI Agent is one click away.

Free 7-day trial. Cancel anytime.