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

# Automations in Chevre: Event-Based and Scheduled Rules

> Set up event-based rules and scheduled tasks in Chevre to execute actions automatically — no coding or manual intervention needed.

Automations in Chevre let you define rules that execute actions automatically based on triggers, schedules, or API calls — without any manual intervention. Where workflows are tied to a specific project, automations operate at the workspace level and give you fine-grained control over when they fire, what conditions must be met, and exactly what actions are taken. Use them to eliminate repetitive work, keep your team informed, and enforce consistent processes across every project.

## Two types of automations

Chevre supports two distinct automation models, each suited to different use cases.

**Event-based automations** fire in response to something happening inside Chevre — a task is marked complete, a form is submitted, a member joins a project, or any other workspace event. These are ideal for real-time reactions to activity.

**Scheduled automations** run on a recurring cron schedule — every morning at 8 AM, every Friday at 5 PM, the first of every month. Use them for digests, reports, clean-up jobs, or any action that should happen at a predictable cadence regardless of user activity.

## Creating an automation

<Tabs>
  <Tab title="Event-Based">
    <Steps>
      <Step title="Open the Automations page">
        In the left sidebar, click **Automations**. Then click **+ New Automation** in the top-right corner and select **Event-Based** when prompted to choose a type.
      </Step>

      <Step title="Name your automation">
        Give your automation a descriptive name — for example, `Notify team on task completion`. Click **Continue**.
      </Step>

      <Step title="Choose a trigger event">
        Select the event that should start the automation. Available trigger events include things like **Task Completed**, **Form Submitted**, **Member Added**, and **Project Archived**. Click the event to select it, then click **Next**.
      </Step>

      <Step title="Add conditions (optional)">
        Conditions let you filter when the automation fires. Click **+ Add Condition** to add a rule — for example, only fire when `task.priority` **is** `High`. You can stack multiple conditions using **AND** (all must be true) or **OR** (at least one must be true) logic. Skip this step if you want the automation to fire on every matching event.
      </Step>

      <Step title="Configure actions">
        Click **+ Add Action** and select the action you want to run. Configure any required fields (for example, the Slack channel or email recipient). Add as many actions as you need — they execute in sequence, top to bottom.
      </Step>

      <Step title="Save and enable">
        Click **Save**. Toggle the automation to **Enabled** to make it live. You can disable it at any time from the Automations list without deleting it.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Scheduled">
    <Steps>
      <Step title="Open the Automations page">
        In the left sidebar, click **Automations**. Then click **+ New Automation** in the top-right corner and select **Scheduled** when prompted to choose a type.
      </Step>

      <Step title="Name your automation">
        Give your automation a descriptive name — for example, `Weekly project digest`. Click **Continue**.
      </Step>

      <Step title="Set the cron schedule">
        Enter a cron expression to define when the automation runs. For example, `0 9 * * 1` runs every Monday at 9:00 AM. If you're not familiar with cron syntax, use the visual scheduler — click **Use Schedule Builder** to choose frequency, time, and day from dropdowns instead.

        See the [cron quick reference](#cron-expression-quick-reference) at the bottom of this page for common expressions.
      </Step>

      <Step title="Select a timezone">
        Choose the timezone that the schedule should be evaluated in. By default this is set to your workspace's timezone, but you can override it per automation.
      </Step>

      <Step title="Configure actions">
        Click **+ Add Action** and choose what the automation should do when it runs — send a report email, post a Slack digest, call a webhook, and so on. Add as many actions as needed.
      </Step>

      <Step title="Save and enable">
        Click **Save**, then toggle the automation to **Enabled**. The **Next Run** column in the Automations list shows you exactly when it will fire next.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Conditions

Conditions give you precise control over when an automation fires. Each condition compares a field value against a target using an operator.

| Operator       | Meaning                   |
| -------------- | ------------------------- |
| `is`           | Exact match               |
| `is not`       | Does not match            |
| `contains`     | String includes the value |
| `greater than` | Numeric comparison        |
| `less than`    | Numeric comparison        |
| `is empty`     | Field has no value        |
| `is not empty` | Field has any value       |

Group multiple conditions with **AND** to require all of them to be true, or **OR** to fire when any one of them is true. You can mix AND/OR groups for more complex logic.

## Available actions

Every automation can execute one or more of the following action types. Actions run sequentially in the order you arrange them.

| Action                 | Description                                                   |
| ---------------------- | ------------------------------------------------------------- |
| **Send email**         | Send a formatted email to one or more recipients              |
| **Send Slack message** | Post a message to a Slack channel or user                     |
| **Create task**        | Automatically create a new task in a specified project        |
| **Call webhook**       | Send an HTTP POST request to an external URL                  |
| **Update field**       | Set or clear a field value on a record                        |
| **Run script**         | Execute a JavaScript snippet with access to the event payload |

## Viewing automation run history

To review past runs for an automation:

1. Navigate to **Automations** in the left sidebar.
2. Click the name of the automation you want to inspect.
3. Select the **Runs** tab.

Each entry in the run history shows the run timestamp, trigger details, conditions evaluated, actions executed, and a pass/fail status for each step. Click any run to expand the full execution log.

## Enabling and disabling automations

You can toggle any automation on or off without deleting it. From the **Automations** list, click the toggle in the **Status** column next to the automation. Disabled automations will not fire, but their configuration and run history are fully preserved. Re-enable them at any time.

<Warning>
  Automation runs count against your plan's monthly limit. Once you reach the limit, automations will stop firing until the limit resets at the start of your next billing cycle.

  | Plan       | Monthly run limit |
  | ---------- | ----------------- |
  | Free       | 100 runs          |
  | Pro        | 10,000 runs       |
  | Enterprise | Unlimited         |

  Upgrade your plan in **Settings → Billing** if you're approaching your limit.
</Warning>

## Managing automations via the API

You can list, create, and inspect automation run history programmatically using the Chevre REST API — useful for scripted setup, deployment pipelines, or building your own monitoring dashboards.

**List all automations in your workspace**

```bash theme={null}
curl https://api.chevre.io/v1/automations \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

**Create a new automation**

```bash theme={null}
curl -X POST https://api.chevre.io/v1/automations \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Notify team on task completion",
    "type": "event",
    "trigger": "task.completed",
    "actions": [
      {
        "type": "slack_message",
        "channel": "#general",
        "message": "✅ Task completed: {{task.name}}"
      }
    ],
    "enabled": true
  }'
```

**Fetch the run history for an automation**

```bash theme={null}
curl https://api.chevre.io/v1/automations/auto_01hx3k9z/runs \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

The runs response includes a timestamped list of executions, the trigger details, and a per-action status for each run — the same data visible in the **Runs** tab in the Chevre UI.

## Cron expression quick reference

<Accordion title="Every day at midnight">
  ```text theme={null}
  0 0 * * *
  ```

  Runs once per day at 12:00 AM in the selected timezone.
</Accordion>

<Accordion title="Every weekday at 9 AM">
  ```text theme={null}
  0 9 * * 1-5
  ```

  Runs Monday through Friday at 9:00 AM. The `1-5` range covers Monday (1) to Friday (5).
</Accordion>

<Accordion title="Every Monday at 8 AM (weekly digest)">
  ```text theme={null}
  0 8 * * 1
  ```

  Runs once a week on Monday morning — useful for weekly summary reports.
</Accordion>

<Accordion title="First day of every month at 6 AM">
  ```text theme={null}
  0 6 1 * *
  ```

  Runs at 6:00 AM on the 1st of each month. Ideal for monthly billing reports or clean-up jobs.
</Accordion>

<Accordion title="Every hour">
  ```text theme={null}
  0 * * * *
  ```

  Runs at the top of every hour, 24 times per day. Keep your monthly run budget in mind when using high-frequency schedules.
</Accordion>

<Accordion title="Every 15 minutes">
  ```text theme={null}
  */15 * * * *
  ```

  Runs four times per hour. This is the minimum supported interval on the Pro plan; the Free plan supports hourly frequency at minimum.
</Accordion>
