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

# Fetcher events

> Reference the job terminal events emitted by Lerian Fetcher — job.completed and job.failed — with payload structure and delivery semantics.

Fetcher's worker emits a terminal event for every extraction job: one **`job.completed`** or one **`job.failed`**, exactly once per job outcome. These notifications are a mandatory product contract — the worker refuses to boot with streaming disabled rather than silently swallowing them.

Events travel in the shared [CloudEvents envelope](/en/reference/events/overview), published over **RabbitMQ**: each event routes to the exchange named by `RABBITMQ_JOB_EVENTS_EXCHANGE` with the event key as the AMQP routing key (`job.completed`, `job.failed`). Both events are **outbox-backed**: the outbox row is written durably and a relay publishes it, retrying through broker outages; a repairer re-emits terminal events that never reached the broker. Delivery is at-least-once — deduplicate on `ce-id`, which is deterministic per job outcome: `fetcher.job.<status>.<jobID>`, so every re-emission of the same fact carries the same id. `ce-subject` is the job id; single-tenant deployments stamp `ce-tenantid` as `single-tenant`.

Unlike most Lerian payloads, Fetcher's job events use **camelCase** keys — they mirror Fetcher's REST surface.

## Job events

| Event (`ce-type`)             | Fires when                               | Key payload                                                                                                                                                                                                         |
| ----------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `studio.lerian.job.completed` | An extraction job finishes successfully. | `jobId`, `status` (`completed`), `metadata` (includes the requesting `source`), `result`? (`path`?, `sizeBytes`?, `rowCount`?, `format`?, `hmac`?, `integrity`?, `protection`?), `executionTimeMs`?, `completedAt`? |
| `studio.lerian.job.failed`    | An extraction job fails.                 | `jobId`, `status` (`failed`), `metadata` (includes the requesting `source` and an `error` object with failure details), `executionTimeMs`?, `completedAt`?                                                          |

The `result` block describes the produced artifact: where it was written, its size and row count, the output format, and — when result protection is enabled — the integrity (HMAC) and protection descriptors a consumer uses to verify the artifact before trusting it.

## Events consumed

Fetcher consumes no platform events. Its inbound job requests arrive on an internal RabbitMQ work queue from embedding products (such as Matcher), which is not part of the public event contract.
