# Actions in Scenarios — What They Are and How They Work

Actions are a powerful mechanism for extending bot scenario functionality in ConnectiveOne. Through actions, you can execute complex business logic, integrate with external systems, process data, and control scenario execution flow.

---

## What Are Actions?

**Actions** are JavaScript functions that execute during bot scenario execution. When the bot reaches a node of type `Action` in the scenario, it calls the corresponding function, passes parameters to it, and processes the result.

---

## Types of Actions

### Standard Actions

**Standard actions** are built into the ConnectiveOne platform and are available to all bots without additional configuration.

**Characteristics:**
- ✅ Available to all bots on the platform
- ✅ Versioned together with Engine
- ❌ Not editable through UI (only through code)
- ✅ Stable and tested
- ✅ Total number: **98 standard actions**

**Groups of standard actions:**
- **Core Actions** (63) — basic actions: validation, HTTP requests, conditional logic, loops, data work
- **Language** (2) — language work
- **Loop** (2) — loops
- **Schedule** (1) — schedule check
- **Interval** (4) — interval work
- **Custom modules** (4) — custom module work
- **Operator panel** (4) — operator panel integration
- **FastLine Pro** (6) — AI agent integration
- and other groups

**Examples of standard actions:**
- `action_validate` — user input validation
- `action_send_request` — sending HTTP requests to external APIs
- `action_send_email` — sending email messages
- `action_if_else` / `action_switch` — conditional logic and switches
- `action_set` — setting variables in scenario state
- `action_fastline_pro` — FastLine Pro AI agent integration
- `action_tickets_create` — ticket creation

**Standard actions documentation:**
- [Actions Reference — complete guide to all 98 actions](/en/actionjail/reference/actions-reference.md) — table with description, configuration, and return values

### Custom Actions (ActionJail)

**Custom actions** are actions created for specific project tasks through the ActionJail module.

**Characteristics:**
- ✅ Created and edited through ActionJail module UI
- ✅ Specific to a particular ConnectiveOne instance
- ✅ Can use standard actions inside themselves
- ✅ Support AI code, configuration, and documentation generation
- ✅ Can be organized into groups for better navigation

**When to use custom actions:**
- You need specific business logic that doesn't exist among standard actions
- You need integration with unique external client systems
- You need custom data processing for specific requirements
- You need to combine multiple standard actions into one action

**Custom actions documentation:**
- [ActionJail module](/en/actionjail/operator-hub.md) — creating and managing custom actions
- [Create custom action](/en/actionjail/how-to/admin-manage-actions.md)

---

## How Actions Work in Scenarios

### Action Execution

1. **Bot reaches a node of type `Action`** in the scenario
2. **System searches for action** first in standard actions, then in ActionJail
3. **Action function executes** in KwizbotEngine context
4. **Result is processed** — action can return a value for conditional transitions

### Execution Flow Control

Actions can return values that are used for conditional transitions in the scenario:

- **Successful execution** → transition to next node
- **Error** → transition to error handling node
- **Conditional values** → transition depending on result (for example, `if_else` returns `true` or `false`)

### Parameters and Configuration

Each action has its own configuration:
- **Parameters** — settings passed to the action
- **UI schema** — form for entering parameters in the scenario editor
- **Default values** — default parameters

---

## Usage in Scenario Dialog

In Scenario Dialog, actions are used through nodes of type `Action`:

1. **Adding node** — add a node of type `Action` to the canvas through React Flow toolbar
2. **Selecting action** — select standard or custom action in the configuration component
3. **Configuring parameters** — fill action parameters through UI form
4. **Connecting with other nodes** — connect action with other nodes through edges to control flow

---

## Related Materials

- [Use action in scenario](/en/scenariodialog/how-to/use-action-in-scenario.md) — step-by-step instruction
- [Actions Reference](/en/actionjail/reference/actions-reference.md) — complete guide to all actions
- [ActionJail module](/en/actionjail/operator-hub.md) — creating custom actions
- [Create custom action](/en/actionjail/how-to/admin-manage-actions.md)

