Use Case 8: Macro section in the scenario
Level: basic · Modules: Scenario Builder · Settings → Operator Panel → Process macro (optional E2E)
Required permissions and access
| What you need | Where in the menu | Why |
|---|---|---|
| Scenario Builder | Menu → Scenario Builder | Macro section, logic inside |
| Settings → Operator Panel → Process macro | Settings → Operator Panel → Process macro | Optional: button in Operator Line (E2E) |
If the Process macro section is missing from the menu — you can complete core Use Case 8 with a Runs check only; E2E via Operator Line is optional.
Business context
An operator in a dialog runs a short scenario (order status check, lookup) — the logic lives in a Scenario Builder section with the “macro” flag, not in a separate bot.
Expected result
- A separate section with the “Used as macro” flag.
- Macro input parameter (e.g.
order_id). - Logic verified in Runs (macro section trace).
- (Optional E2E) Process macro in Settings → “Run macro” button in Operator Line.
Flow architecture
[Macro section] Start (macro) → WaitForInput / macro form (order_id)
→ action_send_request or MessageKeyboard “Status OK for {{order_id}}”
→ End / return to operator dialog
Link to other settings
Settings → Operator Panel → Process macro → select the bot with the macro section. Needed only for optional E2E verification in Operator Line.
→ Implementer overview — macros
Step-by-step implementation
Step 1. Scenario section for macro
Scenario Builder → new section (e.g. Macro Check Status):
| Section setting | Value | Why |
|---|---|---|
| Used as macro | enabled | Section available from OP, not as a normal customer entry |
| Macro variable | order_id (text, required) |
Operator enters on launch → {{order_id}} in nodes |
Step 2. Logic inside the section (simplified)
Option A — no API (minimum):
| Node | Parameters |
|---|---|
| MessageKeyboard (or macro result node) | “Checked order {{order_id}}: status OK” |
Option B — mock API (like Use Case 4):
| Action action_send_request | url with {{order_id}} or a fixed mock |
| Edges | ok → text with {{crm_data…}} · not_ok → “CRM unavailable” |
The macro must not call operator_panel__connect — it is already inside the operator dialog.
Step 3. Wire-up in Operator Panel (optional — E2E)
Settings → Operator Panel → Process macro → select the bot with the macro section.
Acceptance (core): Runs trace of the macro section with a test order_id.
Acceptance (optional E2E): “Run macro” button in an Operator Line dialog.
Step 4. Test (optional E2E)
- Open a customer dialog (convenient after Use Case 3).
- “Run macro” button → select macro → enter
order_id. - Result in the dialog; Runs — macro section trace.
Core test without OP: Scenario Builder → Runs → run the macro section with a test order_id in the trace.
Acceptance criteria (self-check Runs)
Common mistakes
| Symptom | Cause | What to do |
|---|---|---|
| Macro not in OP | Process macro not configured | Settings → OP → Process macro |
{{order_id}} empty |
Parameter not declared in the section | Add the macro variable in section settings |
| Connect inside the macro | Extra node | Remove connect — the macro is already in the dialog |
| Empty trace | Not launched via macro Runs | Run the section trace with the parameter |