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

# Triggers

> Cron, interval, one-shot, and webhook triggers

Triggers define when a job runs. Four types are supported.

## Cron

Recurring schedule using cron expressions:

```yaml theme={null}
trigger:
  type: cron
  schedule: "0 9 * * *"        # Daily at 9am UTC
```

```yaml theme={null}
trigger:
  type: cron
  schedule: "0 9 * * 1-5"     # Weekdays at 9am UTC
```

```yaml theme={null}
trigger:
  type: cron
  schedule: "*/30 * * * *"    # Every 30 minutes
```

Standard 5-field cron format: `minute hour day-of-month month day-of-week`.

**Catch-up:** If the daemon was suspended (e.g., laptop sleep) and a cron window was missed, the job fires once on resume. Only one catch-up run per job — no queue of missed executions.

## Interval

Repeating at a fixed interval:

```yaml theme={null}
trigger:
  type: every
  seconds: 3600                # Every hour
```

```yaml theme={null}
trigger:
  type: every
  minutes: 30                  # Every 30 minutes
```

The interval starts from when the daemon starts, not from a specific time.

## One-Shot

Fire once at a specific datetime, then disable:

```yaml theme={null}
trigger:
  type: at
  datetime: "2026-02-15T14:00:00Z"    # UTC
```

After firing, the job's `_state.last_status` is updated and it won't run again.

## Webhook

Fire when the daemon receives an HTTP POST:

```yaml theme={null}
trigger:
  type: webhook
  source: github
  match:
    action: opened
    pull_request.base.ref: main
```

The daemon exposes webhook endpoints:

```bash theme={null}
# Source-based (matches jobs by trigger.source + trigger.match)
POST http://localhost:7890/webhooks/github

# Direct (fires a specific job, no matching needed)
POST http://localhost:7890/webhooks/custom/<job-name>
```

### Payload Templating

Use `{{field}}` in the job prompt to inject webhook payload values:

```yaml theme={null}
prompt: "Review the PR '{{pull_request.title}}' by {{pull_request.user.login}}"
```

Nested fields are supported: `{{pull_request.base.ref}}`.
