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

# Context schedules

> Automate reconciliation from the Matcher UI by adding cron-based matching schedules to a context, with a live preview of the expression.

Use the **Schedules** tab in a context's setup page to automate reconciliation execution. Each matching schedule defines when the Matcher engine automatically runs matching for the selected context.

<Note>
  Matching schedules set **when automated matching runs** for the reconciliation context. They do not pull any data — to schedule when a source ingests data, open a source and manage its ingestion schedules.
</Note>

## Accessing schedules

***

1. Navigate to **Configure → Contexts** in the left sidebar.
2. Click a context to open its setup page.
3. Select the **Schedules** tab.

<Note>
  The Schedules tab applies to an existing context. For new contexts, save the context first.
</Note>

## Schedule list

***

The list shows every matching schedule configured for the context. Each row displays:

* The cron expression
* An **Enabled** or **Disabled** badge
* **Last run · Next run** timestamps in UTC; the UI shows `–` for **Last run** until a schedule has run and for **Next run** when it is disabled
* Inline edit (pencil) and delete (trash) buttons

## Creating a schedule

***

<Steps>
  <Step>
    In the **Schedules** tab, click the **Add matching schedule** button.
  </Step>

  <Step>
    A dialog titled **Add matching schedule** opens. Enter the schedule in the **Cron expression** field (placeholder `0 2 * * *`, up to 100 characters).

    As you type, a live preview appears below the field: a human-readable phrase such as "Runs: Every day at 02:00" for common shapes, "Valid schedule expression." for valid but uncommon shapes, or an error if the expression is malformed. The preview is a hint and does not prevent submission. It recognizes interval and named-macro syntax such as `@every 15m` even though Matcher matching schedules do not accept it; the server accepts only a standard five-field cron expression and applies its cadence policy when you save.
  </Step>

  <Step>
    The **Enabled** checkbox is selected by default. Leave it selected to create an active schedule, or clear it to create a disabled one. A disabled schedule remains configured, has no next-run time, and is not selected in later worker polls.
  </Step>

  <Step>
    Click **Create matching schedule**.
  </Step>
</Steps>

<Accordion title="How to write a schedule expression">
  Matcher evaluates a **cron expression** in UTC. It uses five space-separated fields: `minute hour day-of-month month day-of-week`.

  | Field        | Range                    |
  | ------------ | ------------------------ |
  | Minute       | `0–59`                   |
  | Hour         | `0–23`                   |
  | Day of month | `1–31`                   |
  | Month        | `1–12`                   |
  | Day of week  | `0–7` (0 and 7 = Sunday) |

  Common special characters:

  * `*` — any value
  * `,` — list of values (e.g., `1,15,30`)
  * `-` — range (e.g., `9-17`)
  * `/` — step (e.g., `*/15` for every 15 units)

  Examples:

  * `0 6 * * *` — every day at 06:00 UTC
  * `*/15 * * * *` — every 15 minutes
  * `0 9 * * 1-5` — at 09:00 UTC on weekdays

  `@every …` syntax and named macros are not supported. When both day-of-month and day-of-week are restricted (not bare `*`), Matcher uses standard cron OR semantics: a match in either field triggers the schedule. The server requires at least five minutes between firings: `*/5 * * * *` is the smallest permitted cadence; for example, `* * * * *` and `*/2 * * * *` are rejected.

  Need to validate an expression? Use [crontab.guru](https://crontab.guru) to preview when it will run.
</Accordion>

## Editing a schedule

***

Click the pencil button on a schedule row. The **Edit matching schedule** dialog opens with the current cron expression and **Enabled** state pre-filled. Update the fields and click **Save changes**. If the schedule is enabled, saving recalculates **Next run** from the current UTC time; disabling it removes that timestamp.

<Note>
  The edit dialog shows only the cron expression and the Enabled checkbox. **Last run** and **Next run** timestamps appear on the list row.
</Note>

## Deleting a schedule

***

Click the trash button on a schedule row. A **Delete matching schedule?** confirmation dialog appears; click **Delete** to remove the schedule permanently.

<Warning>
  Deleting a schedule is irreversible. It stops the schedule from being selected in future worker polls, but it cannot cancel a matching run that a worker has already picked up.
</Warning>
