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

# Scheduled tasks

> Give an agent a cron or a one-off run, and fire it on demand to test it.

A scheduled task runs an agent with no user message. Its body is the instruction the agent receives when it fires. See [Automations](/agents/automations) for the concept.

## list\_schedules

Lists an agent scheduled tasks in full: `slug`, `name`, `body`, `cron` or `runAt`, `timezone`, provider and model, enabled state and last run.

<ParamField body="agentId" type="string" required />

This is how you audit what an existing scheduled task actually does.

## upsert\_schedule

Creates a scheduled task, or updates it when `slug` is given.

<ParamField body="agentId" type="string" required />

<ParamField body="slug" type="string">
  Omit to create. Pass an existing slug to update.
</ParamField>

<ParamField body="name" type="string">
  Required when creating. The slug is derived from it.
</ParamField>

<ParamField body="body" type="string">
  Required when creating. The instruction sent to the agent when the task fires, written as if you were talking to it.
</ParamField>

<ParamField body="cron" type="string">
  Standard 5-field cron, for example `0 9 * * 1` for every Monday at 9. Required when creating unless you pass `runAt`.
</ParamField>

<ParamField body="runAt" type="string">
  ISO date for a one-off run. The task disables itself after it fires.
</ParamField>

<ParamField body="timezone" type="string">
  IANA timezone, for example `Europe/Paris`. Without it, the cron is read in the Box server timezone.
</ParamField>

<ParamField body="description" type="string" />

<ParamField body="enabled" type="boolean" />

Provider and model default to the agent own settings.

<Warning>
  Two things to know. The slug is derived from the name and is what `run_schedule_now` and `delete_schedule` address, so read it back from the response. And an update can change a cron but cannot clear it, nor turn a recurring task into a one-off: delete and recreate for that.
</Warning>

## run\_schedule\_now

Fires a scheduled task immediately, without waiting for its cron.

<ParamField body="agentId" type="string" required />

<ParamField body="slug" type="string" required />

It works on a disabled task, does not enable it, and does not touch its last-run date. That makes it safe for testing an instruction before putting the task live.

Returns a `runId`. Read the outcome with [`get_run`](/api/tools/runs#get-run).

## delete\_schedule

<ParamField body="agentId" type="string" required />

<ParamField body="slug" type="string" required />

<ParamField body="confirm" type="boolean" required>
  Must be `true`.
</ParamField>
