machine option controls how much compute that container is allocated. Higher-spec machines increase cost but improve performance for CPU-bound or memory-intensive tasks.
Setting a machine for a task
Pass themachine option when defining a task:
/trigger/heavy-task.ts
Setting the default machine
You can set a project-wide default machine intrigger.config.ts. All tasks without an explicit machine option will use this default.
trigger.config.ts
small-1x (0.5 vCPU, 0.5 GB RAM).
Machine presets
View pricing for each preset on the Trigger.dev pricing page.
Overriding the machine at trigger time
You can override the machine when triggering a task — useful when the required resources depend on the payload (e.g. a large file upload or a high-data customer):Out of memory (OOM) errors
When a task run is killed due to exceeding the machine’s memory limit, you’ll see an error like:- The Node.js V8 heap limit is exceeded
- The entire container process exceeds the machine’s memory limit
- A child process (e.g.
ffmpeg) exceeds the memory limit and exits with a non-zero code
Retrying with a larger machine
For tasks that only occasionally hit memory limits, you can configure an automatic retry on OOM with a larger machine:/trigger/heavy-task.ts
OOM retry only triggers on out-of-memory errors. It does not permanently change the machine for new
runs — if you consistently see OOM errors, increase the
machine property directly.Throwing an explicit OOM error
If your code detects it is about to run out of memory (for example, a native library signals an allocation failure), you can throwOutOfMemoryError to trigger the same OOM handling:
/trigger/heavy-task.ts
Monitoring memory usage
To diagnose OOM errors, add theResourceMonitor helper to your project. It logs memory, CPU, and disk usage at a regular interval:
/trigger/tasks.ts
ffmpeg subprocess):
ResourceMonitor is a helper class you add to your own project. Copy the implementation from the Trigger.dev examples repository or write a simplified version using Node.js process.memoryUsage().
ResourceMonitor implementation
ResourceMonitor implementation
/src/resourceMonitor.ts