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

# Automations

> Schedule and automate your enrichment runs.

Automations let you run enrichments without manual intervention. Instead of clicking **Run** each time, you configure a trigger (a schedule, a data change, or a manual button) and Databar handles the rest.

## Automation modes

Databar supports three automation strategies. You select one when adding or editing an enrichment under the **Update frequency** section.

<Tabs>
  <Tab title="Run on click" icon="mouse-pointer">
    The default mode. Nothing runs until you manually click the **Run** button in the table toolbar. Use this when you want full control over when data is processed.
  </Tab>

  <Tab title="Run on update" icon="bolt">
    The enrichment runs automatically whenever a source column changes. If a new email is added or an existing domain is modified, the enrichment fires for the affected rows.

    This is the best mode for live data flows where new records arrive continuously, whether via API, webhook, or manual entry.
  </Tab>

  <Tab title="Run on schedule" icon="clock">
    The enrichment runs at a fixed interval. Available frequencies:

    | Interval                       | Use case                  |
    | ------------------------------ | ------------------------- |
    | Every minute                   | Near-real-time monitoring |
    | Every 5 / 10 / 15 / 30 minutes | Frequent polling          |
    | Hourly                         | Standard tracking cadence |
    | Daily                          | Daily digests and reports |
    | Weekly                         | Low-frequency updates     |
    | Monthly                        | Periodic audits           |

    This is the best mode for trackers and dashboards that need regular refreshes without external triggers.
  </Tab>
</Tabs>

## Setting up an automation

When you add a new enrichment to your table, the setup wizard includes an **Update frequency** section. Select the mode that fits your workflow:

1. **Run on click**: no additional configuration needed.
2. **Run on update**: select the source columns that should trigger re-enrichment when they change.
3. **Run on schedule**: pick the interval from the dropdown.

You can change the automation mode at any time by editing the enrichment settings.

## Run conditions with automations

[Run conditions](/product-guide/run-conditions) apply to all three automation modes. Even when an enrichment is triggered automatically (by schedule or data change), each row is still evaluated against the condition before it runs. Rows that fail the condition are skipped and do not consume credits.

This lets you combine powerful automations with precise targeting. For example, you can schedule an hourly run but only process rows where `{status} == "active" && {email} != ""`.

## Credit usage

<Warning>
  Automated enrichments consume credits on every run, just like manual runs. Make sure your account has sufficient credits before enabling high-frequency schedules. Monitor your balance on the [Credits and billing](/product-guide/credits-and-billing) page.
</Warning>

## Scheduling for data sources (query builder)

If your table is powered by a data source through the query builder, you can schedule the data source itself to refresh on a recurring basis.

### Frequency options

Data source schedules support:

* **Weekly**, **daily**, **hourly**, or **minute intervals**: pick from the dropdown.
* **Cron expressions**: for precise timing (e.g., every weekday at 9 AM UTC).

### Update rules

| Rule               | Behavior                                                                                         |
| ------------------ | ------------------------------------------------------------------------------------------------ |
| **Update dataset** | Replaces the existing rows with the latest results. Use when you want a current snapshot.        |
| **Expand dataset** | Appends new rows without removing existing ones. Use when you want to accumulate data over time. |

### Run on launch

Enable **Run on launch** to execute the data source query immediately when the schedule is activated, rather than waiting for the first scheduled interval.

### Dynamic dates

Data source parameters accept dynamic date values:

* `now()`: the current date and time at execution.
* Relative offsets like `-1 day`, `-2 days`, `-3 days`: useful for fetching recent data windows.

This lets you build queries like "fetch all new leads from the last 24 hours" that stay current without manual updates.

<Info>
  You cannot run single ad-hoc queries while a scheduler is active on the same data source. Pause the scheduler first if you need to run a one-off query.
</Info>

## Next steps

<CardGroup cols={2}>
  <Card title="Enrichments" icon="wand-magic-sparkles" href="/product-guide/enrichments">
    Learn how to add and configure enrichments.
  </Card>

  <Card title="Run conditions" icon="filter" href="/product-guide/run-conditions">
    Write conditional expressions to target specific rows.
  </Card>

  <Card title="Credits and billing" icon="coins" href="/product-guide/credits-and-billing">
    Monitor credit usage and manage your plan.
  </Card>
</CardGroup>
