> ## 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.

# Jobs

> Create and manage scheduled automations

A job is a prompt + trigger + optional delivery config. The daemon executes the prompt through the agent loop on schedule.

## Job Format

Jobs are YAML files in `.fliiq/jobs/`:

```yaml theme={null}
name: daily-email-summary
trigger:
  type: cron
  schedule: "0 9 * * *"        # 9am UTC daily
prompt: "Check my Gmail and summarize important emails from the last 24 hours"
playbook: blog-seo              # Optional: load a domain playbook
skills:
  - receive_emails
  - memory_read
  - memory_write
delivery:
  type: email
  to: me@example.com
enabled: true
```

| Field      | Required | Description                                                                                          |
| ---------- | -------- | ---------------------------------------------------------------------------------------------------- |
| `name`     | Yes      | Unique identifier (lowercase, hyphens)                                                               |
| `trigger`  | Yes      | When to run ([trigger types](/daemon/triggers))                                                      |
| `prompt`   | Yes      | The instruction for the agent                                                                        |
| `playbook` | No       | Load a [domain playbook](/guides/playbooks) into the job's system prompt (e.g. `blog-seo`, `coding`) |
| `skills`   | No       | Restrict which skills the job can use (all if omitted)                                               |
| `delivery` | No       | Where to send results ([delivery config](/daemon/delivery))                                          |
| `enabled`  | No       | Set to `false` to disable without deleting                                                           |

## Creating Jobs

### Via CLI

```bash theme={null}
fliiq job create                    # Interactive wizard
```

### Via the Agent

In a chat session, ask the agent to create a job:

```
"Remind me to exercise every day at 5pm"
```

The agent calls the `create_job` tool, writes the YAML file, and the daemon hot-reloads it.

### Manually

Create a YAML file directly in `.fliiq/jobs/`:

```bash theme={null}
nano .fliiq/jobs/exercise-reminder.yaml
```

The daemon watches for new and changed files.

## Managing Jobs

```bash theme={null}
fliiq job list              # All jobs with status, next run, last run
fliiq job run <name>        # Manual trigger (runs immediately)
fliiq job logs <name>       # Recent run history
fliiq job output <name>     # Full response from last run
fliiq job delete <name>     # Remove job definition
```

## Job Memory

Each job gets its own memory file at `.fliiq/memory/jobs/<name>.md`. The agent reads this at the start of each run and updates it when done.

This enables **progressive context** — a fitness coaching job that tracks workout progression over weeks, or an email digest that remembers which emails it already summarized.

```yaml theme={null}
# The job's system prompt automatically includes:
# "Your job memory is at .fliiq/memory/jobs/<name>.md —
#  read it at the start of each run to see what you processed
#  last time, and update it when done."
```

## Job State

The daemon tracks runtime state in a `_state` block (managed automatically, don't edit manually):

```yaml theme={null}
_state:
  last_run_at: "2026-02-12T09:00:12Z"
  last_status: success          # success | error
  next_run_at: "2026-02-13T09:00:00Z"
  run_count: 14
```

## Run Logs

Each run produces a JSON log in `.fliiq/jobs/<name>/runs/`:

```json theme={null}
{
  "timestamp": "2026-02-12T09:00:12Z",
  "duration_ms": 4523,
  "status": "success",
  "iterations": 6,
  "final_text": "Summarized 3 important emails..."
}
```

Last 50 runs are kept. Older runs are pruned automatically.
