library: { name: "@trigger.dev/sdk", versions: ">=3 <5" } and reads v3 and v4, including imports from @trigger.dev/sdk/v3. It only narrates files that import the SDK or belong to a package that depends on it (see Dependency detection), and even then it leaves alone calls on objects that don’t come from the SDK, such as a jQuery trigger or a local array named runs.
Examples
A task with retries and hooks
English
A scheduled task
English
Triggering tasks
English
task(...) call. Tasks imported from elsewhere are recognized when their name ends in Task, as in sendWelcomeTask, or when they are triggered by ID through tasks.trigger.
What it covers
- Tasks:
taskandschemaTaskwithretry,queue,machineandmaxDuration, and the lifecycle hooks (onStartAttempt,onSuccess,onFailure,catchErrorand the rest). - Scheduled tasks:
schedules.taskwith a cron pattern, time zone and environments, and theschedulesAPI for creating and managing schedules. - Queues:
queue()with its concurrency limit, and on-demand queues in v3. - Triggering:
trigger,triggerAndWaitandunwrap,batchTriggerandbatch,tasks.triggerby ID, and options such asdelay,ttl,tags,priority,concurrencyKeyand idempotency keys. - Inside a run:
wait.for,wait.until, wait tokens,retry.onThrow,AbortTaskRunError, run metadata (including the parent and root run’s),idempotencyKeysandruns.
Translating
The English phrasebook is exported asen and typed as TriggerPhrases. Its time section has the same shape as the other job plugins’ (TimePhrases).