Start here · Templates

Edit this page on GitHub

Templates

These are the ten bots people keep building by hand. An assistant that looks something up before it answers, a sales bot with a catalog and a real total, a bot that reads a PDF or a link, and a support bot that knows when to hand the chat over.

Each one is a complete flow: the state it keeps, the step that does the work, and what the bot says when the customer answers something the happy path did not expect. Press Try it live to talk to the same flow in your browser — the network calls are replaced by fixed data, so you do not need a key.

10

complete templates, one file each

3

providers — WhatsApp, Telegram or Twilio — same flow

10

of them run in your browser, no key needed

Updated 2026-11-18 · @builderbot/bot

AI agent that can look things up

AI assistantsflows/agent.flow.ts

A chat with memory that can search the web or look up an order before it answers, instead of inventing the number.

How it works

Keep the last turns in `state`. The model answers, or it replies `TOOL search …` / `TOOL order …`. You run that one call and ask the model again with the result. One round is enough for WhatsApp.

Read the docs

WhatsApp sales agent with a catalog

Leads & salesflows/sales.flow.ts

Quotes a price, asks how many seats, and only confirms the order when the quantity is a real number.

How it works

A catalog in code beats a chain of wait nodes. `capture` keeps each answer in the same flow, `fallBack` asks again when the quantity is not a number, and `state` carries the line item to the total.

Read the docs

Assistant for text and voice notes

AI assistantsflows/assistant.flow.ts

A voice note is transcribed and then handled by the same flow that answers typed messages, so reminders land in one list.

How it works

`EVENTS.VOICE_NOTE` is separate from images on purpose. Save the file, send it to Whisper, and pass the transcript to the same function that reads `ctx.body`. Store reminders in `state`, per contact.

Read the docs

Summarize any link in the chat

Researchflows/summarize.flow.ts

Send a URL, get five bullets back. When the page does not load, the bot says so instead of going silent.

How it works

A regex keyword catches the link without a command. Strip scripts and styles before the prompt, cap the text, and answer with the HTTP status when fetch fails.

Read the docs

Find leads and draft the first message

Leads & salesflows/leads.flow.ts

Search a niche and a city, keep the list, and draft a first WhatsApp message for the lead you pick.

How it works

Search, then `capture` the number of the lead. The draft uses the business name from `state`, so the message is not generic. Sending it stays a separate step: you review it before it goes out.

Read the docs

Ask your sales data in the chat

AI assistantsflows/analyst.flow.ts

The customer asks "how much did we sell in October?" and the bot answers from your rows, quoting the numbers it used.

How it works

Do not hand the model a database connection. Load the rows you are willing to expose, put them in the prompt, and tell it to answer only from that table. The same flow works against a query you run yourself.

Read the docs

Questions about a PDF the customer sends

Documentsflows/pdf.flow.ts

The customer sends a PDF and then asks about it. The bot refuses to answer from anything that is not in the file.

How it works

`EVENTS.DOCUMENT` plus `provider.saveFile` gives you the file. `pdf-parse` extracts the text into `state`. For more than a few pages, chunk it and retrieve; stuffing the whole file into the prompt is the short version.

Read the docs

Support bot that hands the chat to a person

Supportflows/support.flow.ts

Answers the FAQ, and the moment the customer asks for a person the bot stops talking to them and alerts your team.

How it works

Match the handoff before calling the model, `gotoFlow` to a flow that alerts your team, then `blacklist.add(ctx.from)`. While the number is muted the bot keeps answering everyone else. Write "unmute" from the admin chat to give the bot back.

Read the docs

Book a meeting from the chat

Leads & salesflows/meeting.flow.ts

Offer the slots you actually have, accept only one of them, and book it. A typo asks again instead of reserving the wrong hour.

How it works

Give the model a real list, not "suggest some times". Match the day in lowercase, `fallBack` when nothing matches, and only then POST to the calendar.

Read the docs

One inbox for text, voice, images and PDFs

AI assistantsflows/inbox.flow.ts

Each kind of message has its own event, and the bot remembers the last file so the next text message can refer to it.

How it works

Do not treat a voice note as an image. `EVENTS.VOICE_NOTE`, `EVENTS.MEDIA` and `EVENTS.DOCUMENT` are different flows; they all write `state.last`, and `EVENTS.WELCOME` reads it when the customer asks "what did I send?".

Read the docs

What they have in common

  • One file per template. Drop it into src/flows and import it in app.ts. No node to wire, no hidden step.
  • The unhappy path is written. If the quantity is not a number, the link does not load or the customer asks for a person, the bot answers something useful instead of going silent.
  • They all end the same way: addKeyword + addAnswer({ capture: true }) + addAction, the four methods this documentation covers. The difference is the state, the events and the call to your API.

Turn a card into a running bot

pnpm create builderbot@latest

Pick baileys as the provider and memory as the database, then copy the flow from the card into src/flows and import it in app.ts. If you need persistence, swap MemoryDB for Mongo, MySQL or Postgres without touching the flow.

The card shows the version that talks to the network. The live demo is the same flow with the network calls replaced by fixed data, which is why it answers the same questions without a key.

Do you have a template we are missing?

If you built something that solves a real problem and want it listed here, open a PR in the documentation repo or drop it in the Discord. Templates are reviewed for two things: it must run with the current version of @builderbot/bot, and it must explain the flow, not just the goal.