You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/data-ai/reference/triggers-configuration.md
+77-40Lines changed: 77 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,29 +6,45 @@ type: "docs"
6
6
tags: ["data management", "trigger", "webhook"]
7
7
description: "Detailed information about how to configure triggers and webhooks."
8
8
date: "2025-05-05"
9
+
updated: "2025-09-18"
9
10
---
10
11
11
-
Triggers can alert you by email or webhook when the following events occur:
12
+
Triggers can alert you by email or webhook when any of the following events occur:
12
13
13
14
-[machine telemetry data syncs from your local device to the Viam cloud](/manage/troubleshoot/alert/)
14
-
-[data syncs from a machine](/data-ai/data/advanced/alert-data/)
15
+
-[data syncs from a machine](/data-ai/data/alert-data/)
15
16
-[service detects a specified object or classifies a specified label](/data-ai/ai/alert/)
16
17
17
-
## Trigger attributes
18
+
This page provides a reference for the Trigger attributes.
19
+
For step-by-step configuration information, see the links above instead.
18
20
19
-
Triggers support the following attributes:
21
+
## JSON configuration templates
20
22
21
-
<!-- prettier-ignore -->
22
-
| Name | Type | Required? | Description |
23
-
| ---- | ---- | --------- | ----------- |
24
-
|`name`| string |**Required**| The name of the trigger |
25
-
|`event`| object |**Required**| The trigger event object, which contains the following fields: <ul><li>`type`: The type of the event to trigger on. Options: `part_data_ingested`, `conditional_data_ingested`.</li><li>`data_types`: Required with `type``part_data_ingested`. An array of data types that trigger the event. Options: `binary`, `tabular`, `file`, `unspecified`. </li><li> `conditional`: Required when `type` is `conditional_data_ingested`. For more information about this field, see [Conditional attributes](/data-ai/reference/triggers-configuration/#conditional-attributes). </li></ul> |
26
-
|`notifications`| object |**Required**| The notifications object, which contains the following fields: <ul><li>`type`: The type of the notification. Options: `webhook`, `email`</li><li>`value`: The URL to send the request to or the email address to notify.</li><li>`seconds_between_notifications`: The interval between notifications in seconds.</li></ul> For more information on webhooks, see [Webhook attributes](#webhook-attributes). |
27
-
|`notes`| string | Optional | Descriptive text to document the purpose, configuration details, or other important information about this trigger. |
23
+
### Part status trigger template
24
+
25
+
The following template demonstrates the structure of a JSON configuration for a trigger that alerts when a part is online or offline:
@@ -51,31 +67,9 @@ The following template demonstrates the form of a JSON configuration for a trigg
51
67
]
52
68
```
53
69
54
-
## Conditional attributes
55
-
56
-
The `conditional` object for the `conditional_data_ingested` trigger type includes the following attributes:
57
-
58
-
<!-- prettier-ignore -->
59
-
| Name | Type | Required? | Description |
60
-
| ---- | ---- | --------- | ----------- |
61
-
|`data_capture_method`| string |**Required**| The method of data capture to trigger on. <br> Example: `sensor:<name-of-component>:Readings`. |
62
-
|`conditions`| object | Optional | Conditions that, when true, fire the trigger. Evaluated each time data syncs from the linked component. When this object is empty or not present, the trigger fires each time data syncs from the linked component. <br> Options: <ul><li>`evals`:<ul><li>`operator`: Logical operator for the condition. </li><li>`value`: An object containing a single field and value. The field specifies the path, in the synced data, to the left operand of the conditional. For nested fields, use periods as separators or define the nested structure in JSON. The value specifies an object, string, boolean, regular expression, or integer used as a right operand in the conditional. </li></ul></li></ul> |
63
-
64
-
The `operator` attribute supports the following values:
65
-
66
-
| Name | Description |
67
-
| ------- | -------------------------- |
68
-
|`lt`| less than |
69
-
|`gt`| greater than |
70
-
|`lte`| less than or equal to |
71
-
|`gte`| greater than or equal to |
72
-
|`eq`| equal to |
73
-
|`neq`| not equal to |
74
-
|`regex`| matches regular expression |
75
-
76
70
### Conditional trigger template
77
71
78
-
The following template demonstrates the form of a JSON configuration for a conditional trigger:
72
+
The following template demonstrates the structure of a JSON configuration for a conditional trigger:
@@ -106,6 +100,40 @@ The following template demonstrates the form of a JSON configuration for a condi
106
100
]
107
101
```
108
102
103
+
## Trigger attributes
104
+
105
+
Triggers support the following attributes:
106
+
107
+
<!-- prettier-ignore -->
108
+
| Name | Type | Required? | Description |
109
+
| ---- | ---- | --------- | ----------- |
110
+
|`name`| string |**Required**| The name of the trigger |
111
+
|`event`| object |**Required**| The trigger event object, which contains the following fields: <ul><li>`type`: The type of the event to trigger on. Options: <ul><li>`part_data_ingested`: fire when data syncs</li> <li>`conditional_data_ingested`: fire when data that meets a certain condition syncs</li> <li>`part_online`: fire when the part is online</li> <li>`part_offline`: fire when the part is offline</li></ul></li><li>`data_types`: Required with `type``part_data_ingested`. An array of data types that trigger the event. Options: `binary`, `tabular`, `file`, `unspecified`. </li><li> `conditional`: Required when `type` is `conditional_data_ingested`. For more information about this field, see [Conditional attributes](/data-ai/reference/triggers-configuration/#conditional-attributes). </li></ul> |
112
+
|`notifications`| object |**Required**| The notifications object, which contains the following fields: <ul><li>`type`: The type of the notification. Options: `webhook`, `email`</li><li>`value`: The URL to send the request to or the email address to notify.</li><li>`seconds_between_notifications`: The interval between notifications in seconds.</li></ul> For more information on webhooks, see [Webhook attributes](#webhook-attributes). |
113
+
|`notes`| string | Optional | Descriptive text to document the purpose, configuration details, or other important information about this trigger. |
114
+
115
+
## Conditional attributes
116
+
117
+
The `conditional` object for the `conditional_data_ingested` trigger type includes the following attributes:
118
+
119
+
<!-- prettier-ignore -->
120
+
| Name | Type | Required? | Description |
121
+
| ---- | ---- | --------- | ----------- |
122
+
|`data_capture_method`| string |**Required**| The method of data capture to trigger on. <br> Example: `sensor:<name-of-component>:Readings`. |
123
+
|`conditions`| object | Optional | Conditions that, when true, fire the trigger. Evaluated each time data syncs from the linked component. When this object is empty or not present, the trigger fires each time data syncs from the linked component. <br> Options: <ul><li>`evals`:<ul><li>`operator`: Logical operator for the condition. </li><li>`value`: An object containing a single field and value. The field specifies the path, in the synced data, to the left operand of the conditional. For nested fields, use periods as separators or define the nested structure in JSON. The value specifies an object, string, boolean, regular expression, or integer used as a right operand in the conditional. </li></ul></li></ul> |
124
+
125
+
The `operator` attribute supports the following values:
126
+
127
+
| Name | Description |
128
+
| ------- | -------------------------- |
129
+
|`lt`| less than |
130
+
|`gt`| greater than |
131
+
|`lte`| less than or equal to |
132
+
|`gte`| greater than or equal to |
133
+
|`eq`| equal to |
134
+
|`neq`| not equal to |
135
+
|`regex`| matches regular expression |
136
+
109
137
### Example
110
138
111
139
The following condition defines a trigger that fires based on the value of the `cpu` field of synced data:
@@ -168,7 +196,7 @@ The following sensor reading fires the trigger, since `40 < 50` is `true`:
168
196
169
197
### Request types
170
198
171
-
When an event occurs, Viam sends a HTTP request to the URL you specified for the trigger:
199
+
When an event occurs, Viam sends an HTTP request to the URL you specified for the trigger:
172
200
173
201
<!-- prettier-ignore -->
174
202
| Trigger type | HTTP Method |
@@ -189,7 +217,7 @@ The request includes the following headers:
189
217
|`Organization-Name`| The name of the organization that triggered the request. |`part_online`, `part_offline`|
190
218
|`Location-Id`| The location of the machine that triggered the request. | all |
191
219
|`Location-Name`| The location of the machine that triggered the request. |`part_online`, `part_offline`|
192
-
|`Part-Id`|The part of the machine that triggered the request. | all |
220
+
|`Part-Id`| The part of the machine that triggered the request. | all |
193
221
|`Machine-Name`| The name of the machine that triggered the request. |`part_online`, `part_offline`|
194
222
|`Robot-Id`| The ID of the machine that triggered the request. | all |
195
223
@@ -205,11 +233,10 @@ The request body includes the following data:
205
233
|`method_name`| The name of the method from which data was ingested. |`part_data_ingested`, `conditional_data_ingested`|
206
234
|`min_time_received`| Indicates the earliest time a piece of data was received. |`part_data_ingested`|
207
235
|`max_time_received`| Indicates the latest time a piece of data was received. |`part_data_ingested`|
208
-
|`method_name`| The name of the method that triggered the request. |`conditional_data_ingested`|
209
236
|`machine_name`| The name of the machine that triggered the request. |`part_data_ingested`, `conditional_data_ingested`|
210
237
|`location_name`| The location of the machine that triggered the request. |`part_data_ingested`, `conditional_data_ingested`|
211
238
|`org_name`| The name of the organization that triggered the request. |`part_data_ingested`, `conditional_data_ingested`|
212
-
|`file_id`| The id of the file that was ingested. |`part_data_ingested`|
239
+
|`file_id`| The ID of the file that was ingested. |`part_data_ingested`|
213
240
|`trigger_condition`| The condition that triggered the request. |`conditional_data_ingested`|
214
241
|`data`| The ingested sensor data. Includes `metadata` with `received_at` and `requested_at` timestamps and `data` in the form `map[string]any`. |`part_data_ingested`, `conditional_data_ingested` (sensor data) |
215
242
@@ -222,7 +249,7 @@ The following example function prints the received headers:
Copy file name to clipboardExpand all lines: docs/dev/reference/changelog.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -736,7 +736,7 @@ You can visualize any data, such as sensor readings, that you have [synced](/dat
736
736
737
737
{{% changelog date="2024-01-31" color="added" title="Use triggers to trigger actions" %}}
738
738
739
-
You can now configure [triggers](/data-ai/data/advanced/alert-data/) (previously called webhooks) to execute actions when certain types of data are sent from your machine to the cloud.
739
+
You can now configure [triggers](/data-ai/data/alert-data/) (previously called webhooks) to execute actions when certain types of data are sent from your machine to the cloud.
Copy file name to clipboardExpand all lines: docs/operate/mobility/use-input-to-act.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Other common inputs include the methods of a [board](/dev/reference/apis/compone
53
53
You can also use camera input, for example to detect objects and pick them up with an arm.
54
54
See [Act based on inferences](/data-ai/ai/act/) for relevant examples.
55
55
56
-
If you want to send alerts based on computer vision or captured data, see [Alert on inferences](/data-ai/ai/alert/) or [Alert on data](/data-ai/data/advanced/alert-data/).
56
+
If you want to send alerts based on computer vision or captured data, see [Alert on inferences](/data-ai/ai/alert/) or [Alert on data](/data-ai/data/alert-data/).
0 commit comments