Set a project-wide default in trigger.config.ts via the `machine` field (docs example: `export const config: TriggerConfig = { machine: "small-2x" }`).
Override per run at trigger time: `await tasks.trigger<typeof heavyTask>("heavy-task", payload, { machine: "large-2x" });`
Cap execution time with `maxDuration` in seconds — globally in trigger.config.ts, per task, or per trigger call (https://trigger.dev/docs/runs/max-duration).
Minimum `maxDuration` is 5 seconds; set `maxDuration: timeout.None` to disable the cap for a task or run.
Configure OOM escalation: `retry: { outOfMemory: { machine: "large-1x" } }`, and throw the SDK's `OutOfMemoryError` when you detect OOM yourself.
Inspect limits at runtime with `ctx.run.maxDuration` and `usage.getCurrent().attempt.durationMs`.
Known gotchas
The default machine is small-1x (0.5 vCPU / 0.5GB) — heavier workloads OOM until you raise it.
When maxDuration is exceeded the run is stopped and the `cleanup`, `onSuccess` and `onFailure` hooks are NOT called — do not rely on them for cleanup.
maxDuration measures CPU time and excludes wait.for/wait.until/triggerAndWait/batchTriggerAndWait, so wall-clock runtime can far exceed it.
Use `timeout.None` explicitly to disable the cap; omitting the field falls back to the configured default.
OOM retries need explicit `retry.outOfMemory.machine` config — otherwise the retry lands on the same too-small machine.
Give your agent this knowledge — and 15,800+ more routes
One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?