---
title: "Trigger"
description: "The `Trigger` entity."
section: "Reference"
group: "Types"
order: 243
---

## Definition

```ts
interface Trigger {
  id: string;
  workspaceId: string;
  eventType: string;
  targetId: string;
  subjectId: string | null;
  filter: {
    version: 1;
    root: import("/home/runner/work/aeontel/aeontel/packages/shared/src/conditions/schema").ConditionNode;
  } | null;
  enabled: boolean;
  createdBy: string;
  runtimeUserId: string | null;
  createdAt: string;
  updatedAt: string;
}
```

## Fields

| Field           | Type                                                                                                                             | Notes                                                                                                                                                                                                                  |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`            | `string`                                                                                                                         | `readonly` `required`                                                                                                                                                                                                  |
| `workspaceId`   | `string`                                                                                                                         | `required` — Workspace that owns this listener.                                                                                                                                                                        |
| `eventType`     | `string`                                                                                                                         | `required` — Event type the listener fires on (e.g. 'email.stored' or 'file.\*' wildcard).                                                                                                                             |
| `targetId`      | `string`                                                                                                                         | `required` — Entity dispatched when the event matches.                                                                                                                                                                 |
| `subjectId`     | `string \| null`                                                                                                                 | `required` — Optional subject scope. When set, fires only for events whose subjectId matches (e.g. one specific schedule).                                                                                             |
| `filter`        | `{ version: 1; root: import("/home/runner/work/aeontel/aeontel/packages/shared/src/conditions/schema").ConditionNode; } \| null` | `required` — Optional condition tree evaluated against the event. When non-null, the listener only fires if matches.                                                                                                   |
| `enabled`       | `boolean`                                                                                                                        | `required` — When false the listener is registered but does not fire.                                                                                                                                                  |
| `createdBy`     | `string`                                                                                                                         | `required` — User who created the listener.                                                                                                                                                                            |
| `runtimeUserId` | `string \| null`                                                                                                                 | `required` — Override the workspace default service user as the runtime caller when this listener fires. Null = inherit workspace default. Workspace-admin-only to set; target user must be a member of the workspace. |
| `createdAt`     | `string`                                                                                                                         | `readonly` `required` — ISO-8601 timestamp of creation.                                                                                                                                                                |
| `updatedAt`     | `string`                                                                                                                         | `readonly` `required` — ISO-8601 timestamp of the last update.                                                                                                                                                         |
