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

# Workflows

> Automate tasks when events happen in your AI Agent.

Workflows automatically perform tasks when selected events happen in your AI Agent. Use them to update conversations and contacts, send messages, connect other apps, and route work based on conditions.

![](https://chatling-assets.b-cdn.net/sync-contact-crm-workflow.jpg)

## How workflows work

* **[Triggers](https://docs.chatling.ai/ai-agent/workflows/triggers.md)** start the workflow when an event occurs.
* **[Actions](https://docs.chatling.ai/ai-agent/workflows/actions.md)** perform tasks such as syncing with CRMs or sending Slack messages.
* **[Conditions](https://docs.chatling.ai/ai-agent/workflows/condition.md)** route the workflow based on rules you define.
* **[Wait](https://docs.chatling.ai/ai-agent/workflows/wait.md)** pauses a workflow before continuing.

## Create a workflow

1. Open your AI Agent and select **Workflows**.

![](https://chatling-assets.b-cdn.net/click-workflows-menu.jpg)

2. Click **New** or **Create workflow**.
3. Enter a name and optional description.

![](https://chatling-assets.b-cdn.net/create-workflow-dialog.jpg)

4. Select the **Start** node and add one or more trigger events.

![](https://chatling-assets.b-cdn.net/add-start-triggers.jpg)

5. Add actions and conditions from the left sidebar.
6. Connect the steps in the order they should run.
7. Click **Publish** to activate the workflow.

> [!NOTE]
>
> Only the published version runs. Changes remain in draft until you publish them.

## Use variables

Insert variables into supported fields by typing `{{` or opening the variable menu.

You can use:

* System variables
* Custom variables

If a system variable is unavailable, select **Import system variables** from the variable menu.

## Publish and manage

* **Save:** keeps your current draft.
* **Publish:** makes the latest draft available to run.
* **Activate:** allows the workflow to respond to new events.
* **Pause:** stops the workflow from running.
* **Duplicate:** creates a copy you can edit separately.
* **Archive:** removes the workflow from active use while keeping it available.

## Review activity

* **Run history:** view recent runs, each completed step, and any errors.

![](https://chatling-assets.b-cdn.net/open-run-history-workflows.jpg)

* **Version history:** preview published versions or restore one as the current draft.

![](https://chatling-assets.b-cdn.net/open-version-history-workflows.jpg)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.