Skip to main content

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: a schedule trigger (a 5-field cron and an IANA timezone) and one data action.

ActionWhat it runs
refresh_datasetRefreshes 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_dbtRuns a dbt project you may run (projectId; command, run by default; an optional select such as tag:daily)

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​

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​

  • 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​