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

### ConditionLeafTrace

```python
class roboto.domain.triggers.dry_run.ConditionLeafTrace(/, **data: Any)
```

`from roboto.domain.triggers import ConditionLeafTrace`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dry_run.py#L65-L88)

Bases: `pydantic.BaseModel`

One comparison in a trigger's condition, with the value the dry run's event supplied for its field.

Carried in `TriggerDryRunGate.condition_leaves`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ConditionLeafTrace.actual** (`Any | None`) = `None`: Value the event supplied for `field`, or `None` if the field did not resolve.

  A field does not resolve when the record it names is missing, the key is absent, or the field names a topic or message path, which no platform event supplies.

- **ConditionLeafTrace.comparator** (`roboto.query.Comparator`): Comparator the comparison applies.

- **ConditionLeafTrace.expected** (`Any | None`) = `None`: Value the comparison tests the field against.

- **ConditionLeafTrace.field** (`str`): Field the comparison reads, as written in the trigger's condition.

- **ConditionLeafTrace.passed** (`bool`): Whether this comparison, taken on its own, held for the event.

### DispatchSlotTrace

```python
class roboto.domain.triggers.dry_run.DispatchSlotTrace(/, **data: Any)
```

`from roboto.domain.triggers import DispatchSlotTrace`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dry_run.py#L111-L136)

Bases: `pydantic.BaseModel`

Dispatch slot of one target that accepts the dry run's event, showing whether the target already ran for it.

A dispatch is one attempt to run one target for one platform event, as recorded by [`TriggerDispatchRecord`](/docs/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord). A trigger runs each target at most once for each value of its `once_per`, such as once per file, so each target has one slot per idempotency token, which at most one dispatch holds.

Carried in `TriggerDryRunGate.dispatches`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DispatchSlotTrace.occupied** (`bool`): Whether a dispatch that has not failed holds the slot, so the trigger would skip the target for this event.

  A failed dispatch leaves the slot free for the trigger to try again.

- **DispatchSlotTrace.result_ref** (`str | None`) = `None`: What the dispatch in the slot produced: an invocation ID, an agent thread ID, or a Slack message timestamp. `None` if the slot is empty or the dispatch produced nothing.

- **DispatchSlotTrace.status** (`roboto.domain.triggers.dispatch.TriggerDispatchStatus | None`) = `None`: Status of the dispatch in the slot, or `None` if the slot is empty.

- **DispatchSlotTrace.target_id** (`str`): ID of the target within the trigger.

### TargetAcceptanceTrace

```python
class roboto.domain.triggers.dry_run.TargetAcceptanceTrace(/, **data: Any)
```

`from roboto.domain.triggers import TargetAcceptanceTrace`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dry_run.py#L91-L108)

Bases: `pydantic.BaseModel`

One target's decision on whether to accept the dry run's event.

Carried in `TriggerDryRunGate.targets`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TargetAcceptanceTrace.accepted** (`bool`): Whether the target accepts the event. A target that raised an error while Roboto checked it does not.
- **TargetAcceptanceTrace.reason** (`str | None`) = `None`: Why the target declined, such as which required-input pattern no file matched, or the error it raised. `None` when the target accepted, or when Roboto cannot say more than that it declined.
- **TargetAcceptanceTrace.target_id** (`str`): ID of the target within the trigger.
- **TargetAcceptanceTrace.target_type** (`roboto.domain.triggers.targets.TriggerTargetType`): invoking an action, starting an agent, or sending a Slack message.

### TriggerDryRunGate

```python
class roboto.domain.triggers.dry_run.TriggerDryRunGate(/, **data: Any)
```

`from roboto.domain.triggers import TriggerDryRunGate`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dry_run.py#L139-L171)

Bases: `pydantic.BaseModel`

Result of one gate in a trigger dry run.

Each list and token field belongs to one gate of `TriggerDryRunGateName`: `condition_leaves` to `Condition`, `targets` to `TargetPrefilter`, and `idempotency_token` and `dispatches` to `AlreadyFired`. They are `None` on every other gate, and on a gate Roboto did not evaluate.

Carried in `TriggerDryRunResponse.gates`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerDryRunGate.condition_leaves** (`list[ConditionLeafTrace] | None`) = `None`: Result of each comparison in the trigger's condition. Empty when the trigger has no condition.

- **TriggerDryRunGate.detail** (`str | None`) = `None`: Plain-English explanation of the outcome, such as which condition field did not match.

- **TriggerDryRunGate.dispatches** (`list[DispatchSlotTrace] | None`) = `None`: Slot of each target that accepts the event, at `idempotency_token`.

- **TriggerDryRunGate.gate** (`TriggerDryRunGateName`): Gate this result is for.

- **TriggerDryRunGate.idempotency_token** (`str | None`) = `None`: Token that names the event's file, dataset, or occurrence at the trigger's `once_per`.

  Events with the same token share one run of each target.

- **TriggerDryRunGate.status** (`TriggerDryRunGateStatus`): Whether the gate passed, failed, or was not evaluated because an earlier gate failed.

- **TriggerDryRunGate.targets** (`list[TargetAcceptanceTrace] | None`) = `None`: Each target's decision on whether to accept the event.

### TriggerDryRunGateName

```python
class roboto.domain.triggers.dry_run.TriggerDryRunGateName
```

`from roboto.domain.triggers import TriggerDryRunGateName`

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

Bases: `roboto.compat.StrEnum`

Gate a trigger dry-run result is for: a check a trigger must pass to run its targets for a platform event.

The members are listed in the order Roboto checks the gates.

**Attributes**

- **TriggerDryRunGateName.AlreadyFired** = `'already_fired'`: Whether at least one target that accepts the event has not yet run for it at the trigger's `once_per`. Fails when every accepting target already has.

- **TriggerDryRunGateName.Condition** = `'condition'`: Whether the trigger's condition holds for the event. Passes when the trigger has no condition.

- **TriggerDryRunGateName.Enabled** = `'enabled'`: Whether the trigger is enabled.

- **TriggerDryRunGateName.Subscribed** = `'subscribed'`: Whether the trigger fires for the event's type.

  The type must be one of the trigger's subscribed platform events, or [`ScheduleFired`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.ScheduleFired) for a schedule-fired trigger.

- **TriggerDryRunGateName.TargetPrefilter** = `'target_prefilter'`: Whether at least one of the trigger's targets accepts the event.

  For example, an action target accepts the event when its required-input patterns match a file.

### TriggerDryRunGateStatus

```python
class roboto.domain.triggers.dry_run.TriggerDryRunGateStatus
```

`from roboto.domain.triggers import TriggerDryRunGateStatus`

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

Bases: `roboto.compat.StrEnum`

Outcome of one gate in a trigger dry run.

**Attributes**

- **TriggerDryRunGateStatus.Failed** = `'failed'`: The trigger does not meet this gate, so Roboto checks no later gate.
- **TriggerDryRunGateStatus.NotEvaluated** = `'not_evaluated'`: An earlier gate failed, so Roboto did not check this one.
- **TriggerDryRunGateStatus.Passed** = `'passed'`: The trigger meets this gate.

### TriggerDryRunRequest

```python
class roboto.domain.triggers.dry_run.TriggerDryRunRequest(/, **data: Any)
```

`from roboto.domain.triggers import TriggerDryRunRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dry_run.py#L174-L241)

Bases: `pydantic.BaseModel`

Request body for [`dry_run()`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger.dry_run).

Set `event` to evaluate a complete platform event, or at most one reference for Roboto to synthesize a platform event from: `dataset_id`, `file_id`, `invocation_id` or `event_id` for a trigger that fires on platform events, or `scheduled_for` for a schedule-fired trigger. A schedule-fired trigger needs no reference; Roboto then synthesizes its next scheduled occurrence. Building a request that sets `event` together with a reference or `event_type`, or sets more than one reference, raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerDryRunRequest.dataset_id** (`str | None`) = `None`: ID of a dataset to synthesize a platform event about.

- **TriggerDryRunRequest.event** (`roboto.domain.platform_events.PlatformEvent | None`) = `None`: Platform event to evaluate as given.

  It must belong to the trigger's organization, as must every resource it names.

- **TriggerDryRunRequest.event_id** (`str | None`) = `None`: ID of an event to synthesize a platform event about.

  Roboto synthesizes [`EventCreated`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.EventCreated) for an event on a dataset (`ev_`), or [`SessionEventCreated`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.SessionEventCreated) for an event on a session (`evt_`).

- **TriggerDryRunRequest.event_type** (`roboto.domain.platform_events.PlatformEventType | None`) = `None`: Type of platform event to synthesize from a reference; it must be one the reference can produce. `None` uses the first of the trigger's subscribed event types that the reference can produce.

- **TriggerDryRunRequest.file_id** (`str | None`) = `None`: ID of a file to synthesize a platform event about.

- **TriggerDryRunRequest.invocation_id** (`str | None`) = `None`: ID of an invocation to synthesize a platform event about.

- **TriggerDryRunRequest.scheduled_for** (`datetime.datetime | None`) = `None`: Time of the occurrence to synthesize for a schedule-fired trigger, with seconds and smaller units dropped. `None` synthesizes the schedule's next occurrence.

### TriggerDryRunResponse

```python
class roboto.domain.triggers.dry_run.TriggerDryRunResponse(/, **data: Any)
```

`from roboto.domain.triggers import TriggerDryRunResponse`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/dry_run.py#L244-L266)

Bases: `pydantic.BaseModel`

Response body of [`dry_run()`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger.dry_run).

A dry run reports whether a trigger would run its targets for a platform event, and if not, why. It checks the trigger's gates against the event and the organization's current data, in the order Roboto checks them when the trigger fires, and runs no target. The first failed gate is why the trigger would not fire; every gate after it is `TriggerDryRunGateStatus.NotEvaluated`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerDryRunResponse.event_type** (`roboto.domain.platform_events.PlatformEventType`): Type of the platform event evaluated, whether the request gave it or Roboto synthesized it.
- **TriggerDryRunResponse.gates** (`list[TriggerDryRunGate]`): Result of every gate, in the order Roboto checks them.
- **TriggerDryRunResponse.trigger_id** (`str`): ID of the trigger that was dry-run.
- **TriggerDryRunResponse.verdict** (`str`): One plain-English sentence summarizing the outcome, quoting the first failed gate's `detail` if any failed.
- **TriggerDryRunResponse.would_fire** (`bool`): Whether the trigger would run at least one target for the event: true when every gate passed.
