botserver/docs/src/chapter-06-gbdialog/templates/enrollment.md
Rodrigo Rodriguez (Pragmatismo) faaf9c18c8 Looking at this diff, I need to summarize the significant documentation
and code changes:

``` Add natural language scheduling, docs, wizard, and branding

- Add SET SCHEDULE natural language parser supporting patterns like
  "every hour", "at 9am", "weekdays at 8am", "business
2025-11-30 12:20:48 -03:00

12 KiB

Enrollment Template

The enrollment template demonstrates how to build a complete data collection workflow that gathers user information step-by-step, validates inputs, confirms details, and saves the data.

Topic: User Registration & Data Collection

This template is perfect for:

  • Customer onboarding flows
  • Event registrations
  • Lead capture forms
  • Survey collection
  • Application submissions

The Code

REM Enrollment Tool Example

PARAM name AS string          LIKE "Abreu Silva"
DESCRIPTION "Required full name of the individual."

PARAM birthday AS date        LIKE "23/09/2001"
DESCRIPTION "Required birth date of the individual in DD/MM/YYYY format."

PARAM email AS string         LIKE "abreu.silva@example.com"
DESCRIPTION "Required email address for contact purposes."

PARAM personalid AS integer   LIKE "12345678900"
DESCRIPTION "Required Personal ID number of the individual (only numbers)."

PARAM address AS string       LIKE "Rua das Flores, 123 - SP"
DESCRIPTION "Required full address of the individual."

DESCRIPTION "This is the enrollment process, called when the user wants to enrol."

REM Start enrollment
TALK "Welcome to the enrollment process! Let's get you registered."

TALK "First, what is your full name?"
HEAR name

TALK "Thank you. What is your birth date? (DD/MM/YYYY)"
HEAR birthday

TALK "What is your email address?"
HEAR email

TALK "Please provide your Personal ID number (numbers only):"
HEAR personalid

TALK "Finally, what is your full address?"
HEAR address

REM Validate and confirm
TALK "Please confirm your details:"
TALK "Name: " + name
TALK "Birth Date: " + birthday
TALK "Email: " + email
TALK "Personal ID: " + personalid
TALK "Address: " + address

TALK "Are these details correct? (yes/no)"
HEAR confirmation

IF confirmation = "yes" THEN
    SAVE "enrollments.csv", name, birthday, email, personalid, address
    TALK "Thank you! Your enrollment has been successfully submitted."
ELSE
    TALK "Let's start over with the correct information."
END IF

Sample Dialogs

These conversations show how the enrollment template works in real-world scenarios.

Dialog 1: Successful Enrollment

🤖
Registration Bot
online
Today

Hi, I want to register

10:30
Registration Bot

Welcome to the enrollment process! Let's get you registered. 📋

10:30

First, what is your full name?

10:30

Maria Santos Silva

10:31

Thank you. What is your birth date? (DD/MM/YYYY)

10:31

15/03/1990

10:31

What is your email address?

10:31

Please provide your Personal ID number (numbers only):

10:32

12345678901

10:32

Finally, what is your full address?

10:32

Rua das Palmeiras, 456 - São Paulo, SP

10:33

Please confirm your details:

Name: Maria Santos Silva

Birth Date: 15/03/1990

Email: maria.santos@email.com

Personal ID: 12345678901

Address: Rua das Palmeiras, 456 - São Paulo, SP

10:33

Are these details correct? (yes/no)

10:33

yes

10:33

Thank you! Your enrollment has been successfully submitted.

You will receive a confirmation email shortly.

10:33

Dialog 2: User Corrects Information

🤖
Registration Bot
online

Please confirm your details:

Name: João Pedro

Birth Date: 20/05/1985

Email: joao@email.com

Personal ID: 98765432100

Address: Av. Brasil, 100 - RJ

14:22

Are these details correct? (yes/no)

14:22

no

14:23

Let's start over with the correct information.

14:23

First, what is your full name?

14:23

João Pedro Oliveira

14:24
User continues with corrected information...

Dialog 3: LLM-Assisted Natural Input

When using the LLM, users can provide information naturally:

🤖
Smart Registration
online

I'd like to sign up. My name is Carlos Ferreira, born on March 5th 1992, email carlos.f@gmail.com, ID 11122233344, and I live at Rua do Sol, 789 in Brasília

16:45
Smart Registration

I've captured your information! Let me confirm:

Name: Carlos Ferreira

Birth Date: 05/03/1992

Email: carlos.f@gmail.com

Personal ID: 11122233344

Address: Rua do Sol, 789 - Brasília

16:45

Is everything correct? 👆

16:45

Perfect! Yes

16:46

Registration complete! Welcome aboard, Carlos!

16:46

Keywords Used

Keyword Purpose
PARAM Define expected input parameters with types and examples
DESCRIPTION Provide context for LLM understanding
TALK Send messages to the user
HEAR Wait for and capture user input
IF/ELSE Conditional logic for confirmation
SAVE Persist data to CSV file

How It Works

  1. Parameter Definition: The PARAM declarations tell the LLM what information to collect
  2. Step-by-Step Collection: Each HEAR captures one piece of data
  3. Confirmation Loop: User reviews all data before submission
  4. Data Persistence: SAVE stores the validated data

Customization Ideas

Add Validation

HEAR email
IF NOT INSTR(email, "@") THEN
    TALK "Please enter a valid email address"
    HEAR email
END IF

Add to Database Instead of CSV

INSERT "users", name, birthday, email, personalid, address

Send Confirmation Email

SEND MAIL email, "Welcome!", "Your registration is complete, " + name