Use Case 6: Registration + return visit
Level: basic · Modules: Scenario Builder, Settings → Registered Users · Actions: registered_users__get, registered_users__set
Required permissions and access
| What you need | Where in the menu | Why |
|---|---|---|
| Scenario Builder | Menu → Scenario Builder | Get/set on Start and in the registration branch |
| Settings → Registered Users | Settings → Registered Users | Profile fields first_name, phone |
If a section is missing from the menu — check your account permissions or contact ConnectiveOne support.
Business context
First visit — registration (name, optionally phone); next visit — greet by name without asking again.
Key idea: dialog variables vs customer profile
Until Use Case 6 you worked with {{user_input}}, buttons, and API — these are current dialog variables. Use Case 6 adds remembering the customer across visits.
| Dialog variables (state) | Registered Users (profile) | |
|---|---|---|
| In plain words | A “sticker” for one conversation | A customer “card” in the database |
| How long it lives | One Run / one dialog | Next visit, new dialog |
| How to write | Automatically between nodes ({{user_name}}, etc.) |
Action registered_users__set |
| How to read | {{name}} in later nodes of this same Run |
registered_users__get → edge success / error |
Mini example
- Customer writes “Olena” → “Hi, Olena!” — name from a dialog variable, fine until the end of this Run.
- Customer returns tomorrow (or a new Run in preview):
- without
registered_users__set— the bot again “doesn’t know” Olena; - with
__seton the first visit +__getat the start of the second — “Welcome, Olena!”.
- without
Rule: everything you collected at registration, save via registered_users__set. On the next visit, start with registered_users__get.
Expected result
registered_users__getat start → success / error.- error → collect data →
registered_users__set. - success → “Welcome, {{registration:first_name}}!”
- New Run after registration →
__getsuccess with the same name.
Flow architecture
Start → registered_users__get
├─ success → “Welcome, {{registration:first_name}}!”
└─ error → WaitForInput (name, phone) → registered_users__set → “Thank you!”
Step-by-step implementation
Step 0. Registered Users — model fields
Settings → Registered Users → add profile fields (if not yet):
| Field in model | Type | Why |
|---|---|---|
first_name |
text | Name for greeting |
phone |
phone | Optional for Use Case 5/6 |
Data reaches the action via constants registration:first_name, registration:phone, etc.
Step 1. Action on Start — registered_users__get
What it does: looks up the profile by current dialog chat_id + channel; if found — loads into registration:*.
| node_params | Value | Why |
|---|---|---|
check_by_phone |
false |
In training — lookup by current chat |
Edges:
| Edge | When | Where | Why |
|---|---|---|---|
success |
Profile exists | MessageKeyboard “Welcome, {{registration:first_name}}!” | Return visit |
error |
New customer | registration branch (step 2) | Expected branch, not a bug |
Step 2. error branch — collect data
WaitForInput — name
| Parameter | Value |
|---|---|
| messageText | “How should we address you?” |
| outputVariable | registration:first_name |
WaitForInput — phone (optional)
| outputVariable | registration:phone |
Edges: WaitForInput chain → Action registered_users__set.
Step 3. Action — registered_users__set
What it does: collects all registration:* constants and saves the profile in the Registered Users DB.
| node_params | Value | Why |
|---|---|---|
check_by_phone |
false |
Link to current chat_id |
active |
1 |
Active profile |
Edges:
| Edge | Where |
|---|---|
| success | MessageKeyboard “Thank you for registering, {{registration:first_name}}!” |
| error | “Could not save data” + check model fields |
Step 4. Test “across dialogs”
- Preview: walk
error→ registration →successon__set. - End the Run → new Run.
- On Start
__get→ must besuccess,{{registration:first_name}}filled.
Acceptance criteria (self-check Runs)
Common mistakes
| Symptom | Cause | What to do |
|---|---|---|
| Second Run asks for registration again | __set did not run or wrong fields |
Check the first Run trace |
__set error |
Field not in Registered Users model | Add the field in Settings |
{{registration:first_name}} empty |
Wrong outputVariable | Format registration:first_name |
| Profile “disappears” | Testing in the same Run | End the Run and open a new one |