# Scheduled Jobs

Source: https://docs.autessa.com/docs/guide/scheduled-jobs

> Run tools, agents, and AutessaDB updates on recurring, cron, or one-time schedules.

# Scheduled Jobs

Scheduled jobs run work on a timer: invoke a tool, invoke an agent, or update an AutessaDB table on a recurring interval, a cron schedule, or once at a specific time. They're the "when" half of automation — pair them with triggers, which are the "on data change" half.

## What it's for

- **Recurring reports and digests** — an agent that summarizes yesterday's activity every morning at 9.
- **Data syncs and maintenance** — a tool that pulls from an external API every 15 minutes, or a nightly row cleanup.
- **Future-dated one-offs** — run something once at a specific wall-clock time.

## Navigating here

From the dashboard sidebar, open **Scheduled Jobs → Jobs** for the job list and **Scheduled Jobs → History** for the execution history. The job list has ownership tabs (**Owned By Me / Shared With Me / Company Wide**), plus filters by action type (Agent / Tool / Database), status, and sort order. Each row shows the job's next execution, last execution, and total execution count, with quick pause/resume and delete actions.

## Key concepts

### Schedules

A job runs on one of three schedule patterns:

| Pattern | Configuration | Timezone |
| --- | --- | --- |
| **Recurring (every X)** | Run every N minutes, hours, or days | None needed — interval-based |
| **Custom schedule (cron)** | Daily / Weekly / Monthly builders (hour, minute, days), or an **Advanced** raw cron expression | Required |
| **Run once** | A single future date and time | Required |

The cron builder shows the generated expression and previews the next three runs in your chosen timezone. Advanced mode takes a 6-field expression (`minute hour day-of-month month day-of-week year`, with `?` in exactly one of day-of-month or day-of-week — AWS cron format).

### Actions

The same three action types as [AutessaDB triggers](/docs/guide/autessadb/triggers.md):

- **Invoke Tool** — pick a target tool and fill its arguments; optionally set environment variables for the run and a **Continue on error** flag.
- **Invoke Agent** — pick a target agent, write its input prompt, and fill any prompt template variables the agent defines.
- **Update AutessaDB** — insert or update a row in a target table, choosing which columns to set.

Values in any action can reference the job variables `@@{jobName}`, `@@{triggerDate}` (the run date, `YYYY-MM-DD`), and `@@{triggerTime}` (the full ISO-8601 run timestamp) — handy for stamping rows or parameterizing prompts with "today". The action type is fixed once the job is created.

### Job lifecycle and sharing

Jobs are created enabled and can be paused/resumed from the list or the job's detail page, which also shows execution stats and metadata. Like other resources, jobs are shared from the [Share dialog](/docs/guide/platform/sharing.md) with people, teams, company roles, or everyone at your company, with transfer of ownership by the owner.

### Execution history

**Scheduled Jobs → History** aggregates every run across all jobs, with success/failure counts and a success-rate summary for the selected month. Each row shows the job name, resource type, start/end time, duration, status, and attempt number; clicking a row opens the full execution details — error message, response JSON, and the payload that was sent.

## How to schedule an agent to run daily

1. Go to **Scheduled Jobs → Jobs** and create a new job; give it a name and description.
2. Under **Schedule Configuration**, pick **Custom schedule → Daily**, set the hour and minute, and choose your timezone. Check the "next 3 runs" preview.
3. Under **Action Configuration**, choose **Invoke Agent**, select the agent, and write its input — e.g. `Summarize activity for @@{triggerDate} and email the digest.`
4. Fill any prompt template variables, then click **Create Job**. The job starts enabled; watch its first run on the History page.

## How to investigate a failed run

1. Open **Scheduled Jobs → History** and filter to **Failed** for the relevant month.
2. Click the run to open **Execution Details** — the error message, the response JSON, and the exact payload are all there.
3. Fix the job's action config (or the underlying tool/agent) and either wait for the next scheduled run or temporarily switch the schedule to test sooner.

## Sharing and access levels

Every job starts **private** to its owner. Share it with people, teams, company roles, or everyone at your company, each at its own level, from the [Share dialog](/docs/guide/platform/sharing.md). Access adds up, so someone covered by several grants gets the highest one. What each level allows:

| Level | What it lets a teammate do |
| --- | --- |
| READ | View the job |
| WRITE | Edit the job and enable/disable it |
| PUBLISH | Nothing beyond READ — jobs have no publish step, and job edits require WRITE |
| ADMIN | Share and delete the job |

The owner always has ADMIN implicitly; transferring ownership is owner-only. When you share a job, the Share dialog also lists the tool, agent, multi-agent, or table it targets and shares it in the same step, so teammates can follow what the job does.

## Related

- [AutessaDB Triggers](/docs/guide/autessadb/triggers.md)
- [Agents](/docs/guide/agentic/agents.md)
- [Tools](/docs/guide/agentic/tools.md)
- [Scheduled Events Poweruser API](/docs/api/poweruser/scheduled-events.md)
- [Scheduled Events API](/docs/api/scheduled-events.md)

