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

### ActionInvocationSpec

```python
class roboto.domain.triggers.targets.ActionInvocationSpec(/, **data: Any)
```

`from roboto.domain.triggers import ActionInvocationSpec`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L57-L120)

Bases: `pydantic.BaseModel`

How to invoke an action: the action, its parameter values, its inputs, and overrides of its settings.

It says what to run but not when. `InvokeActionTarget` extends it with a target's ID and file patterns, and an ingestion rule stores one for the action it runs on the files it matches.

Strings in `parameter_values` and `invocation_input` may contain `{{...}}` placeholders, such as `{{dataset.dataset_id}}`, which Roboto fills from the platform event that fired the trigger; see [`EventNamespace`](/docs/reference/python-sdk/roboto/domain/triggers/namespace#roboto.domain.triggers.namespace.EventNamespace).

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionInvocationSpec.action** (`roboto.domain.actions.action_record.ActionReference`): Action to invoke.

  An `owner` of `None` means the trigger's organization, and a `digest` of `None` the action's latest version.

- **ActionInvocationSpec.compute_requirement_overrides** (`roboto.domain.actions.action_record.ComputeRequirements | None`) = `None`: Compute requirements, such as vCPU and memory, that replace the action's own.

  `None` uses the action's own.

- **ActionInvocationSpec.container_parameter_overrides** (`roboto.domain.actions.action_record.ContainerParameters | None`) = `None`: Container parameters, such as the entry point and environment variables, that replace the action's own.

  `None` uses the action's own.

- **ActionInvocationSpec.invocation_input** (`roboto.domain.actions.invocation_record.InvocationInput | None`) = `None`: Files, topics, or sessions the invocation reads, chosen by query, ID, or name when it runs.

  For example, `InvocationInput.file_query('tags CONTAINS "{{event.name}}"')`. A trigger whose platform events name no dataset selects its inputs only this way. On an event that names a dataset, these inputs are read along with the files the target's patterns match.

- **ActionInvocationSpec.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **ActionInvocationSpec.parameter_values** (`dict[str, Any]`) = `None`: Values of the action's parameters, keyed by parameter name. Any string among them may contain placeholders.

- **ActionInvocationSpec.timeout** (`int | None`) = `None`: Maximum time the invocation may run, in minutes. `None` uses the action's own.

- **ActionInvocationSpec.upload_destination** (`roboto.domain.actions.invocation_record.InvocationUploadDestination | None`) = `None`: Where Roboto uploads the files the invocation writes to its output directory.

  `None` uploads them to the dataset the platform event names. On an event that names no dataset, `None` uploads them to the dataset the inputs come from when they all come from one, and otherwise not at all.

#### ActionInvocationSpec.referenced_placeholders()

```python
def referenced_placeholders() -> set[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L109-L120)

Return the name of every placeholder in `parameter_values` and `invocation_input`.

**Returns**

- `set[str]`: Placeholder names without their braces, such as `dataset.dataset_id`.

**Raises**

- `ValueError`: A key in `parameter_values` contains placeholder syntax.

### InvokeActionTarget

```python
class roboto.domain.triggers.targets.InvokeActionTarget(/, **data: Any)
```

`from roboto.domain.triggers import InvokeActionTarget`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L123-L224)

Bases: [`ActionInvocationSpec`](/docs/reference/python-sdk/roboto/domain/triggers/targets#roboto.domain.triggers.targets.ActionInvocationSpec), `_TargetSpecBase`

Target that invokes an action when its trigger fires.

The fields it shares with `ActionInvocationSpec` say how to run the action. This class adds the target's ID and the gitignore-style patterns that pick files from the platform event's dataset, whose strings may contain placeholders too. What the invocation reads depends on the platform event:

- An event that names a dataset, such as a file upload, invokes the action on that dataset. `required_inputs` decides whether the target runs, and the files it and `additional_inputs` match are inputs, along with any `invocation_input`.
- An event that names no dataset, such as a schedule firing or an invocation finishing, invokes the action on no dataset, and it reads what `invocation_input` selects. `required_inputs` and `additional_inputs` must be empty.

Constructing a target whose `type` is not `InvokeAction`, or whose `required_inputs` or `additional_inputs` holds only blank patterns, raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **InvokeActionTarget.additional_inputs** (`list[str] | None`) = `None`: Gitignore-style patterns for more of the dataset's files to give the invocation.

  They add to the files `required_inputs` match and do not decide whether the target runs. Must be empty when the trigger's platform events name no dataset.

- **InvokeActionTarget.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **InvokeActionTarget.required_inputs** (`list[str]`) = `None`: Gitignore-style patterns, such as `**/*.bag`, for the files the action needs.

  When the trigger fires for one file (a file event at a `once_per` finer than [`Dataset`](/docs/reference/python-sdk/roboto/domain/platform_events/once_per#roboto.domain.platform_events.once_per.OncePer.Dataset)), the list must not be empty, and the target runs only if that file matches one of the patterns. When it fires for a whole dataset, the target runs only if each pattern matches a file of its own in the dataset, and on [`FileIngested`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.FileIngested) only once every matching file is ingested. Must be empty when the trigger's platform events name no dataset.

- **InvokeActionTarget.target_id** (`str`): ID of the target, unique within its trigger.

  Roboto keeps which entities the target already fired for under this ID, so a target given a new ID, even one otherwise identical, fires again for them.

- **InvokeActionTarget.type** (`Literal[TriggerTargetType]`): Kind of target, always `TriggerTargetType.InvokeAction`.

#### InvokeActionTarget.from_invocation()

```python
@classmethod
def from_invocation(
    invocation: ActionInvocationSpec,
    *,
    target_id: str,
    required_inputs: Optional[list[str]] = None,
    additional_inputs: Optional[list[str]] = None,
) -> InvokeActionTarget
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L172-L193)

Build a target that runs `invocation`, with the given ID and file patterns.

**Parameters**

- **invocation** (`ActionInvocationSpec`): How to invoke the action.
- **target_id** (`str`): ID of the target, unique within its trigger.
- **required_inputs** (`Optional[list[str]]`): Patterns for the files the action needs. `None` sets none.
- **additional_inputs** (`Optional[list[str]]`): Patterns for more files to give the invocation. `None` sets none.

**Returns**

- `InvokeActionTarget`

#### InvokeActionTarget.invocation()

```python
def invocation() -> ActionInvocationSpec
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L195-L197)

Return how this target invokes its action, without the target's ID or file patterns.

**Returns**

- `ActionInvocationSpec`

#### InvokeActionTarget.referenced_placeholders()

```python
def referenced_placeholders() -> set[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L209-L224)

Return the name of every placeholder in this target's templated fields.

Those are `parameter_values`, `invocation_input`, `required_inputs` and `additional_inputs`.

**Returns**

- `set[str]`: Placeholder names without their braces, such as `dataset.dataset_id`.

**Raises**

- `ValueError`: A key in `parameter_values` contains placeholder syntax.

### SendSlackMessageTarget

```python
class roboto.domain.triggers.targets.SendSlackMessageTarget(/, **data: Any)
```

`from roboto.domain.triggers import SendSlackMessageTarget`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L275-L307)

Bases: `_TargetSpecBase`

Target that posts a message to a Slack channel when its trigger fires.

Each time it runs, Roboto checks that the organization allows it to post to the channel, and fails the target if not. A platform event Roboto delivers twice can post the message twice. Constructing a target with any other `type` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SendSlackMessageTarget.channel_id** (`str`): ID of the Slack channel to post to, such as `C0123`.

- **SendSlackMessageTarget.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **SendSlackMessageTarget.target_id** (`str`): ID of the target, unique within its trigger.

  Roboto keeps which entities the target already fired for under this ID, so a target given a new ID fires again for them.

- **SendSlackMessageTarget.text** (`str`): Message to post. Roboto fills its `{{...}}` placeholders from the platform event that fired the trigger.

- **SendSlackMessageTarget.type** (`Literal[TriggerTargetType]`): Kind of target, always `TriggerTargetType.SendSlackMessage`.

#### SendSlackMessageTarget.referenced_placeholders()

```python
def referenced_placeholders() -> set[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L301-L307)

Return the name of every placeholder in `text`.

**Returns**

- `set[str]`: Placeholder names without their braces, such as `dataset.dataset_id`.

### StartAgentTarget

```python
class roboto.domain.triggers.targets.StartAgentTarget(/, **data: Any)
```

`from roboto.domain.triggers import StartAgentTarget`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L227-L272)

Bases: `_TargetSpecBase`

Target that starts a thread from a saved agent when its trigger fires.

Roboto fills the `{{...}}` placeholders in each of `values` from the platform event that fired the trigger, then starts the agent with the results as the values of its variables. Constructing a target with any other `type` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **StartAgentTarget.agent_id** (`str`): ID of the saved agent to start a thread from. The agent must belong to the trigger's organization.

- **StartAgentTarget.analysis_scope** (`roboto.ai.core.AnalysisScope | None`) = `None`: Time window the agent analyzes.

  Each bound set here replaces the agent's own, and each bound left `None` keeps it. `None` uses the agent's own scope.

- **StartAgentTarget.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **StartAgentTarget.target_id** (`str`): ID of the target, unique within its trigger.

  Roboto keeps which entities the target already fired for under this ID, so a target given a new ID fires again for them.

- **StartAgentTarget.type** (`Literal[TriggerTargetType]`): Kind of target, always `TriggerTargetType.StartAgent`.

- **StartAgentTarget.values** (`dict[str, str]`) = `None`: Values of the agent's variables, keyed by variable name, each a template that may contain placeholders.

  Variables left out take the agent's defaults.

- **StartAgentTarget.visibility** (`roboto.ai.agent_thread.record.ThreadVisibility`): Who may read the threads the target starts. Defaults to every member of the organization.

#### StartAgentTarget.referenced_placeholders()

```python
def referenced_placeholders() -> set[str]
```

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

Return the name of every placeholder in `values`.

**Returns**

- `set[str]`: Placeholder names without their braces, such as `dataset.dataset_id`.

### TriggerTargetSpec

```python
roboto.domain.triggers.targets.TriggerTargetSpec
```

`from roboto.domain.triggers import TriggerTargetSpec`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L310-L313)

Target of any kind: one of the target models, told apart by `type`.

A target is what a trigger runs when it fires. The models are `InvokeActionTarget`, `StartAgentTarget` and `SendSlackMessageTarget`.

### TriggerTargetType

```python
class roboto.domain.triggers.targets.TriggerTargetType
```

`from roboto.domain.triggers import TriggerTargetType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L33-L43)

Bases: `roboto.compat.StrEnum`

Kind of target, the `type` of each `TriggerTargetSpec`.

**Attributes**

- **TriggerTargetType.InvokeAction** = `'invoke_action'`: Invocation of an action.
- **TriggerTargetType.SendSlackMessage** = `'send_slack_message'`: Message posted to a Slack channel the organization allows Roboto to post to.
- **TriggerTargetType.StartAgent** = `'start_agent'`: Agent thread started from a saved agent.

### target_catalog_manifest()

```python
def roboto.domain.triggers.targets.target_catalog_manifest() -> dict[str, Any]
```

`from roboto.domain.triggers import target_catalog_manifest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/targets.py#L321-L332)

Return the kinds of target a trigger can have, keyed by their `type`.

Roboto calls this when it regenerates `target_catalog.json` in this package, the list of target kinds that the Roboto web app mirrors.

**Returns**

- `dict[str, Any]`: Dictionary keyed by each kind's `type` value. Each value is an empty dictionary, because no kind of target is limited to some platform events.
