> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Actions

> Automation engine actions: IDs, behavior, minimum context, and what they write to event.data — in the gu1 workflow automation engine with triggers and actions.

Automations run **actions** (the `THEN` part). Each action has a **`type`** string (below) and a **`config`** object. The engine validates the action type and applies synergy rules with the **[Triggers](/en/workflows/triggers)** and **[Synergy](/en/workflows/synergy)** pages.

<Info>
  **Canonical list:** `AUTOMATION_ACTION_TYPES` in shared types (20 action types). Anything not in that list is not a first-class automation action in the engine.
</Info>

## Action Catalog

### Intelligence and Investigations

| Action ID               | What it does                                                                                                                                                                                                                                                     |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create_investigation`  | Opens an investigation on the entity; may attach alert context when present.                                                                                                                                                                                     |
| `generate_checklist`    | Generates a checklist on an existing investigation.                                                                                                                                                                                                              |
| `start_investigation`   | Moves the investigation into active work.                                                                                                                                                                                                                        |
| `change_status`         | Changes investigation status.                                                                                                                                                                                                                                    |
| `change_priority`       | Changes investigation priority.                                                                                                                                                                                                                                  |
| `assign_to`             | Assigns the investigation.                                                                                                                                                                                                                                       |
| `assign_load_balanced`  | Assigns from a pool of users, teams, or roles (`assigneePool`), least load by matching `assignedTo` + `assignedToType` on open investigations (excl. closed/archived); legacy `userIds` (users only) still works. `balanceScope`: `all_open` or `same_category`. |
| `set_stage_role_access` | Restricts stage access by role.                                                                                                                                                                                                                                  |
| `add_note`              | Adds a note to the investigation.                                                                                                                                                                                                                                |

### Risk, Entity, Enrichment

| Action ID               | What it does                                                   |
| ----------------------- | -------------------------------------------------------------- |
| `run_basic_enrichment`  | Runs basic enrichment for the entity/country.                  |
| `run_enrichment`        | Full enrichment (configured providers).                        |
| `run_shareholders_flow` | Shareholders / corporate structure flow.                       |
| `run_risk_matrix`       | Recalculates risk; updates scores and `riskMatrix` in context. |
| `set_entity_status`     | Updates entity commercial/compliance status.                   |

### Alerts and Transactions

| Action ID                      | What it does                                                           |
| ------------------------------ | ---------------------------------------------------------------------- |
| `create_alert`                 | Creates a system alert on the entity.                                  |
| `request_transaction_approval` | Sends approval flow (email/SMS/link or OTP) for a transaction.         |
| `set_transaction_status`       | Updates transaction status (valid transitions enforced by the engine). |

### KYC

| Action ID               | What it does                                                                                        |
| ----------------------- | --------------------------------------------------------------------------------------------------- |
| `create_kyc_validation` | Starts a KYC validation for a person when applicable; may be skipped if entity type does not apply. |

### Integrations and Messaging

| Action ID                | What it does                                                                                                                                         |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `send_webhook`           | HTTP request to a URL with JSON payload (retries on transient failures).                                                                             |
| `send_push_notification` | Sends via configured channels (email, SMS, WhatsApp, Slack, Telegram, etc.); templates can include `continueUrl` / `cancelUrl` when standby applies. |

## Context Input and Output (Summary)

Nested objects **`entity`**, **`transaction`**, **`investigation`**, **`kyc`**, **`alert`** follow the **same shape as database rows** so templates can use `{{entity.status}}`, `{{transaction.amount}}`, etc.

| Action                                                                                                                            | Needs in context (minimum)                             | Adds / updates in `event.data`                                                    |
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------- |
| `create_investigation`                                                                                                            | `entityId` / `targetEntityId`; optional alert/category | `investigationId`, `investigation`                                                |
| `generate_checklist`, `start_investigation`, `change_status`, `change_priority`, `assign_to`, `set_stage_role_access`, `add_note` | `investigationId`                                      | Investigation fields updated in place                                             |
| `create_alert`                                                                                                                    | `entityId` / `targetEntityId`, entity type             | — (side effects in DB)                                                            |
| `run_basic_enrichment`                                                                                                            | `entityId`, `entityType`, `countryCode`                | `enrichment`                                                                      |
| `run_enrichment`, `run_shareholders_flow`                                                                                         | `entityId` / `targetEntityId`                          | `enrichment`                                                                      |
| `run_risk_matrix`                                                                                                                 | `entityId`, `entityType`                               | `newScore`, `riskScore`, `riskScoreRaw`, `riskMatrix`, entity scores              |
| `set_entity_status`                                                                                                               | `entityId` / `targetEntityId`                          | Status, `previousStatus` / `entity.oldStatus`                                     |
| `set_transaction_status`                                                                                                          | Transaction context                                    | `transaction.status`                                                              |
| `create_kyc_validation`                                                                                                           | `entityId`, `entityType` (person)                      | `kycValidationId`, `kyc`                                                          |
| `request_transaction_approval`                                                                                                    | Transaction entity context                             | Uses external approval tokens (not a generic `resumeExecution` payload)           |
| `send_webhook`                                                                                                                    | —                                                      | —                                                                                 |
| `send_push_notification`                                                                                                          | Depends on recipient                                   | May inject `continueUrl` / `cancelUrl` when `executionId` + `callbackToken` exist |

Synergy does **not** guarantee data: an action may skip (e.g. wrong entity type for KYC). In **steps** mode, a skipped `create_kyc_validation` can stop the flow.

***

**Maintenance:** When adding or changing an action, update `automation-engine` executeAction, `AUTOMATION_ACTION_TYPES`, `workflow-synergy.ts`, and this page.
