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
description: "Configure the number of vCPUs and GBs of RAM you want the task to use."
4
+
---
5
+
6
+
The `machine` configuration is optional. Using higher spec machines will increase the cost of running the task but can also improve the performance of the task if it is CPU or memory bound.
description: "We use atomic versioning to ensure that started tasks are not affected by changes to the task code."
4
+
---
5
+
6
+
A version is a bundle of tasks at a certain point in time.
7
+
8
+
## Version identifiers
9
+
10
+
Version identifiers look like this:
11
+
12
+
-`20240313.1` - March 13th, 2024, version 1
13
+
-`20240313.2` - March 13th, 2024, version 2
14
+
-`20240314.1` - March 14th, 2024, version 1
15
+
16
+
You can see there are two parts to the version identifier:
17
+
18
+
- The date (in reverse format)
19
+
- The version number
20
+
21
+
Versions numbers are incremented each time a new version is created for that date and environment. So it's possible to have `20240313.1` in both the `dev` and `prod` environments.
22
+
23
+
## Version locking
24
+
25
+
When a task run starts it is locked to the latest version of the code (for that environment). Once locked it won't change versions, even if you deploy new versions. This is to ensure that a task run is not affected by changes to the code.
26
+
27
+
### Child tasks and version locking
28
+
29
+
Trigger and wait functions version lock child task runs to the parent task run version. This ensures the results from child runs match what the parent task is expecting. If you don't wait then version locking doesn't apply.
30
+
31
+
| Trigger function | Parent task version | Child task version | isLocked |
When running the local server (using `npx trigger.dev dev`), every relevant code change automatically creates a new version of all tasks.
41
+
42
+
So a task run will continue running on the version it was locked to. We do this by spawning a new process for each task run. This ensures that the task run is not affected by changes to the code.
43
+
44
+
## Deployment
45
+
46
+
Every deployment creates a new version of all tasks for that environment.
47
+
48
+
## Retries and reattempts
49
+
50
+
When a task has an uncaught error it will [retry](/v3/errors-retrying), assuming you have not set `maxAttempts` to 0. Retries are locked to the original version of the run.
51
+
52
+
If all the attempts have failed you can start a [reattempt](/v3/reattempting-replaying). This will be version locked to the original version of the run.
53
+
54
+
## Replays
55
+
56
+
A "replay" is a new run of a task that uses the same inputs but will use the latest version of the code. This is useful when you fix a bug and want to re-run a task with the same inputs. See [replays](/v3/reattempting-replaying) for more information.
|[Logging](/v3/logging)| View and send logs and traces from your tasks. |
14
+
|[Errors & retrying](/v3/errors-retrying)| How to deal with errors and write reliable tasks. |
15
+
|[Wait](/v3/wait)| Wait for periods of time or for external events to occur before continuing. |
16
+
|[Concurrency & Queues](/v3/queue-concurrency)| Configure what you want to happen when there is more than one run at a time. |
17
+
|[Versioning](/v3/versioning)| How versioning works. |
18
+
|[Machines](/v3/machines)| Configure the CPU and RAM of the machine your task runs on |
19
+
|[Idempotency](/v3/idempotency)| Protect against mutations happening twice. |
20
+
|[Reattempting & Replaying](/v3/reattempting-replaying)| You can reattempt a task that has failed all of its attempts. You can also replay a task with a new version of your code. |
21
+
|[Notifications](/v3/notifications)| Send realtime notifications from your task that you can subscribe to from your backend or frontend. |
22
+
|[Rollbacks](/v3/rollbacks)| Rollback code inside a task when errors happen to provide transactional guarantees. |
23
+
|[Using APIs](/v3/using-apis)| How to use APIs from within your tasks. |
24
+
|[Trigger filters](/v3/trigger-filters)| Prevent unwanted filters where the payload doesn't match your filter. |
25
+
|[Middleware](/v3/middleware)| Middleware can wrap the task run function. |
26
+
|[Automated tests](/v3/automated-tests)| Write automated tests in code. |
0 commit comments