---
sidebar:
  hidden: true
title: roboto.domain.triggers.dispatch
---
## Module Contents

### DispatchSlot

```python
class roboto.domain.triggers.dispatch.DispatchSlot
```

`from roboto.domain.triggers import DispatchSlot`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dispatch.py#L40-L49)

One target of one trigger at one dedup token: the unit a dispatch claims.

At most one dispatch ever occupies a slot. It is the dispatch table's primary key and the vocabulary every dispatch port speaks.

**Attributes**

- **DispatchSlot.idempotency_token** (`str`)
- **DispatchSlot.target_id** (`str`)
- **DispatchSlot.trigger_id** (`str`)

### TriggerDispatchRecord

```python
class roboto.domain.triggers.dispatch.TriggerDispatchRecord(/, **data: Any)
```

`from roboto.domain.triggers import TriggerDispatchRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dispatch.py#L52-L117)

Bases: `pydantic.BaseModel`

Wire-transmissible representation of one trigger dispatch.

A dispatch is one attempt to run one target of one trigger for one matched platform event, deduped at the trigger's [`OncePer`](/reference/python-sdk/roboto/domain/platform_events/once_per#roboto.domain.platform_events.once_per.OncePer). The triple ([`trigger_id`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.trigger_id), [`idempotency_token`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.idempotency_token), [`target_id`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.target_id)) is the [`DispatchSlot`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.DispatchSlot); at most one dispatch ever occupies a slot, which is what makes redelivered events safe.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerDispatchRecord.claimed_at** (`datetime.datetime`): When the slot was (most recently) claimed.
- **TriggerDispatchRecord.dataset_id** (`str | None`) = `None`: The dataset the subject belongs to (the subject itself for a dataset event), which is what a dataset's page lists dispatches by. `None` when the subject has no dataset, such as an invocation.
- **TriggerDispatchRecord.event_id** (`str`): Id of the platform event occurrence that most recently claimed this slot.
- **TriggerDispatchRecord.event_type** (`roboto.domain.platform_events.PlatformEventType`): Type of the platform event that matched.
- **TriggerDispatchRecord.finalized_at** (`datetime.datetime | None`) = `None`: When the dispatch reached a terminal status; `None` while claimed.
- **TriggerDispatchRecord.idempotency_token** (`str`): Dedup token derived from the matched event at the trigger's `once_per` (`{event.type}|{once_per}:{projection}`).
- **TriggerDispatchRecord.org_id** (`str`): Organization that owns the trigger.
- **TriggerDispatchRecord.result_ref** (`str | None`) = `None`: What a dispatched target produced: an invocation id, an agent thread id, or a Slack message timestamp, per [`target_type`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.target_type).
- **TriggerDispatchRecord.status** (`TriggerDispatchStatus`): Where this dispatch is in its lifecycle.
- **TriggerDispatchRecord.status_detail** (`str | None`) = `None`: Human-readable detail for [`status`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.status), e.g. the error a failed target raised.
- **TriggerDispatchRecord.subject** (`str`): The entity the matched platform event was about, as a `roboto://` URI; the same value as the event's own `subject`.
- **TriggerDispatchRecord.target_id** (`str`): Which of the trigger's targets this dispatch ran.
- **TriggerDispatchRecord.target_type** (`roboto.domain.triggers.targets.TriggerTargetType`): Kind of target dispatched.
- **TriggerDispatchRecord.trigger_id** (`str`): Trigger this dispatch belongs to.

**Properties**

- **TriggerDispatchRecord.slot** (`DispatchSlot`): The slot this dispatch occupies.
- **TriggerDispatchRecord.subject_uri** (`roboto.uri.RobotoUri`): [`subject`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.subject) as a parsed [`RobotoUri`](/reference/python-sdk/roboto/uri#roboto.uri.RobotoUri).

### TriggerDispatchStatus

```python
class roboto.domain.triggers.dispatch.TriggerDispatchStatus
```

`from roboto.domain.triggers import TriggerDispatchStatus`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dispatch.py#L19-L36)

Bases: `roboto.compat.StrEnum`

Lifecycle state of one dispatch: one attempt to run one target for one matched event.

**Attributes**

- **TriggerDispatchStatus.Claimed** = `'claimed'`: The dispatch slot is claimed and the target is about to run. A claim that neither finalizes nor is reclaimed within the redelivery grace period is presumed dead and may be claimed again, so delivery is at-least-once: a target may run twice for one event.
- **TriggerDispatchStatus.Dispatched** = `'dispatched'`: The target ran; [`TriggerDispatchRecord.result_ref`](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord.result_ref) points at what it produced.
- **TriggerDispatchStatus.Failed** = `'failed'`: The target raised; a redelivered event may claim the slot again.
- **TriggerDispatchStatus.Unknown** = `'unknown'`: The claim outlived every redelivery of its event without finalizing, so the outcome cannot be determined. Set by an operational sweep, never reclaimable.
