# Scheduled jobs

**The platform runs the recurring work, so nobody has to hold a session open.** A dataset refreshes, a dbt project runs, and whatever depends on that data starts as soon as it lands: a watcher with a `data_refreshed` trigger fires on the refresh, not on a guess about when it finishes.

A scheduled job is a [watcher](/features/watch/watchers.md): a `schedule` trigger (a 5-field cron and an IANA timezone) and one data action.

| Action            | What it runs                                                                                                                                                                      |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `refresh_dataset` | Refreshes a connection dataset you may edit (`datasetId`; `mode` `full` or `incremental`, the dataset's own when left out). A failed refresh publishes the event `refresh.failed` |
| `run_dbt`         | Runs a dbt project you may run (`projectId`; `command`, `run` by default; an optional `select` such as `tag:daily`)                                                               |

## In the app[​](#in-the-app "Direct link to In the app")

On the **Watchers** page, create a watcher whose **When** is a schedule (its time and timezone) and whose **Then** is **Refresh a dataset** or **Run a dbt project**. The watcher lists each run in its history. To act when the data lands, create a second watcher whose trigger is **its data is refreshed**; to be told when a refresh fails, one whose trigger is the event **a refresh failed**.

## With the SDK and MCP[​](#with-the-sdk-and-mcp "Direct link to With the SDK and MCP")

A schedule, from code:

```
from vibedasher import Vibedasher

from vibedasher.models import WatcherCreate



client = Vibedasher()

client.watchers.create(WatcherCreate.from_dict({

    "name": "orders nightly",

    "triggers": [{"kind": "schedule", "params": {"cron": "0 3 * * *", "timezone": "Europe/Paris"}}],

    "actions": [{"id": "refresh", "kind": "refresh_dataset", "params": {"datasetId": 211}}],

}))
```

```
await client.watchers.create({

  name: 'orders nightly',

  triggers: [{ kind: 'schedule', params: { cron: '0 3 * * *', timezone: 'Europe/Paris' } }],

  actions: [{ id: 'refresh', kind: 'refresh_dataset', params: { datasetId: 211 } }],

});
```

Over MCP, `create_watcher` takes the same body, and `test_watcher` dry-runs it: a `refresh_dataset` answers the dataset it would refresh, a `run_dbt` the project, command and selection it would run, or `refused:<reason>`.

Then the work that waits for it, as a watcher trigger:

```
{ "kind": "data_refreshed", "params": { "datasetIds": [211] } }
```

or `{ "dbtProjectId": 7 }` to fire when a dbt project finishes a successful run. To be told when it fails instead:

```
{ "kind": "event", "params": { "event": "refresh.failed", "datasetIds": [211] } }
```

## Limits[​](#limits "Direct link to Limits")

* **A schedule runs in its own timezone**, across a clock change, and fires within about five minutes of its due time: cron here means "no earlier than", not "exactly at".
* A `refresh_dataset` refreshes a dataset made from a connection. A flat file has nothing to re-read, a live dataset is always current, and a dataset a dbt project feeds is refreshed by that project: each is refused with the reason.
* A `data_refreshed` trigger names 1 to 10 datasets, or one dbt project.
* A watcher runs as its owner, on the datasets and projects its owner may edit or run.

## Reference[​](#reference "Direct link to Reference")

* [`create-watcher`](/reference/create-watcher.md), [`test-watcher`](/reference/test-watcher.md), [`list-watcher-kinds`](/reference/list-watcher-kinds.md)
* Every trigger, event and action: [Watchers](/features/watch/watchers.md)
* Refreshes in depth, and how old the numbers are: [Keep data fresh](/features/data/keep-data-fresh.md)
