How Action Jail Data Flows to Scenario Builder
When you create an action in Action Jail and add it to a scenario, the data from the action editor is transformed into the parameter form in the Action block. This page explains how this happens, where each field appears, and why the structure is designed this way.
Context and Problem
When a scenario user (analyst, implementation) adds an Action block and selects an action from the library, they need to:
- See clear fields for entering parameters (email, subject, number, choice).
- Avoid writing JSON manually when a form is available.
- Understand how form values are passed to the action code.
The administrator creating the action in Action Jail must configure:
- Implementation code (JavaScript).
- Parameter schema (what the code expects).
- How these parameters are displayed in the form (labels, fields, groups).
Problem: Without understanding the link between Action Jail fields and what the scenario user sees, you may create an action with incorrect configuration — the form will be empty or parameters will not reach the code.
Key Concepts
What is Stored in Action Jail
Each action stores:
- Information — name, system ID, description, group.
- Code — JavaScript function that runs on the backend.
- JSON configuration — parameter schema (
parameters), grouping (ui.groups), example (json_example). - UI schema — visual representation of the same parameters (synchronized with JSON).
- Documentation — Markdown for reference guides.
What is Stored in the Scenario Node
When you add an Action block to a scenario and select an action:
- The node stores only
templateId(action name) + parameter values (values). - The parameter schema (types, fields, groups) is not copied into the node — it is dynamically loaded from Action Jail when the block is opened.
Why: If an administrator changes an action's parameter schema (adds a field, changes type), all scenarios using that action automatically get the updated form. No need to update each scenario separately.
Data Flow: Action Jail → Scenario Builder
┌─────────────────────────────────────────────────────────────────────────────┐
│ Action Jail (action editor) │
├─────────────────────────────────────────────────────────────────────────────┤
│ Information: displayName, name, description, group_id │
│ Code: action_xxx() │
│ JSON config: parameters, ui.groups, json_example, events_schema │
│ Documentation: Markdown │
└─────────────────────────────────────────────────────────────────────────────┘
│
│ Stored in action library
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Action block in scenario │
├─────────────────────────────────────────────────────────────────────────────┤
│ node.data: │
│ templateId: "action_send_email" ← reference to action │
│ templateConfig.values: { to: "...", subject: "..." } ← values only │
│ │
│ When block is opened: │
│ → parameters loaded from Action Jail (dynamically) │
│ → form built from parameters + ui.groups │
│ → values filled into form fields │
└─────────────────────────────────────────────────────────────────────────────┘
Step 1: User Opens the Action Block
The system:
- Reads
templateIdfrom the node (e.g.action_send_email). - Loads full action info from Action Jail:
parameters,ui,json_example. - If
parametersexist — shows Form mode (form fields). - If
parametersare empty — shows JSON mode (Monaco editor).
Step 2: Form Built from parameters + ui.groups
Each item in parameters becomes a form field:
type: "string"→ text inputtype: "number"→ number inputtype: "boolean"→ switchtype: "select"→ dropdown
Groups from ui.groups are displayed as accordion sections. Fields from parameters are distributed across groups by the key field in the group.
Step 3: User Enters Values
When the user changes a form field:
- The value is saved in
templateConfig.values(values only, no schema). - When the scenario runs, the Engine passes
valuesto the action code viathis.getCurrentNodeParamsJSON().
Step 4: Action Code Receives Parameters
In the action code:
const { to, subject } = this.getCurrentNodeParamsJSON();
The keys to, subject are the same key or name from parameters in the JSON config. Values come from templateConfig.values.
Where Each Field Appears
| Action Jail field | Where it appears in Scenario Builder | Note |
|---|---|---|
| Display name | Action selection when adding block, selected action name in block | User sees this name |
| Group | "Select action group" filter in Action block sidebar | Helps find the action quickly |
| Description | Hints, reference guides | Not shown directly in the form |
| parameters[].key | Key in values read by code via getCurrentNodeParamsJSON() | Must match what the code expects |
| parameters[].label | Field label in form | |
| parameters[].placeholder | Input placeholder | |
| parameters[].type | Widget type (input, number, switch, select) | |
| ui.groups | Accordion sections in parameter form | Field grouping |
| json_example | Default values on first open | |
| events_schema | Possible values for routing (e.g. success → next block) |
Edit Modes: Form ↔ JSON
The Action block has two modes:
- Form — form fields built from
parameters. Convenient for most users. - JSON — direct JSON input. User sees and edits
templateConfig.values(values only).
Both modes are synchronized: changes in the form update JSON, changes in JSON update the form. The parameter schema always comes from Action Jail, not from the node.
Implications for Administrators
When creating an action:
- Ensure keys in
parametersmatch what the code reads viagetCurrentNodeParamsJSON(). - If the code has
const { email } = this.getCurrentNodeParamsJSON(), thenparametersmust have a field withkey: "email"orname: "email".
When changing the schema:
- Adding a new parameter — all scenarios get the new field in the form.
- Removing a parameter — old values in scenarios are ignored; the code will not receive this key.
- Changing type — the form updates; verify that existing values in scenarios are valid.
Related Documents
- Action editor sections — what to fill in each section
- How to create a custom action — step-by-step guide
- Actions Reference — standard actions reference