---
sidebar:
  label: roboto.domain.triggers
  order: 17
title: roboto.domain.triggers
---
Triggers: fire on platform events or a schedule, filter with a condition, dispatch targets.

A trigger pairs a firing source — a subscription to one or more platform events (fired at most once per the subscription's `once_per`) or a cron schedule — with an optional condition over the firing's variable namespace and one or more targets to run on a match.

The event catalog describes what each event type exposes — payload model, namespace roots, supported `once_per` values — and drives both save-time validation and evaluation. Conditions reuse the [`Condition`](/docs/reference/python-sdk/roboto/query#roboto.query.Condition) wire format; target templates reuse the [`roboto.templating`](/docs/reference/python-sdk/roboto/templating) `{{...}}` placeholder syntax.

[`roboto.domain.actions.Trigger`](/docs/reference/python-sdk/roboto/domain/actions#roboto.domain.actions.Trigger) is the legacy model of the same thing (one action, `causes`/`for_each`), deprecated and kept only for existing code; it cannot read a trigger the current model added capabilities to. [`Trigger`](/docs/reference/python-sdk/roboto/domain/triggers#roboto.domain.triggers.Trigger) here reads them all.

## Submodules

- [roboto.domain.triggers.conditions](/docs/reference/python-sdk/roboto/domain/triggers/conditions)
- [roboto.domain.triggers.dispatch](/docs/reference/python-sdk/roboto/domain/triggers/dispatch)
- [roboto.domain.triggers.dry_run](/docs/reference/python-sdk/roboto/domain/triggers/dry_run)
- [roboto.domain.triggers.namespace](/docs/reference/python-sdk/roboto/domain/triggers/namespace)
- [roboto.domain.triggers.operations](/docs/reference/python-sdk/roboto/domain/triggers/operations)
- [roboto.domain.triggers.query_templates](/docs/reference/python-sdk/roboto/domain/triggers/query_templates)
- [roboto.domain.triggers.record](/docs/reference/python-sdk/roboto/domain/triggers/record)
- [roboto.domain.triggers.samples](/docs/reference/python-sdk/roboto/domain/triggers/samples)
- [roboto.domain.triggers.sources](/docs/reference/python-sdk/roboto/domain/triggers/sources)
- [roboto.domain.triggers.targets](/docs/reference/python-sdk/roboto/domain/triggers/targets)
- [roboto.domain.triggers.trigger](/docs/reference/python-sdk/roboto/domain/triggers/trigger)
- [roboto.domain.triggers.validation](/docs/reference/python-sdk/roboto/domain/triggers/validation)

## Package Contents

- [ActionInvocationSpec](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.ActionInvocationSpec) (class): How to run an action: which action, its parameters, overrides, and input selectors.

- [ConditionLeafTrace](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.ConditionLeafTrace) (class): One leaf of the trigger's condition, with the actual value it saw.

- [ConditionMatcher](/reference/python-sdk/roboto/domain/triggers/conditions#roboto.domain.triggers.conditions.ConditionMatcher) (class): Evaluates a trigger condition tree against an event namespace.

- [CreateTriggerRequest](/reference/python-sdk/roboto/domain/triggers/operations#roboto.domain.triggers.operations.CreateTriggerRequest) (class): Request payload to create a trigger.

- [DispatchSlot](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.DispatchSlot) (class): One target of one trigger at one dedup token: the unit a dispatch claims.

- [DispatchSlotTrace](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.DispatchSlotTrace) (class): The state of one target's dispatch slot at the dry run's idempotency token.

- [EventNamespace](/reference/python-sdk/roboto/domain/triggers/namespace#roboto.domain.triggers.namespace.EventNamespace) (class): Resolves dotted variable paths against a platform event.

- [EventSubscription](/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.EventSubscription) (class): Fire when any of the subscribed platform events occurs.

- [InvokeActionTarget](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.InvokeActionTarget) (class): Stored configuration for invoking an action when a trigger fires.

- [MAX_TRIGGER_NAME_LENGTH](/reference/python-sdk/roboto/domain/triggers/operations#roboto.domain.triggers.operations.MAX_TRIGGER_NAME_LENGTH) (data): `MAX_TRIGGER_NAME_LENGTH = 256`. Maximum trigger name length.

- [ManagedBy](/reference/python-sdk/roboto/domain/triggers/record#roboto.domain.triggers.record.ManagedBy) (class): The owner of a trigger whose definition is managed by something other than the org's members.

- [ManagedByKind](/reference/python-sdk/roboto/domain/triggers/record#roboto.domain.triggers.record.ManagedByKind) (class): What kind of thing in Roboto manages a trigger.

- [NamespaceSource](/reference/python-sdk/roboto/domain/triggers/namespace#roboto.domain.triggers.namespace.NamespaceSource) (class): Lazily hydrates entity-backed namespace roots for an event.

- [PlatformEventSample](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.PlatformEventSample) (class): One event type, dereferenced: the envelope, every root it exposes, and the template paths that resolve against them.

- [PlatformEventSamplesResponse](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.PlatformEventSamplesResponse) (class): Wire shape of `GET /v1/triggers/events/samples`: one sample per platform event type.

- [SampleNamespaceSource](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.SampleNamespaceSource) (class): A [`NamespaceSource`](/reference/python-sdk/roboto/domain/triggers/namespace#roboto.domain.triggers.namespace.NamespaceSource) that hydrates every root from the sample scenario.

- [Schedule](/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.Schedule) (class): Fire on a cron schedule, in UTC.

- [SendSlackMessageTarget](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.SendSlackMessageTarget) (class): Stored configuration for posting a Slack message when a trigger fires.

- [StartAgentTarget](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.StartAgentTarget) (class): Stored configuration for starting an agent thread when a trigger fires.

- [TRIGGER_NAME_PATTERN](/reference/python-sdk/roboto/domain/triggers/operations#roboto.domain.triggers.operations.TRIGGER_NAME_PATTERN) (data): `TRIGGER_NAME_PATTERN = '[\\w\\-]+'`. Legal trigger names: word characters and hyphens.

- [TargetAcceptanceTrace](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.TargetAcceptanceTrace) (class): One target's prefilter decision.

- [Trigger](/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger) (class): A trigger: a firing source (event subscriptions or a schedule), an optional condition, and targets.

- [TriggerDispatchRecord](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchRecord) (class): Wire-transmissible representation of one trigger dispatch.

- [TriggerDispatchStatus](/reference/python-sdk/roboto/domain/triggers/dispatch#roboto.domain.triggers.dispatch.TriggerDispatchStatus) (class): Lifecycle state of one dispatch: one attempt to run one target for one matched event.

- [TriggerDryRunGate](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.TriggerDryRunGate) (class): One gate's result in a dry-run trace.

- [TriggerDryRunGateName](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.TriggerDryRunGateName) (class): The gates the evaluator runs, in evaluation order.

- [TriggerDryRunGateStatus](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.TriggerDryRunGateStatus) (class): Outcome of one gate in a dry run.

- [TriggerDryRunRequest](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.TriggerDryRunRequest) (class): Request payload for a trigger dry run.

- [TriggerDryRunResponse](/reference/python-sdk/roboto/domain/triggers/dry_run#roboto.domain.triggers.dry_run.TriggerDryRunResponse) (class): The structured trace a trigger dry run produces.

- [TriggerRecord](/reference/python-sdk/roboto/domain/triggers/record#roboto.domain.triggers.record.TriggerRecord) (class): Wire-transmissible representation of a trigger.

- [TriggerSource](/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.TriggerSource) (data): A trigger's firing source, discriminated on `type`.

- [TriggerSourceType](/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.TriggerSourceType) (class): Discriminator for [`TriggerSource`](/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.TriggerSource).

- [TriggerTargetSpec](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.TriggerTargetSpec) (data): A trigger target spec, discriminated on `type`.

- [TriggerTargetType](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.TriggerTargetType) (class): The kind of thing a trigger does when it fires.

- [TriggerValidator](/reference/python-sdk/roboto/domain/triggers/validation#roboto.domain.triggers.validation.TriggerValidator) (class): Save-time validation for triggers.

- [UpdateTriggerRequest](/reference/python-sdk/roboto/domain/triggers/operations#roboto.domain.triggers.operations.UpdateTriggerRequest) (class): Request payload to update a trigger.

- [iter_query_templates()](/reference/python-sdk/roboto/domain/triggers/query_templates#roboto.domain.triggers.query_templates.iter_query_templates) (function): Yield every RoboQL query in `invocation_input`, in document order.

- [map_query_templates()](/reference/python-sdk/roboto/domain/triggers/query_templates#roboto.domain.triggers.query_templates.map_query_templates) (function): Return `invocation_input` with `transform` applied to every RoboQL query it holds.

- [platform_event_sample()](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.platform_event_sample) (function): Build the sample for one event type.

- [platform_event_samples()](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.platform_event_samples) (function): A sample for every event type in `catalog`, in catalog order.

- [sample_trigger()](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.sample_trigger) (function): The trigger the sample is evaluated for; what `{{trigger.*}}` sees.

- [substitute_query_template()](/reference/python-sdk/roboto/domain/triggers/query_templates#roboto.domain.triggers.query_templates.substitute_query_template) (function): Return `query` with each placeholder replaced by `resolve`'s value for it, escaped in place.

- [target_catalog_manifest()](/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.target_catalog_manifest) (function): The kinds of target a trigger can have, as the web UI's target picker reads them.

- [template_paths()](/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.template_paths) (function): Every dotted path a template may reference under `prefix`, in document order.

### sample_schedule_trigger()

```python
def roboto.domain.triggers.sample_schedule_trigger() -> roboto.domain.triggers.record.TriggerRecord
```

`from roboto.domain.triggers import sample_schedule_trigger`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/samples.py#L230-L233)

The schedule-fired trigger the `schedule.fired` sample is evaluated for, so the sample's `schedule` root carries the `cron` a template may name.

**Returns**

- `roboto.domain.triggers.record.TriggerRecord`
