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

# Workflows

> Automate what happens when a record qualifies for a saved view.

## Overview

Workflows automate what RevyOps does when a new record enters a Saved View. Each workflow has one trigger (a Saved View) and one or more steps that run in order, such as sending a webhook, notifying a person or channel, or running an AI agent.

Open the **Workflows** page from the dashboard to see every workflow, search by name, filter by status or trigger, and create a new one.

<Note>
  Workflows are only available to admins.
</Note>

## Creating a Workflow

Click **New Workflow** to open the create dialog. You give it:

| Field             | Description                                                                                                                                   |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Workflow Name** | A name for the workflow, for example "High Intent Outreach"                                                                                   |
| **Clients**       | Optional. The workflow runs for these clients only, and you can change this later. Only clients the saved view is shared with can be selected |
| **Saved View**    | The saved view whose records trigger the workflow                                                                                             |

<Note>
  Workflows can only be built on contact, company or people saved views, and the saved view must be migrated to the new filters and have at least one filter condition.
</Note>

## The Trigger

Every workflow's trigger is "When a new record enters" the Saved View you picked. You can view the saved view's filters from the trigger card, but you can't edit them there. To change what qualifies a record, edit the saved view itself on its list page, and the workflow picks up the updated query automatically.

<Note>
  A record triggers the workflow once. Editing the saved view later doesn't re-run it for records that already qualified. Score-based views can take up to around 20 minutes to trigger; date-based views are checked once a day.
</Note>

<Warning>
  You must turn the workflow off before you can change its trigger (the saved view it's built on).
</Warning>

## Steps

Steps are added from the builder's step palette, under two groups: **Actions** and **Operators**.

### Actions

| Step         | What it does                       |
| ------------ | ---------------------------------- |
| **Webhook**  | Sends the record to a URL          |
| **Alert**    | Notifies a person or channel       |
| **AI Agent** | Runs a prompt with RevyOps context |

### Operators

| Step          | What it does                                              |
| ------------- | --------------------------------------------------------- |
| **Filter**    | Continues only if conditions match                        |
| **If / Else** | Splits the flow into named paths, each with its own steps |

<Note>
  A workflow needs at least one action step (Alert, Webhook or AI Agent) before it can be activated.
</Note>

Delay, Send to, and Update CRM steps appear in the palette but are marked "Soon" and aren't available yet.

### Webhook step

The Webhook step sends the record to a URL you configure. Its settings:

| Field               | Description                                                              |
| ------------------- | ------------------------------------------------------------------------ |
| **Webhook URL**     | The URL to send the record to                                            |
| **Delivery rate**   | Requests per second to this webhook. Leave blank for the default (10/s)  |
| **Example payload** | A read-only preview of the payload shape for this workflow's entity type |

Webhook URL and delivery rate can be set per client, or shared across all clients.

### Alert step

The Alert step notifies a person or channel. You choose an alert method: **Slack** or **Email**.

* Slack: set a **Slack webhook URL**.
* Email: set a **Recipient**, plus a **Subject** and **Message**. Subject and message support merge field tokens.

The Slack webhook URL and the email recipient can be set per client or shared; the subject and message are shared across all clients.

### AI Agent step

The AI Agent step runs a prompt against the record using RevyOps context. Its settings include:

| Field                          | Description                                                                                                                                                       |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Step label**                 | A name for the step                                                                                                                                               |
| **LLM provider** and **Model** | Which AI provider and model to use                                                                                                                                |
| **Prompt**                     | The instruction given to the agent. Reference output fields with `{{output_name}}`                                                                                |
| **Use web search**             | Lets the model search the web and read pages before answering. Slower and costs extra per record                                                                  |
| **Define outputs**             | Maps each result from the AI analysis to a RevyOps custom field, on the record itself or on its company. You can create a new field or write into an existing one |

<Note>
  The AI Agent step needs an API key connected per client. The panel shows whether a key is connected for the selected client, or for all clients.
</Note>

### If / Else (branch) step

The If / Else step splits the flow into named paths. Each path has its own match conditions (match **all** or **any**) and its own steps. There's always a fallback path ("Everyone else") that catches everything that didn't match another path.

<Note>
  If / Else steps can be nested up to a maximum depth, and a workflow can hold a maximum number of steps total.
</Note>

## Per-client configuration

Some step fields, like a Webhook URL or a Slack webhook URL, can be set once as a shared value and then overridden per client. Use the client selector in the step's settings rail to switch between **All clients** (the shared value) and an individual client. A client that hasn't been given its own value inherits the shared one.

Each client also has a readiness state for the workflow:

| State            | Meaning                                           |
| ---------------- | ------------------------------------------------- |
| **Ready**        | Everything required is configured for this client |
| **Needs setup**  | Something is still unconfigured                   |
| **Needs fixing** | Something configured is invalid                   |
| **Off**          | The workflow is switched off for this client      |

## Testing a step

Each step has a **Test** tab. To test a step:

1. Pick test records using the records picker (search the saved view's matching records, or pick specific ones).
2. Optionally check **Test on the first record only** to avoid sending multiple real messages (for example, real webhooks or alerts) while testing.
3. Click **Run test**.

Results show a status per record: **Passed**, **Review**, or **Error**. For AI Agent steps, results also show each output field's value side by side across records, along with token usage and web search/fetch counts when applicable. You can open the full results in a sheet to inspect the data in and data out for each record.

<Warning>
  A step must be fully configured before it can be tested, and at least one test record must be selected.
</Warning>

## Status

A workflow has one of these overall statuses:

| Status     | Meaning                                      |
| ---------- | -------------------------------------------- |
| **Draft**  | Not yet turned on                            |
| **Active** | Turned on                                    |
| **Paused** | Turned off after having been active          |
| **Off**    | Turned off for every client it's assigned to |
| **Mixed**  | On for some clients and off for others       |

Turn a workflow on or off from its row menu (**Turn on** / **Turn off**), or from the builder header. If a workflow is incomplete, RevyOps shows which steps still need to be finished before it can be turned on.

<Note>
  Turning a workflow on when no clients are switched on for it still activates the workflow, but it won't run for anyone until you switch on at least one client.
</Note>

## Editing a live workflow

Editing a workflow that's already active creates a draft of your changes. Existing records that already entered the workflow keep running the version that was live when they started; only new records use the updated version once you apply the draft. You can also discard a draft to go back to the live version.

## Run History

Each workflow has a **Run History** tab (available once the workflow starts running) showing every run: the record, its company, which trigger fired it, the last step reached, and its status (success, error, skipped or running). You can search run records, filter by client and step, and open a run to see its full step-by-step trace, including the payload sent and received at each step.

The workflow's overview also shows run stats over time: total runs, error count, and success rate.

## Deleting a Workflow

Click **Delete workflow** from a workflow's row menu. Deleting a workflow permanently removes it; this can't be undone.
