Upgrading from v2
How to upgrade v2 jobs to v3 tasks, and how to use them together.
v3 feature matrix
As v3 is in Developer Preview there are some features that are not yet available. Take a look at the Feature matrix to check what is currently available.
Changes from v2 to v3
The main difference is that things in v3 are far simpler. That’s because in v3 your code is deployed to our servers (unless you self-host) which are long-running.
- No timeouts.
- No
io.runTask()
(and nocacheKeys
). - Just use official SDKs, not integrations.
task
s are the new primitive, notjob
s.
OpenAI example comparison
This is a (very contrived) example that does a long OpenAI API call (>10s), stores the result in a database, waits for 5 mins, and then returns the result.
v2
First, the old v2 code, which uses the OpenAI integration. Comments inline:
v3
In v3 we eliminate a lot of code mainly because we don’t need tricks to try avoid timeouts. Here’s the equivalent v3 code:
Triggering tasks comparison
v2
In v2 there were different trigger types and triggering each type was slightly different.
v3
We’ve unified triggering in v3. You use trigger()
or batchTrigger()
which you can do on any type of task. Including scheduled, webhooks, etc if you want.
Upgrading your project
Upgrade the v2 Trigger.dev packages
You can run this command to upgrade all the packages to the beta:
Follow the v3 quick start
Follow the v3 quick start to get started with v3.
Using v2 together with v3
You can use v2 and v3 in the same codebase. This can be useful where you already have v2 jobs or where we don’t support features you need (yet).
Was this page helpful?