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/idempotency.mdx
+53-13Lines changed: 53 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,17 @@ description: "An API call or operation is “idempotent” if it has the same re
5
5
6
6
We currently support idempotency at the task level, meaning that if you trigger a task with the same `idempotencyKey` twice, the second request will not create a new task run.
7
7
8
+
<Warning>
9
+
In version 3.3.0 and later, the `idempotencyKey` option is not available when using
10
+
`triggerAndWait` or `batchTriggerAndWait`, due to a bug that would sometimes cause the parent task
11
+
to become stuck. We are working on a fix for this issue.
12
+
</Warning>
13
+
8
14
## `idempotencyKey` option
9
15
10
16
You can provide an `idempotencyKey` to ensure that a task is only triggered once with the same key. This is useful if you are triggering a task within another task that might be retried:
// Do something else, that may throw an error and cause the task to be retried
34
+
thrownewError("Something went wrong");
28
35
},
29
36
});
30
37
```
@@ -33,7 +40,7 @@ You can use the `idempotencyKeys.create` SDK function to create an idempotency k
33
40
34
41
We automatically inject the run ID when generating the idempotency key when running inside a task by default. You can turn it off by passing the `scope` option to `idempotencyKeys.create`:
// Do something else, that may throw an error and cause the task to be retried
119
+
thrownewError("Something went wrong");
120
+
},
121
+
});
122
+
```
123
+
124
+
You can use the following units for the `idempotencyKeyTTL` option:
125
+
126
+
-`s` for seconds (e.g. `60s`)
127
+
-`m` for minutes (e.g. `5m`)
128
+
-`h` for hours (e.g. `2h`)
129
+
-`d` for days (e.g. `3d`)
130
+
91
131
## Payload-based idempotency
92
132
93
133
We don't currently support payload-based idempotency, but you can implement it yourself by hashing the payload and using the hash as the idempotency key.
If you need more than 100 concurrent runs on the Pro tier, you can request more by contacting us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord).
17
17
@@ -20,44 +20,58 @@ If you need more than 100 concurrent runs on the Pro tier, you can request more
20
20
Generally speaking each SDK call is an API call.
21
21
22
22
| Limit | Details |
23
-
|:----- |:------------------------- |
23
+
|:----| :------------------------ |
24
24
| API | 1,500 requests per minute |
25
25
26
-
<RateLimitHitUseBatchTrigger/>
26
+
<RateLimitHitUseBatchTrigger/>
27
27
28
28
## Queued tasks
29
29
30
30
The number of queued tasks by environment.
31
31
32
32
| Limit | Details |
33
-
|:------- |:------------------ |
33
+
|:------| :----------------- |
34
34
| Dev | At most 500 |
35
35
| Staging | At most 10 million |
36
36
| Prod | At most 10 million |
37
37
38
38
## Schedules
39
39
40
-
| Pricing tier | Limit|
41
-
|:---------------- |:-------------------- |
42
-
| Free | 5 per project|
43
-
| Hobby | 100 per project|
44
-
| Pro | 1,000+ per project|
40
+
| Pricing tier | Limit |
41
+
|:-----------| :----------------- |
42
+
| Free | 5 per project |
43
+
| Hobby | 100 per project |
44
+
| Pro | 1,000+ per project |
45
45
46
46
When attaching schedules to tasks we strongly recommend you add them [in our dashboard](/tasks/scheduled#attaching-schedules-in-the-dashboard) if they're "static". That way you can control them easily per environment.
47
47
48
48
If you add them [dynamically using code](/management/schedules/create) make sure you add a `deduplicationKey` so you don't add the same schedule to a task multiple times. If you don't your task will get triggered multiple times, it will cost you more, and you will hit the limit.
49
49
50
50
If you're creating schedules for your user you will definitely need to request more schedules from us.
| Batch trigger payload | The total of all payloads must not exceed 1MB |
58
+
| Task outputs | Must not exceed 10MB |
59
+
60
+
Payloads and outputs that exceed 512KB will be offloaded to object storage and a presigned URL will be provided to download the data when calling `runs.retrieve`. You don't need to do anything to handle this in your tasks however, as we will transparently upload/download these during operation.
61
+
62
+
## Batch size
63
+
64
+
A single batch can have a maximum of 500 items.
65
+
52
66
<SoftLimit />
53
67
54
68
## Log retention
55
69
56
-
| Pricing tier | Limit|
57
-
|:---------------- |:--------- |
58
-
| Free | 1 day|
59
-
| Hobby | 7 days|
60
-
| Pro | 30 days|
70
+
| Pricing tier | Limit |
71
+
|:-----------| :------ |
72
+
| Free | 1 day |
73
+
| Hobby | 7 days |
74
+
| Pro | 30 days |
61
75
62
76
## Log size
63
77
@@ -66,25 +80,30 @@ We limit the size of logs to prevent oversized data potentially causing issues.
66
80
<Expandabletitle="log limits">
67
81
68
82
#### Attribute Limits
83
+
69
84
- Span Attribute Count Limit: 256
70
85
- Log Attribute Count Limit: 256
71
86
- Span Attribute Value Length Limit: 1028 characters
72
87
- Log Attribute Value Length Limit: 1028 characters
73
88
74
89
#### Event and Link Limits
90
+
75
91
- Span Event Count Limit: 10
76
92
- Link Count Limit: 2
77
93
- Attributes per Link Limit: 10
78
94
- Attributes per Event Limit: 10
79
95
80
96
#### I/O Packet Length Limit
97
+
81
98
128 KB (131,072 bytes)
82
99
83
100
#### Attribute Clipping Behavior
101
+
84
102
- Attributes exceeding the value length limit (1028 characters) are discarded.
85
103
- If the total number of attributes exceeds 256, additional attributes are not included.
86
104
87
105
#### Attribute Value Size Calculation
106
+
88
107
- Strings: Actual length of the string
89
108
- Numbers: 8 bytes
90
109
- Booleans: 4 bytes
@@ -93,25 +112,15 @@ We limit the size of logs to prevent oversized data potentially causing issues.
93
112
94
113
</Expandable>
95
114
96
-
## Task payloads and outputs
97
-
98
-
| Limit | Details |
99
-
|:--- |:--- |
100
-
| Single trigger payload | Must not exceed 10MB |
101
-
| Batch trigger payload | The total of all payloads must not exceed 10MB |
102
-
| Task outputs | Must not exceed 10MB |
103
-
104
-
Payloads and outputs that exceed 512KB will be offloaded to object storage and a presigned URL will be provided to download the data when calling `runs.retrieve`. You don't need to do anything to handle this in your tasks however, as we will transparently upload/download these during operation.
105
-
106
115
## Alerts
107
116
108
117
An alert destination is a single email address, Slack channel, or webhook URL that you want to send alerts to. If you're on the Pro and need more than 100 alert destinations, you can request more by contacting us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord).
109
118
110
-
| Pricing tier | Limit |
111
-
|:---------------- |:----------------------- |
112
-
| Free | 1 alert destination |
113
-
| Hobby | 3 alert destinations |
114
-
| Pro | 100+ alert destinations |
119
+
| Pricing tier | Limit |
120
+
|:-----------| :---------------------- |
121
+
| Free | 1 alert destination |
122
+
| Hobby | 3 alert destinations |
123
+
| Pro | 100+ alert destinations |
115
124
116
125
## Machines
117
126
@@ -121,8 +130,8 @@ See the [machine configurations](/machines#machine-configurations) for more deta
0 commit comments