# Workflows and actions

In the AI Agents dashboard, the **Workflows** tab is used to customise an agent's scripted [chat flow](https://documentation.proto.cx/docs/modules/ai-agents/..#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="workflows-and-actions/human-handoff">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="workflows-and-actions/send-message">Send Message</a></td><td>Replies with one of the defined static messages.</td></tr><tr><td><a href="workflows-and-actions/send-file">Send File</a></td><td>Replies with a file attachment or link.</td></tr><tr><td><a href="workflows-and-actions/show-carousel">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="workflows-and-actions/show-survey">Show Survey</a></td><td>Replies with a survey or questions to collect feedback.</td></tr><tr><td><a href="workflows-and-actions/collect-feedback">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="workflows-and-actions/create-ticket">Create Ticket</a></td><td>Creates and sends the first email in a new ticket.</td></tr><tr><td><a href="workflows-and-actions/human-handoff">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="workflows-and-actions/external-handoff">External Handoff</a></td><td>Transfers the chat to Zendesk or Bitrix24 if integrated.</td></tr><tr><td><a href="workflows-and-actions/jump">Jump to Trigger/Action</a></td><td>Jumps to another spot in the chat flow.</td></tr><tr><td><a href="workflows-and-actions/branch">If/Else</a></td><td>Conditionally branches the chat flow.</td></tr><tr><td><a href="workflows-and-actions/set-variable">Set Chat Variable</a></td><td>Creates or modifies a chat variable.</td></tr><tr><td><a href="workflows-and-actions/send-api-request">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](https://documentation.proto.cx/docs/modules/manage-ai-agents#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="https://849782063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXEtIIGTPyKf3CFAsNTzZ%2Fuploads%2FGmVyiKjI5Hc8d3ZyEqFn%2FSize%3D48%2C%20Theme%3DRegular.png?alt=media&#x26;token=9633c5e9-9cb6-4ee2-9431-0d80e7015082" alt="" data-size="line">> **Delete**.
