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

# Schedules

> Run agents and commands on a cron in your project's environment runtime, or trigger them on demand.

Fimo runs recurring work two ways: **agents** activated with a `schedule` trigger, and **scheduled commands** that run any CLI command on a cron. Both execute in the project's environment runtime — not on your machine.

## Run an agent on demand

Once an agent is deployed and activated, trigger a run yourself instead of waiting for its cron:

```bash theme={null}
fimo agents run <name>              # trigger a manual run → prints a sessionId
fimo agents run <name> --env preview
```

<Warning>
  `run` refuses if `agents/<name>/` has uncommitted changes — the server dispatches the **deployed** bundle, so deploy first. Pass `--skip-drift-check` to dispatch the deployed version anyway.
</Warning>

## Scheduled commands

`fimo schedules` runs any command — a publish, a validation, a test script — on a cron for the current environment:

```bash theme={null}
fimo schedules create nightly --cron "0 2 * * *" --do "fimo publish"
fimo schedules create smoke --cron "*/15 * * * *" --do "pnpm test"
fimo schedules list
fimo schedules run smoke            # run now, without waiting for cron
fimo schedules delete smoke
```

Cron uses standard five-field syntax, and schedules must not run more often than **every five minutes**. On each run, Fimo prepares the environment, refreshes project files and dependencies, authenticates as the schedule owner, then runs your command from the project root.

<Note>
  `list`, `run`, and `delete` operate on the current checkout's environment unless you pass `--env <name>`. A failed command marks the schedule `failed` and exits non-zero.
</Note>

## What's next

<Columns cols={3}>
  <Card title="Runs, reports & logs" icon="list-check" href="/docs/agents/runs">
    Inspect the sessions your schedules produce.
  </Card>

  <Card title="Create an agent" icon="plus" href="/docs/agents/create">
    Author a bundle before you schedule it.
  </Card>

  <Card title="Environments" icon="code-branch" href="/docs/environments/overview">
    How environments scope schedules and runs.
  </Card>
</Columns>
