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 wire format; target templates reuse the roboto.templating {{...}} placeholder syntax.
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 here reads them all.
Submodules
- roboto.domain.triggers.conditions
- roboto.domain.triggers.dispatch
- roboto.domain.triggers.dry_run
- roboto.domain.triggers.namespace
- roboto.domain.triggers.operations
- roboto.domain.triggers.query_templates
- roboto.domain.triggers.record
- roboto.domain.triggers.samples
- roboto.domain.triggers.sources
- roboto.domain.triggers.targets
- roboto.domain.triggers.trigger
- roboto.domain.triggers.validation
Package Contents
ActionInvocationSpec
Bases: pydantic.BaseModel
How to run an action: which action, its parameters, overrides, and input selectors.
The part of an invoke-action target that says nothing about when it runs, shared by InvokeActionTarget and anything else that stores an action invocation to run later, such as an ingestion rule. String leaves of parameter_values and invocation_input may contain {{...}} placeholders resolved against the event namespace at dispatch time.
Parameters
data AnyAttributes
ActionInvocationSpec.action
The action to invoke. owner defaults to the trigger’s org when omitted and digest to the action’s latest version.
ActionInvocationSpec.compute_requirement_overrides
compute_requirement_overrides roboto.Optional compute requirement overrides for the invocation.
ActionInvocationSpec.container_parameter_overrides
container_parameter_overrides roboto.Optional container parameter overrides for the invocation.
ActionInvocationSpec.invocation_input
Optional query-based input selection (files, topics, sessions) resolved when the invocation runs, e.g. InvocationInput.file_query('tags CONTAINS "{{event.name}}"'). The way a trigger on an event that names no dataset selects its inputs; may also accompany the file patterns of an event that names one.
ActionInvocationSpec.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
ActionInvocationSpec.parameter_values
Parameter values passed to the action; string leaves may be templated.
ActionInvocationSpec.referenced_placeholders()
Return every {{name}} placeholder referenced by this spec’s templated fields.
Return type
Attributes
ActionInvocationSpec.timeout
Optional invocation timeout override, in minutes.
ActionInvocationSpec.upload_destination
upload_destination roboto.Optional destination for the invocation’s output files.
ConditionLeafTrace
Bases: pydantic.BaseModel
One leaf of the trigger’s condition, with the actual value it saw.
Parameters
data AnyAttributes
ConditionLeafTrace.actual
The value the event’s namespace resolved for field; None when the field did not resolve (missing entity, missing key).
ConditionMatcher
Evaluates a trigger condition tree against an event namespace.
Reuses the query Condition comparators unchanged; only the value source differs. Each leaf routes to the namespace root its field targets and matches against that root’s record, so roots hydrate lazily on first reference. A root whose record is missing evaluates to a non-match, so NOT_EXISTS and IS_NULL never match against an entity that was deleted before evaluation.
Parameters
default_root strConditionMatcher.matches()
Return whether condition holds for the event. A None condition always matches.
Parameters
condition Optional[roboto.Return type
CreateTriggerRequest
Bases: pydantic.BaseModel
Request payload to create a trigger.
The server assigns identity and audit fields, and runs TriggerValidator over the cross-field rules (exposed roots, once_per legality, target placeholders) before persisting.
Triggered work runs as the organization’s actions service user; a trigger cannot run its targets as anyone else.
Parameters
data AnyAttributes
CreateTriggerRequest.condition
Optional predicate over the firing’s namespace.
CreateTriggerRequest.enabled
Whether the trigger should be active immediately after creation.
CreateTriggerRequest.fires_on
What makes the trigger fire: an event subscription or a schedule.
CreateTriggerRequest.targets
What the trigger dispatches when it fires. At least one.
DispatchSlot
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.
DispatchSlotTrace
Bases: pydantic.BaseModel
The state of one target’s dispatch slot at the dry run’s idempotency token.
Parameters
data AnyAttributes
DispatchSlotTrace.occupied
Whether a dispatch row occupies the slot (the trigger already fired here).
DispatchSlotTrace.result_ref
What the occupying dispatch produced (invocation id, thread id, Slack ts).
DispatchSlotTrace.status
The occupying dispatch’s status, when one exists.
EventNamespace
Resolves dotted variable paths against a platform event.
The one namespace with three consumers: condition evaluation (whole records via record()), target template substitution (single paths via resolve(), satisfying the VariableResolver protocol), and idempotency projections. Entity-backed roots hydrate through the NamespaceSource at most once each and are cached for the namespace’s lifetime — including None results. The envelope, changed, tag and schedule roots are served from the event itself and never touch the source; trigger is served from the bound trigger (see bound_to()) and is otherwise absent.
envelope carries the event’s own fields plus the payload under envelope.data. The payload is fixed when the event is published, while an entity root reads that entity as it stands at evaluation time: on a file.uploaded event, envelope.data.file_version is the version that fired the trigger and file.version is the version the file is on when the condition runs. That payload field is optional on file.uploaded, file.ingested and file.metadata_updated, and resolves to None on events published before the payload carried it.
Payload values are rendered as JSON, so a timestamp under envelope.data is an ISO-8601 string while envelope.time and schedule.scheduled_for are datetime objects. Conditions compare the two forms alike; a template substitutes each in its own spelling (2026-08-27T09:00:00Z against 2026-08-27 09:00:00+00:00).
Parameters
source NamespaceSourcetrigger Optional[roboto._records Optional[dict[str, Optional[Mapping[str, Any]]]]EventNamespace.bound_to()
A view of this namespace for one trigger, in which trigger.* resolves.
One namespace is shared across every trigger evaluated for an event so each entity hydrates once; the trigger being evaluated is per-trigger state, so it lives on a view rather than on the shared object. The view delegates every other root to the same hydration cache – reading dataset.name through it and through the parent costs one fetch in total.
Parameters
The trigger whose templates and condition are being evaluated.
Return type
EventNamespace.get()
Return the value at dotted path (e.g. dataset.metadata.vehicle_id), or None.
The first path segment names the root; the rest walk nested mappings. Any missing segment yields None.
Parameters
path strReturn type
EventNamespace.record()
Return the whole record for namespace root, hydrating it at most once.
Parameters
root strNamespace root to fetch. envelope yields the event’s own fields, with the payload fixed at publish time under data; changed yields the changeset’s put fields; tag yields {"added": [...], "removed": [...]}; schedule and trigger yield the firing schedule and the bound trigger; any other root delegates to the cached NamespaceSource.
Returns
The record as a mapping, or None when the source cannot resolve the root.
EventNamespace.resolve()
Return the string form of the value at name for template substitution, or None.
Parameters
name strReturn type
EventSubscription
Bases: _SourceBase
Fire when any of the subscribed platform events occurs.
Carries once_per because it only means something here: it names what the event is about that the trigger fires at most once for, and a schedule has no such subject.
Parameters
data AnyAttributes
EventSubscription.events
Event types the trigger subscribes to. At least one; a condition may only reference namespace roots exposed by every subscribed event.
EventSubscription.fires_for()
Return whether an event of event_type is one this subscription fires for.
Parameters
Return type
Attributes
EventSubscription.once_per
What the trigger fires at most once per: the occurrence, or an entity the event names. Must be legal for every subscribed event type.
InvokeActionTarget
Bases: ActionInvocationSpec, _TargetSpecBase
Stored configuration for invoking an action when a trigger fires.
Spec only — dispatch behavior lives server-side. The ActionInvocationSpec fields say how to run the action; this class adds the target’s identity and its file patterns. String leaves of required_inputs and additional_inputs may contain {{...}} placeholders, as the spec’s may.
An event that names a dataset invokes the action against that dataset, with inputs matched from its files by the file patterns. An event that names no dataset has no files to match: the invocation has no data source and selects its inputs with invocation_input.
Parameters
data AnyAttributes
InvokeActionTarget.additional_inputs
Optional extra file patterns passed as invocation inputs beyond the required ones. Only for events that name a dataset; must be empty otherwise.
InvokeActionTarget.from_invocation()
A target that runs invocation, with the given identity and file patterns.
Parameters
invocation ActionInvocationSpectarget_id strrequired_inputs Optional[list[str]]additional_inputs Optional[list[str]]Return type
InvokeActionTarget.invocation()
How this target runs its action, without its identity or file patterns.
Return type
Attributes
InvokeActionTarget.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
InvokeActionTarget.referenced_placeholders()
Return every {{name}} placeholder referenced by this target’s templated fields.
Return type
Attributes
InvokeActionTarget.required_inputs
File patterns (e.g. **/*.bag) that gate dispatch on the firing event’s files. Only for events that name a dataset; must be empty otherwise.
InvokeActionTarget.target_id
Stable id of this target within its trigger. Part of the dispatch idempotency key: the target’s once-per history is kept under this id, so renaming it (or replacing it with an identical target under a new id) starts a fresh history and the target fires again for subjects the old id already fired for.
MAX_TRIGGER_NAME_LENGTH
Maximum trigger name length.
ManagedBy
Bases: pydantic.BaseModel
The owner of a trigger whose definition is managed by something other than the org’s members.
No managed trigger can be deleted, or have its definition changed, through the triggers API. Org members may enable or disable a system-managed trigger. A trigger owned by an ingestion rule may not be enabled, disabled, edited or deleted directly: change the rule instead, e.g. turn its auto-ingest off. An org has at most one trigger per owner.
Parameters
data AnyAttributes
ManagedBy.id
Which one: for ManagedByKind.System, the platform feature’s key (e.g. "session_metrics"); for ManagedByKind.IngestionRule, the rule’s id.
ManagedBy.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
ManagedByKind
Bases: roboto.compat.StrEnum
What kind of thing in Roboto manages a trigger.
NamespaceSource
Bases: Protocol
Lazily hydrates entity-backed namespace roots for an event.
NamespaceSource.record_for_root()
Load the entity for namespace root as a JSON-able mapping.
Parameters
root strThe namespace root to hydrate ("dataset", "file", "invocation", "event", …). Never a delta or reserved root: the namespace serves envelope, trigger, schedule, changed and tag itself.
The event whose subject identifies the entity to load.
Returns
The entity as a mapping, or None when event cannot resolve it (no such root for this event type, or the entity was deleted between emit and evaluation).
PlatformEventSample
Bases: pydantic.BaseModel
One event type, dereferenced: the envelope, every root it exposes, and the template paths that resolve against them.
Parameters
data AnyAttributes
PlatformEventSample.event
The event envelope as it would arrive: id, type, time, org, and payload.
PlatformEventSample.event_type
The event type this sample illustrates.
PlatformEventSample.namespace
Every namespace root a condition or template may reference for this event type, keyed by root name, with the full record under each. Always includes envelope and trigger; the rest are the catalog’s exposed roots for the type.
PlatformEventSamplesResponse
Bases: pydantic.BaseModel
Wire shape of GET /v1/triggers/events/samples: one sample per platform event type.
Parameters
data AnyAttributes
PlatformEventSamplesResponse.samples
SampleNamespaceSource
A NamespaceSource that hydrates every root from the sample scenario.
Serves each root the way a real firing does — including action as the invocation’s provenance and upload as the bare transaction id — so a sample carries exactly the roots a trigger would see.
SampleNamespaceSource.record_for_root()
Parameters
root strReturn type
Schedule
Bases: _SourceBase
Fire on a cron schedule, in UTC.
Each scheduled minute fires the trigger once (once_per='occurrence' over the schedule tick). A missed minute is skipped rather than replayed later, so a delayed schedule never floods targets with backdated firings. Cron expressions are evaluated in UTC; a schedule cannot name a time zone.
Parameters
data AnyAttributes
Schedule.cron
A five-field cron expression (minute hour day-of-month month day-of-week), evaluated in UTC — e.g. 0 9 * * 1 for 09:00 UTC every Monday.
Schedule.fires_for()
Return whether event_type is the schedule occurrence this source fires for.
Parameters
Return type
Properties
Schedule.once_per
A schedule always fires once per scheduled minute.
Attributes
SendSlackMessageTarget
Bases: _TargetSpecBase
Stored configuration for posting a Slack message when a trigger fires.
Spec only — dispatch behavior lives server-side. The channel must be on the org’s Slack outbound allowlist at dispatch time.
Parameters
data AnySendSlackMessageTarget.referenced_placeholders()
Return every {{name}} placeholder referenced by this target’s templated text.
Return type
Attributes
SendSlackMessageTarget.target_id
Stable id of this target within its trigger; part of the dispatch idempotency key.
SendSlackMessageTarget.text
Message body; may contain {{...}} placeholders resolved against the event namespace.
StartAgentTarget
Bases: _TargetSpecBase
Stored configuration for starting an agent thread when a trigger fires.
Spec only — dispatch behavior lives server-side. Each value in values is a template resolved against the event namespace, then handed to the agent’s own variable resolution as a plain value.
Parameters
data AnyAttributes
StartAgentTarget.analysis_scope
Optional analysis scope for the resulting thread.
StartAgentTarget.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
StartAgentTarget.referenced_placeholders()
Return every {{name}} placeholder referenced by this target’s templated values.
Return type
Attributes
StartAgentTarget.target_id
Stable id of this target within its trigger; part of the dispatch idempotency key.
StartAgentTarget.values
Agent variable name to a template string resolved against the event namespace.
StartAgentTarget.visibility
Visibility of the resulting agent thread.
TRIGGER_NAME_PATTERN
Legal trigger names: word characters and hyphens.
TargetAcceptanceTrace
Bases: pydantic.BaseModel
One target’s prefilter decision.
Parameters
data AnyAttributes
TargetAcceptanceTrace.reason
Why the target declined, where determinable (e.g. which required-input pattern had no matching file). None when accepted or when no finer reason is known.
TargetAcceptanceTrace.target_type
Kind of target.
Trigger
A trigger: a firing source (event subscriptions or a schedule), an optional condition, and targets.
Triggers created through the older causes/for_each API (roboto.domain.actions.Trigger) are listed and loaded here too, projected onto this shape and marked engine == "v1"; they accept a narrower set of edits (see update()).
Usage
Start an agent whenever a dataset gains a ready tag:
from roboto.domain.platform_events import OncePer, PlatformEventType
from roboto.domain.triggers import StartAgentTarget, Trigger
trigger = Trigger.create(
name="analyze-ready-datasets",
targets=[StartAgentTarget(target_id="analyze", agent_id="ag_abc123")],
events=[PlatformEventType.DatasetTagAdded],
once_per=OncePer.Occurrence,
)Post to Slack every Monday at 09:00 UTC:
from roboto.domain.triggers import SendSlackMessageTarget
weekly = Trigger.create(
name="weekly-status",
targets=[SendSlackMessageTarget(target_id="post", channel_id="C0123", text="Weekly check-in")],
schedule="0 9 * * 1",
)Parameters
roboto_client Optional[roboto.Properties
Trigger.condition
Trigger.create()
Create a trigger in the caller’s org.
Parameters
name strTrigger name, unique within the org.
What to dispatch on a match. At least one.
events Optional[list[roboto.Platform event types to subscribe to (with once_per). At least one.
once_per Optional[roboto.What the trigger fires at most once per; must be legal for every subscribed event.
schedule Optional[str]A cron expression (UTC) to fire on instead of events.
fires_on Optional[roboto.The firing source itself, as an alternative to the events/once_per or schedule shorthands.
condition Optional[roboto.Optional predicate over the firing’s namespace.
enabled boolWhether the trigger is active immediately.
caller_org_id Optional[str]Org to create the trigger in. Defaults to the caller’s org.
roboto_client Optional[roboto.Roboto client instance. Uses the default if not provided.
Returns
The created trigger.
Raises
A cross-field validation rule fails (e.g. the condition references a root not exposed by every subscribed event).
The name is already taken in the org.
Trigger.delete()
Delete this trigger. Idempotent.
Return type
Trigger.disable()
Trigger.dispatches()
Yield this trigger’s dispatch history, newest first.
A dispatch is one attempt to run one target for one matched event; only matches are recorded, so an empty history means the trigger never fired.
Parameters
limit intPage size for the underlying requests.
Return type
Trigger.dry_run()
Ask “would this trigger fire?” without dispatching anything.
Provide either a full event or exactly one entity reference, from which the server synthesizes an event (event_type optionally picks which kind). A schedule-fired trigger takes no reference: pass scheduled_for to pick the minute, or nothing for the schedule’s next occurrence. The response is the evaluator’s gate-by-gate trace: subscribed, enabled, condition (with per-leaf actual values), target prefilter, already fired.
Usage
trace = trigger.dry_run(dataset_id="ds_abc123")
print(trace.verdict)Parameters
event Optional[roboto.dataset_id Optional[str]file_id Optional[str]invocation_id Optional[str]event_id Optional[str]event_type Optional[roboto.scheduled_for Optional[datetime.Trigger.enable()
Properties
Trigger.engine
Which trigger shape this trigger was created in: "v2", or "v1" for a trigger created through the older causes/for_each API.
Trigger.events
The subscribed event types, or None for a schedule-fired trigger.
Trigger.fires_on
What makes the trigger fire: an event subscription or a schedule.
Trigger.from_id()
Load the trigger with the given id, whichever API created it.
Parameters
trigger_id strroboto_client Optional[roboto.Return type
Trigger.from_name()
Load the trigger with the given name, whichever API created it. Names are unique within an org.
Parameters
Return type
Trigger.list()
Yield every trigger in the org, event-fired and scheduled, newest first, whichever API created it.
Parameters
owner_org_id Optional[str]roboto_client Optional[roboto.Return type
Properties
Trigger.once_per
What the trigger fires at most once per; always occurrence (one firing per minute) for a schedule.
Trigger.platform_event_samples()
Fetch a realistic sample of every event type, dereferenced.
Each sample carries the event envelope, every namespace root the type exposes with a full record under it, and the root.path list a condition field or {{ }} placeholder may name. Use it to see what a template will resolve to before writing one.
Usage
samples = Trigger.platform_event_samples()
samples[PlatformEventType.FileUploaded].paths[:3]
# ['envelope.id', 'envelope.type', 'envelope.time']Parameters
roboto_client Optional[roboto.Properties
Trigger.record
Trigger.schedule
The cron expression (UTC) the trigger fires on, or None for an event-fired trigger.
Trigger.set_enabled()
Enable or disable this trigger.
Parameters
enabled boolReturn type
Properties
Trigger.targets
Trigger.to_dict()
Return this trigger’s record as a JSON-able dict.
Return type
Properties
Trigger.update()
Apply a partial update to this trigger and refresh this instance.
Only provided fields change; condition=None clears the condition. The firing source is replaced whole: pass fires_on, or the events / once_per / schedule shorthands, which are merged over the current source before being sent. A trigger with engine == "v1" accepts only edits its older shape can express — a single invoke-action target, event types that map onto it, once_per of file or dataset — and rejects the rest with a message naming what it cannot store.
Parameters
fires_on Union[roboto.events Union[List[roboto.once_per Union[roboto.schedule Union[str, roboto.condition Optional[Union[roboto.targets Union[List[roboto.enabled Union[bool, roboto.Return type
TriggerDispatchRecord
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. The triple (trigger_id, idempotency_token, target_id) is the DispatchSlot; at most one dispatch ever occupies a slot, which is what makes redelivered events safe.
Parameters
data AnyAttributes
TriggerDispatchRecord.claimed_at
When the slot was (most recently) claimed.
TriggerDispatchRecord.dataset_id
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
Id of the platform event occurrence that most recently claimed this slot.
TriggerDispatchRecord.event_type
Type of the platform event that matched.
TriggerDispatchRecord.finalized_at
When the dispatch reached a terminal status; None while claimed.
TriggerDispatchRecord.idempotency_token
Dedup token derived from the matched event at the trigger’s once_per ({event.type}|{once_per}:{projection}).
TriggerDispatchRecord.result_ref
What a dispatched target produced: an invocation id, an agent thread id, or a Slack message timestamp, per target_type.
Properties
TriggerDispatchRecord.slot
The slot this dispatch occupies.
Attributes
TriggerDispatchRecord.status_detail
Human-readable detail for status, e.g. the error a failed target raised.
TriggerDispatchRecord.subject
The entity the matched platform event was about, as a roboto:// URI; the same value as the event’s own subject.
Properties
TriggerDispatchRecord.subject_uri
subject as a parsed RobotoUri.
Attributes
TriggerDispatchRecord.target_type
Kind of target dispatched.
TriggerDispatchStatus
Bases: roboto.compat.StrEnum
Lifecycle state of one dispatch: one attempt to run one target for one matched event.
Attributes
TriggerDispatchStatus.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
The target ran; TriggerDispatchRecord.result_ref points at what it produced.
TriggerDispatchStatus.Failed
The target raised; a redelivered event may claim the slot again.
TriggerDispatchStatus.Unknown
The claim outlived every redelivery of its event without finalizing, so the outcome cannot be determined. Set by an operational sweep, never reclaimable.
TriggerDryRunGate
Bases: pydantic.BaseModel
One gate’s result in a dry-run trace.
condition_leaves is populated only on the condition gate, targets only on target_prefilter, and idempotency_token/dispatches only on already_fired.
Parameters
data AnyAttributes
TriggerDryRunGate.condition_leaves
Per-leaf results with actual values (condition gate only).
TriggerDryRunGate.dispatches
Per-target dispatch-slot state at the token (already_fired gate only).
TriggerDryRunGate.idempotency_token
The dedup token the event projects onto (already_fired gate only).
TriggerDryRunGate.status
Whether the gate passed, failed, or was short-circuited.
TriggerDryRunGate.targets
Per-target prefilter decisions (target_prefilter gate only).
TriggerDryRunGateName
Bases: roboto.compat.StrEnum
The gates the evaluator runs, in evaluation order.
Attributes
TriggerDryRunGateName.AlreadyFired
Is a dispatch slot still claimable at the trigger’s once_per?
TriggerDryRunGateName.Condition
Does the trigger’s condition hold for the event?
TriggerDryRunGateName.Subscribed
Is the trigger subscribed to the event’s type?
TriggerDryRunGateName.TargetPrefilter
Does at least one target accept the event (pathspec and precondition gates)?
TriggerDryRunGateStatus
TriggerDryRunRequest
Bases: pydantic.BaseModel
Request payload for a trigger dry run.
Provide event (a fully-formed platform event to evaluate) or a single reference (dataset_id, file_id, invocation_id, event_id, or scheduled_for), from which the server synthesizes an event. With an entity reference, event_type optionally picks which of the trigger’s subscribed event types to synthesize; the default is the trigger’s first subscribed event type compatible with the reference. A schedule-fired trigger needs no reference: the server synthesizes its next scheduled minute.
Parameters
data AnyAttributes
TriggerDryRunRequest.dataset_id
Synthesize an event about this dataset.
TriggerDryRunRequest.event
A platform event to evaluate as-is.
TriggerDryRunRequest.event_id
Synthesize a platform event about this event (the annotation on your data).
TriggerDryRunRequest.event_type
Which subscribed event type to synthesize for an entity reference.
TriggerDryRunRequest.invocation_id
Synthesize an event about this invocation.
TriggerDryRunRequest.scheduled_for
For a schedule-fired trigger: synthesize the occurrence for this scheduled minute (UTC). With no reference at all, a schedule-fired trigger is dry-run for its next scheduled minute.
TriggerDryRunResponse
Bases: pydantic.BaseModel
The structured trace a trigger dry run produces.
Gates appear in evaluation order. The first failed gate is why the trigger would not fire; every gate after it is not_evaluated.
Parameters
data AnyAttributes
TriggerDryRunResponse.event_type
Type of the (given or synthesized) event that was evaluated.
TriggerDryRunResponse.gates
The gate-by-gate trace, in evaluation order.
TriggerDryRunResponse.would_fire
Whether the trigger would dispatch at least one target for this event.
TriggerRecord
Bases: pydantic.BaseModel
Wire-transmissible representation of a trigger.
A firing source (a platform event subscription or a schedule), an optional condition over the firing’s namespace, and the targets to dispatch on a match. Cross-field rules — exposed roots, once_per legality, template placeholders — are enforced when the trigger is saved, by TriggerValidator.
Triggered work runs as the organization’s actions service user; a trigger cannot run its targets as anyone else.
Parameters
data AnyAttributes
TriggerRecord.condition
Optional predicate over the firing’s namespace; the trigger fires only when it holds. Same Condition wire format the query system uses.
TriggerRecord.engine
Which engine evaluates this trigger: "v2" for the events/once_per/targets engine this module models (every trigger, once a deployment has cut over), "v1" for a trigger the older causes/for_each engine still evaluates, projected onto this shape. Server-assigned and read-only; no request model carries it. Defaults to "v1" for a response that omits it, which is what a Roboto deployment older than the field sends.
TriggerRecord.fires_on
What makes the trigger fire: an EventSubscription (which also carries once_per) or a Schedule.
TriggerRecord.managed_by
The owner of the trigger’s definition when it is not the org’s members, e.g. the ingestion rule the trigger ingests files for; None for a trigger a user created. Server-assigned and read-only; no request model carries it.
TriggerRecord.targets
What the trigger dispatches when it fires, in order. At least one; each target_id is unique within the trigger.
TriggerSource
A trigger’s firing source, discriminated on type.
TriggerSourceType
Bases: roboto.compat.StrEnum
Discriminator for TriggerSource.
TriggerTargetSpec
A trigger target spec, discriminated on type.
TriggerTargetType
Bases: roboto.compat.StrEnum
The kind of thing a trigger does when it fires.
Attributes
TriggerTargetType.SendSlackMessage
Post a message to a Slack channel on the org’s allowlist.
TriggerTargetType.StartAgent
Start an AI agent thread from a saved agent definition.
TriggerValidator
Save-time validation for triggers.
Enforces the cross-field rules that need the event catalog: a condition may only reference namespace roots exposed by every event the source fires for, once_per must be legal for every subscribed event, an action target’s file patterns need a dataset to match against and are themselves required when the firing event’s own file is the action’s input, and every target template placeholder must resolve to a shared exposed root (or a reserved envelope./trigger. context). A schedule fires for exactly one occurrence type, so the same rules apply to it with that occurrence’s roots.
Run before persistence so a trigger that could never fire — or could never resolve its templates — fails loudly with an actionable message instead of silently misbehaving at evaluation time.
Parameters
TriggerValidator.validate()
Validate the cross-field rules for one trigger’s parts.
Parameters
The trigger’s firing source.
condition Optional[roboto.Optional predicate over the firing’s namespace.
targets collections.The trigger’s target specs.
managed_by Optional[roboto.The trigger’s owner, if it is managed. An ingestion rule’s trigger accepts only the files the rule’s path patterns match, so its per-file targets need no required_inputs.
Raises
ValueErrorThe first rule that fails, with a message naming the offending field, root, or event.
Return type
TriggerValidator.validate_record()
Validate a full trigger record.
UpdateTriggerRequest
Bases: pydantic.BaseModel
Request payload to update a trigger.
Only fields explicitly provided are changed; the NotSetType sentinel distinguishes “field omitted” from “field set to None”. The updated record must still satisfy every TriggerValidator rule.
Parameters
data AnyAttributes
UpdateTriggerRequest.condition
New condition; explicit None clears it.
UpdateTriggerRequest.fires_on
New firing source. Replaces the whole source: an event subscription’s events and once_per change together, and a trigger may switch between events and a schedule.
UpdateTriggerRequest.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
UpdateTriggerRequest.targets
New target list. A target whose target_id is referenced by existing dispatches must keep that id.
iter_query_templates()
Yield every RoboQL query in invocation_input, in document order.
Parameters
invocation_input collections.Return type
map_query_templates()
Return invocation_input with transform applied to every RoboQL query it holds.
Parameters
invocation_input collections.An InvocationInput in its JSON form, whose top-level values are selectors or lists of them.
transform collections.Called with each selector’s query; its result replaces that query.
Returns
A copy, shallow below the selectors it rewrites.
platform_event_sample()
Build the sample for one event type.
The event, changed and tag roots are built by the same EventNamespace that serves them when a trigger fires; the entity roots are exactly the ones catalog exposes for the type.
Parameters
Return type
platform_event_samples()
A sample for every event type in catalog, in catalog order.
Parameters
Return type
sample_schedule_trigger()
The schedule-fired trigger the schedule.fired sample is evaluated for, so the sample’s schedule root carries the cron a template may name.
Return type
sample_trigger()
The trigger the sample is evaluated for; what {{trigger.*}} sees.
Return type
substitute_query_template()
Return query with each placeholder replaced by resolve’s value for it, escaped in place.
Each placeholder is substituted exactly once, and a value is escaped for the literal that encloses it, so a value that itself looks like a template or carries a quote stays data.
Parameters
query strA RoboQL query carrying {{placeholder}} templates.
resolve collections.Returns the value for a placeholder name.
Raises
ValueErrorA placeholder sits outside a string literal, or a value cannot be escaped into the literal it lands in.
Return type
target_catalog_manifest()
The kinds of target a trigger can have, as the web UI’s target picker reads them.
target_catalog.json in this package is this function’s output, written by scripts/gen_trigger_manifests.py and drift-checked by a test on each side. Each entry’s body is empty: a target carries no save-time constraint of its own, so the picker offers every type for every event.
Return type
template_paths()
Every dotted path a template may reference under prefix, in document order.
Walks nested mappings only. A list is a leaf, because path resolution descends through mappings and stops at anything else: dataset.tags is addressable, dataset.tags.0 is not.
Parameters
record collections.prefix strReturn type