You can see there are two parts to the version identifier:
The date (in reverse format)
The version number
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.
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.
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.
When running the local server (using npx trigger.dev dev), every relevant code change automatically creates a new version of all tasks.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.
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 replaying for more information.