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

# Rules & Actions

> Turn analytics into action: rules watch the data on a canvas and, on a schedule, when a condition is met or at the press of a button, send an email, post to Slack or call your own API.

> [!NOTE]
>
> Rules & Actions is a **Beta** feature. A builder has to turn it on for each workspace.

A dashboard tells you something changed. A **rule** does something about it. Rules live on a [canvas](https://docs.upsolve.ai/ai-agent-builder/interact/canvas.md) and read its charts, so the same numbers your team looks at can trigger an email, a Slack message or a call into your own systems:

* *Every Monday at 8:00, email the leadership team a PDF of this canvas.*
* *Every day, if total spend in the last 12 months passes 20M, message me on Slack.*
* *When a new transaction over \$10,000 appears, flag it in our billing system.*
* *Put a "Request approval" button on the canvas that posts the selected supplier to our procurement API.*

You describe the rule in plain English and a designer builds it. Nothing is sent until you test it and switch it on.

![A canvas with the Rules sidebar open, showing a New rule button and an alert rule card that says 'When every day at 8:00, if the sum of spend is at least 20,000,000, then send to Slack', with an on/off switch](https://mintcdn.com/upsolve/6hKReQ_w6B1jt5Gu/images/ai-agent-builder/improve/rules-canvas-sidebar.png?fit=max\&auto=format\&n=6hKReQ_w6B1jt5Gu\&q=85\&s=b8c5fee3383b15e494a3c46ca5e5aad6)

## Turn rules on for a workspace

Rules are off by default. A builder turns them on:

1. Open the workspace and go to **Workspace settings → Rules & Actions**.
2. Switch on **Allow rules in this workspace**.
3. Under **Email from rules**, decide whether email rules may **Send from Upsolve when no domain is set up**. If your organization has a verified sending domain, emails come from it; otherwise they come from Upsolve's address only when this is on.

Once rules are on, everyone with access to the workspace can create rules on their own canvases, including your embedded end users.

## The parts of a rule

Every rule answers three questions: **when** does it run, **what** does it check, and **what does it do**.

### When: three kinds of rule

| Kind | Fires… | Example |
| - | - | - |
| **Schedule** | On every tick of a schedule (at most every 5 minutes), in a time zone you choose. | Email this canvas every Monday at 8:00. |
| **Alert** | On a schedule, but only when a condition on the data is met. | Message me when 12-month spend passes 20M. |
| **Button** | When someone presses a button the rule puts on the canvas. | "Flag this supplier for review". |

### If: the condition (alerts)

An alert reads one chart that is already on the canvas and checks it. The condition can be:

* **A filter on the rows**, such as *amount > 10,000* or *status is Overdue*.
* **A threshold** on the result: any row at all, a row count, or the sum, average, minimum or maximum of a column.
* **A question for AI**, for things a filter can't express ("does this look unusual?"). It answers yes or no, or picks one of 2 to 10 options you give it.

You also choose how often an alert fires:

* **On change**: only when the answer changes, for example when spend first crosses the threshold.
* **Every time**: on every check where the condition holds.
* **New rows only**: once per new row, for example each new large transaction. This needs a column that identifies a row, such as `transaction_id`.

An optional **cooldown** stops a noisy alert from firing again too soon.

### Then: the action

Each rule does one thing:

* **Email**: up to 25 recipients you choose. Recipients are fixed when you write the rule; they never come from the data.
* **A tool on an MCP connection**: anything a connected MCP server can do. This is how rules post to **Slack**: connect Slack, then ask for "send it to #procurement-alerts". The channel or recipient is fixed when you save the rule, so the data can't redirect a message.
* **A write to an API connector**: call an approved write operation on one of your workspace's API connectors, such as `POST /transactions/{id}/flag`.

### Attach (optional)

Any rule can attach the evidence:

* **A PDF of the canvas**, sent as a link to a report page with a **Download PDF** button. Report links last 30 days.
* **A link to the canvas.**
* **The rows behind up to three charts**, as CSV files.

The designer also writes a small transform that maps the data onto the action, for example which columns go into the Slack message. You can test it before anything is sent.

## Create a rule

1. Open a canvas, and choose **Actions → Rules**. The **Rules** sidebar opens.
2. Click **New rule**.
3. Describe what you want in the designer chat on the left, for example: *"Every weekday at 9, if any open purchase order is more than 30 days late, email me and [procurement-lead@acme.com](mailto:procurement-lead@acme.com) the list as a CSV."*
4. The draft on the right fills in as the designer works, under **When**, **If**, **Attach** and **Then**. Keep chatting to change any part of it.
5. Click **Send test** to see exactly what the rule would send, then **Save**.
6. Switch the rule **on** with its switch in the Rules sidebar.

![The canvas Actions menu open, with Rules listed under Present](https://mintcdn.com/upsolve/6hKReQ_w6B1jt5Gu/images/ai-agent-builder/improve/rules-canvas-actions-menu.png?fit=max\&auto=format\&n=6hKReQ_w6B1jt5Gu\&q=85\&s=76393ee2ee66005ef8b521b4792858dd)

The designer reads the canvas and the chart you named, checks the condition against today's data, and tells you what it assumed (here, the time zone and the recipient) so you can correct it before saving:

![The rule designer: on the left, the designer explains the assumptions it made and how the weekly Cancelled Spend alert works; on the right, the draft rule with When, If, Attach, Then and To, plus Send test and Save](https://mintcdn.com/upsolve/6hKReQ_w6B1jt5Gu/images/ai-agent-builder/improve/rules-designer.png?fit=max\&auto=format\&n=6hKReQ_w6B1jt5Gu\&q=85\&s=5d4065b1593a826ddf50d1e5a8168656)

Opening a saved rule shows the same editor with the rule as it stands:

![The rule editor for a saved alert: the rule card with When, If and Then, plus Send test and Save buttons](https://mintcdn.com/upsolve/6hKReQ_w6B1jt5Gu/images/ai-agent-builder/improve/rules-modal-existing.png?fit=max\&auto=format\&n=6hKReQ_w6B1jt5Gu\&q=85\&s=2004bd0f168572edd259a2ad3f134204)

Rules read charts that are already on the canvas. If the data you want to watch isn't there yet, add the chart to the canvas first.

### Or ask the chat

You can also create a rule from the canvas's **Ask AI** chat. Ask for it in the same words ("alert me on Slack when cancellation rate goes above 5%"), and the agent hands the request to the rule designer, saves the rule and, for a button, places it on the canvas. The chat can test, list and switch off rules, but **it can never switch a rule on or delete one**. It shows you a card for the rule, and you switch it on yourself.

## Test before anything is sent

Nothing goes out while you're designing:

* The designer checks the condition against the live data and shows what it would find, without sending anything.
* **Send test** builds the real message and shows it in a **Confirm send** dialog: what it goes through, where it goes, what it says, the attachments and the data. Nothing is sent until you click **Confirm**.

The same confirmation appears every time a person sends something by hand: a test, a button press, or a retry. Sends must be confirmed within 5 minutes.

## Switch it on, and keep it healthy

Edits are kept as unsaved changes until you click **Save**, and every save creates a new version of the rule. **Only a person can switch a rule on.** The chat agent can draft, save and switch off rules, never switch them on.

Upsolve pauses a rule automatically, and tells you why, when:

* its owner hasn't been active for 14 days,
* it has failed 5 times in a row,
* the connection it sends through was lost,
* the chart or canvas it reads was removed,
* a builder paused it, or
* it became invalid.

Only a person can switch it back on.

## Run history

Every time a rule runs, it records a run: when, why (**Scheduled**, **Alert**, **Clicked by** *name*, **Test**, or **Suppressed** when a limit was hit), and how it went (**Sent**, **Failed**, **Sending**, **Check failed**, **Awaiting confirmation**, **Fired**). Each run carries the rule version it ran.

Open a run to see the data it read, what it sent, any files (**Open report** / **Download**), and the response from the destination. A failed run can be retried by hand. Writes to an API are never retried automatically.

The **Runs** tab of the Rules sidebar shows the canvas's runs; a rule's own editor has a **Runs** tab too. Runs are kept for 90 days and files for 30 days.

## Buttons on the canvas

A **button** rule puts an action right on the canvas, for the people who use it. The designer writes the button; once saved, use **Add to canvas** on its card. In **Edit** mode you can drag and resize it like any block.

* Only someone who can edit the canvas's design can add a button to it.
* A switched-off button stays on the page, marked disabled, and can't be pressed.
* A button that can't be used shows why: switched off, connection missing, daily limit reached, and so on.
* Buttons never work on a public canvas link.

## Who a rule acts as

This decides whose data a rule reads and whose account it sends from:

* **Schedules and alerts** run as the rule's **owner**, with the owner's data access and the owner's connection.
* **A button** runs as **the person who presses it**, with their data access and their own connection. The first time someone presses a Slack or MCP button, they choose which of their connections to use. An API connector button uses the presser's own credentials; if they haven't connected yet, the button asks them to.
* **Email** buttons always send from your organization's sender.

So a rule can never show or send more than the person it runs as is allowed to see.

## For builders: oversee every rule

**Monitoring → Rules & Actions** lists every rule in the workspace, whoever made it, and every run of them. It appears in the sidebar once rules are on. From here a builder can **Pause** any rule. Read-only members can see the list but not pause rules.

![The Rules & Actions monitoring page listing each rule with its owner, name and canvas, type, status and when it last fired](https://mintcdn.com/upsolve/6hKReQ_w6B1jt5Gu/images/ai-agent-builder/improve/rules-oversight.png?fit=max\&auto=format\&n=6hKReQ_w6B1jt5Gu\&q=85\&s=7ce029045867ce78c2a58b8eff11f73b)

## Limits

| Limit | Value |
| - | - |
| Rules switched on per person | 10 (and 25 drafts) |
| Alerts switched on per workspace | 20 |
| Times rules can fire per day | 100 per person, 500 per organization |
| Condition checks per day | 10,000 per organization |
| Shortest schedule | Every 5 minutes |
| Rows an alert reads | 5,000 (up to 200 checked by an AI question) |
| Rows sent in a message | 50 |
| CSV attachments | 3 per rule, 10 MB each |
| Button presses | 10 per person per minute |

When a limit is hit, the run is recorded as **Suppressed** rather than sent.

> [!NOTE]
>
> Rules aren't available to organizations that handle confidential data, or in Upsolve Local and on-premises installations. Each rule has a single action; to notify two places, create two rules. A rule can move to another canvas only while it's switched off.

## Next steps

> **[Canvas](https://docs.upsolve.ai/ai-agent-builder/interact/canvas.md)**
>
> Build the canvas your rules watch.

> **[MCP as Context Source](https://docs.upsolve.ai/ai-agent-builder/mcp-context.md)**
>
> Connect Slack and other tools that rules can send through.

> **[Builder Agent](https://docs.upsolve.ai/ai-agent-builder/builder-agent.md)**
>
> Improve the context behind the charts your rules read.

> **[Self-improvement](https://docs.upsolve.ai/ai-agent-builder/self-improvement.md)**
>
> Let the workspace improve itself on a schedule.


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