# Workflows and actions

In the AI Agents dashboard, the **Workflows** tab is used to customise an agent's scripted [chat flow](/docs/modules/ai-agents.md#chat-flow) with triggers and actions. These triggers and actions can exist at the top level of the chat, or any nested level below other triggers and actions—visualised by a tree of clickthroughs or accordions.

***

## Triggers

Triggers are defined by a system event or the person's intent. For example, if someone says, "let me talk to a human" in any abstract way, a trigger can recognize this and initiate a human handoff.

<table><thead><tr><th>Trigger</th><th width="510">Description</th></tr></thead><tbody><tr><td>Chat Started</td><td>A permanent, top-level trigger that can initiate actions at the beginning of a new chat.</td></tr><tr><td>Chat Closed by Live Agent</td><td>A permanent, top-level trigger that can initiate limited actions if  a chat underwent a <a href="/pages/Q8vjcCZyYoe2O9BUhiwc">human handoff</a>, and is subsequently closed by a live agent.</td></tr><tr><td>Message Received</td><td>A person's message contains content (conversational intent) that approximately matches any of the defined training phrases, and does not match any excluded phrase.</td></tr><tr><td>Attachment Received</td><td>A person has sent an attachment, further distinguishable between images, videos, audio, or other files.</td></tr><tr><td>Fallback</td><td>If no other trigger is used in the current level (e.g. there's no match for the conversation intent), the Fallback trigger will be automatically fired.</td></tr></tbody></table>

## Actions

Every action is initiated by a trigger and can be as simple as sending a stock reply, or provide real utility with things like takeovers and API messages.

<table><thead><tr><th width="238">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/9GxlB7rfmOxR8xrCQM3U">Send Message</a></td><td>Replies with one of the defined static messages.</td></tr><tr><td><a href="/pages/f7XM2rvhDmaToioy4M6Q">Send File</a></td><td>Replies with a file attachment or link.</td></tr><tr><td><a href="/pages/rxMxrHWNwIBbt1qnXdbH">Show Carousel</a></td><td>Replies with a carousel of interactive cards—for the Messenger, LINE, and Webchat channels only.</td></tr><tr><td><a href="/pages/k7rt2npzes1B4Vc92bLy">Show Survey</a></td><td>Replies with a survey or questions to collect feedback.</td></tr><tr><td><a href="/pages/zHnrwl1RiWBAK4n2lNdJ">Collect Feedback</a></td><td>A permanent action in the 'Chat Closed by Live Agent' trigger, used to gather analytics on the person's experience.</td></tr><tr><td><a href="/pages/VeqvBsilLVuwwIkFIyUd">Create Ticket</a></td><td>Creates and sends the first email in a new ticket.</td></tr><tr><td><a href="/pages/Q8vjcCZyYoe2O9BUhiwc">Human Handoff</a></td><td>Transfers the chat to a user in Proto AICX, where the Inbox dashboard serves as a native helpdesk.</td></tr><tr><td><a href="/pages/EBzV3f92cqcYL1yuFMPL">External Handoff</a></td><td>Transfers the chat to Zendesk or Bitrix24 if integrated.</td></tr><tr><td><a href="/pages/AfNzbD8tzpbyRXhjL5zk">Jump to Trigger/Action</a></td><td>Jumps to another spot in the chat flow.</td></tr><tr><td><a href="/pages/yRuISyntS8UJxaE5kgNX">If/Else</a></td><td>Conditionally branches the chat flow.</td></tr><tr><td><a href="/pages/rTdnuIG08MgrRXkV3Alv">Set Chat Variable</a></td><td>Creates or modifies a chat variable.</td></tr><tr><td><a href="/pages/4Q58I6jfTVQWc70jiSUX">Send API Request</a></td><td>Issues a custom API request with JSON key/value pairs in the header.</td></tr><tr><td>LLM Action</td><td>Calls a large language model at any point in the chat flow, passes the result to downstream actions via a variable.</td></tr><tr><td>Auto fill Field</td><td>Automatically classifies or categorises the chat and populates one or more custom fields based on the conversation context.</td></tr><tr><td>Auto team match</td><td>Matches a team based on alternative names configured in Teams settings. </td></tr></tbody></table>

## Configuration

### Adding

To add a trigger at the top level, select **Add Trigger** above the table.

To add a trigger or action in a nested level, select **Add Trigger** or **Add Action** within the tree. Certain triggers and actions may only be available for some parents, depending on compatibility.

***

### Settings

Select any trigger or action by its row in the tree to open its settings panel.

See individual trigger and action articles for details on their respective settings.

***

### Localisation

Triggers used to assess a person's messages, and actions used to reply with text or attachments, can be localised to each of the AI agent's languages—as defined in its [General](/docs/modules/ai-agents/manage-ai-agents.md#general) settings.

To switch languages while editing triggers and actions:

1. From the Actions tab, select a **trigger** by its row.
2. In the opened page of the trigger's nested levels, use the **language dropdown** on the top right.

***

### Enabling/Disabling

Every trigger and action (except the mandatory Chat Started and Chat Closed by Live Agent triggers) can be enabled/disabled with the **Enabled** switch in its row.

Disabling will remove the trigger/action from the scripted flow.

***

### Deleting

In a trigger or action row, select <img src="/files/YxqVaN9l9tSPkVjHdh2g" alt="" data-size="line">> **Delete**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.proto.cx/docs/modules/ai-agents/workflows-and-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
