Mandala
Tools

Trigger.dev

Trigger tasks and manage runs and schedules

Usage Instructions

Integrate Trigger.dev into the workflow. Trigger and batch trigger background tasks, retrieve and control runs (cancel, replay, reschedule, tags, metadata, events, traces), manage cron schedules, environment variables, queues, deployments, and waitpoint tokens, and query run data with TRQL.

Tools

trigger_dev_trigger_task

Trigger a Trigger.dev task by its identifier with an optional JSON payload. Returns the ID of the created run.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
taskIdentifierstringYesIdentifier of the task to trigger (e.g., "send-welcome-email")
payloadjsonNoJSON payload passed to the task run. Example: {"userId": "user_123"}
idempotencyKeystringNoIdempotency key that ensures the task is only triggered once per key
queuestringNoName of the queue to run the task on
concurrencyKeystringNoKey that scopes the queue concurrency limit (e.g., a user ID)
delaystringNoDelay before the run executes, as a duration ("30m", "1h", "2d") or an ISO 8601 date
ttlstringNoTime-to-live before an unstarted run expires, as a duration ("1h42m") or seconds
machinestringNoMachine preset for the run: micro, small-1x, small-2x, medium-1x, medium-2x, large-1x, or large-2x
tagsstringNoComma-separated tags to attach to the run (max 10, each under 128 characters)

Output

ParameterTypeDescription
idstringID of the run that was triggered (starts with run_)

trigger_dev_batch_trigger_task

Batch trigger a Trigger.dev task with up to 1,000 payloads. All items in the batch run the same task. Returns the batch ID and the created run IDs.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
taskIdentifierstringYesIdentifier of the task to batch trigger (e.g., "send-welcome-email")
itemsjsonYesJSON array of batch items (max 1,000). Each item is an object with a "payload" and optional "options" (queue, concurrencyKey, idempotencyKey, ttl, delay, tags, machine). Example: [{"payload": {"userId": "user_1"}}, {"payload": {"userId": "user_2"}, "options": {"delay": "1h"}}]

Output

ParameterTypeDescription
batchIdstringID of the batch that was triggered
runIdsarrayIDs of the runs created by the batch

trigger_dev_get_batch

Retrieve a Trigger.dev batch by its ID, including its status, run IDs, and success and failure counts.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
batchIdstringYesID of the batch to retrieve (starts with batch_)

Output

ParameterTypeDescription
idstringID of the batch (starts with batch_)
statusstringBatch status (PENDING, PROCESSING, COMPLETED, PARTIAL_FAILED, or ABORTED)
idempotencyKeystringIdempotency key provided when triggering the batch
createdAtstringISO timestamp when the batch was created
updatedAtstringISO timestamp when the batch was last updated
runCountnumberTotal number of runs in the batch
runIdsarrayIDs of the runs in the batch
successfulRunCountnumberNumber of successful runs, populated after completion
failedRunCountnumberNumber of failed runs, populated after completion
errorsarrayError details for failed items, present for PARTIAL_FAILED batches

trigger_dev_get_batch_results

Retrieve the execution results of every run in a Trigger.dev batch, including outputs and error details.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
batchIdstringYesID of the batch to retrieve results for (starts with batch_)

Output

ParameterTypeDescription
idstringID of the batch (starts with batch_)
itemsarrayExecution results for each run in the batch

trigger_dev_get_run

Retrieve a Trigger.dev run by its ID, including status, payload, output, attempts, and timing details.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to retrieve (starts with run_)

Output

ParameterTypeDescription
idstringUnique ID of the run (starts with run_)
statusstringRun status (PENDING_VERSION, DELAYED, QUEUED, EXECUTING, REATTEMPTING, FROZEN, COMPLETED, CANCELED, FAILED, CRASHED, INTERRUPTED, or SYSTEM_FAILURE)
taskIdentifierstringIdentifier of the task the run executes
versionstringWorker version the run executes on
idempotencyKeystringIdempotency key the run was triggered with
isTestbooleanWhether the run is a test run
createdAtstringISO timestamp when the run was created
updatedAtstringISO timestamp when the run was last updated
startedAtstringISO timestamp when the run started executing
finishedAtstringISO timestamp when the run finished
delayedUntilstringISO timestamp the run is delayed until
ttlstringTime-to-live before an unstarted run expires
expiredAtstringISO timestamp when the run expired
tagsarrayTags attached to the run
costInCentsnumberCompute cost of the run in cents
baseCostInCentsnumberBase invocation cost of the run in cents
durationMsnumberCompute duration of the run in milliseconds
envobjectEnvironment the run executes in
metadatajsonMetadata attached to the run
depthnumberDepth of the run in a parent-child run hierarchy
batchIdstringID of the batch the run belongs to, if batch-triggered
triggerFunctionstringFunction used to trigger the run (trigger, triggerAndWait, batchTrigger, or batchTriggerAndWait)
payloadjsonPayload the run was triggered with
payloadPresignedUrlstringPresigned URL to download the payload when it is too large to inline
outputjsonOutput returned by the run
outputPresignedUrlstringPresigned URL to download the output when it is too large to inline
scheduleobjectSchedule that triggered the run, if any
attemptsarrayAttempts made for the run
relatedRunsobjectRoot, parent, and child runs related to this run

trigger_dev_get_run_result

Retrieve the result of a Trigger.dev run: whether it succeeded, its output, and error details. Lighter than Get Run when only the outcome is needed.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to retrieve the result for (starts with run_)

Output

ParameterTypeDescription
okbooleanWhether the run completed successfully
idstringID of the run (starts with run_)
taskIdentifierstringIdentifier of the task the run executed
outputjsonOutput returned by the run, parsed when the output type is JSON
outputTypestringContent type of the serialized output (e.g., application/json)
errorjsonError details when the run failed
durationMsnumberDuration of the run in milliseconds

trigger_dev_get_run_events

Retrieve the log and span events of a Trigger.dev run, including messages, levels, durations, and error events.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to retrieve events for (starts with run_)

Output

ParameterTypeDescription
eventsarrayLog and span events recorded during the run

trigger_dev_get_run_trace

Retrieve the OpenTelemetry trace of a Trigger.dev run as a tree of spans with timing, errors, and nested children.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to retrieve the trace for (starts with run_)

Output

ParameterTypeDescription
traceIdstringOpenTelemetry trace ID of the run
rootSpanjsonRoot span of the trace; each span has id, parentId, runId, data (message, taskSlug, startTime, duration, isError, level, events), and recursively nested children spans

trigger_dev_list_runs

List Trigger.dev runs in the environment of the API key, with optional filters for status, task, version, tags, schedule, and creation time.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
statusstringNoComma-separated run statuses to filter by: PENDING_VERSION, DELAYED, QUEUED, EXECUTING, REATTEMPTING, FROZEN, COMPLETED, CANCELED, FAILED, CRASHED, INTERRUPTED, SYSTEM_FAILURE
taskIdentifierstringNoComma-separated task identifiers to filter by
versionstringNoComma-separated worker versions to filter by (e.g., "20240101.1")
tagstringNoComma-separated tags to filter by
schedulestringNoSchedule ID to filter by (starts with sched_)
isTeststringNoFilter by test runs: "true" for only test runs, "false" to exclude them
periodstringNoOnly return runs created in the given period (e.g., "1h", "7d")
fromstringNoOnly return runs created on or after this ISO 8601 timestamp
tostringNoOnly return runs created on or before this ISO 8601 timestamp
pageSizenumberNoNumber of runs per page (max 100, default 25)
pageAfterstringNoRun ID to start the page after, for forward pagination
pageBeforestringNoRun ID to start the page before, for backward pagination

Output

ParameterTypeDescription
runsarrayRuns matching the filters
paginationobjectCursor pagination details

trigger_dev_cancel_run

Cancel an in-progress Trigger.dev run. Has no effect if the run is already completed.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to cancel (starts with run_)

Output

ParameterTypeDescription
idstringID of the run that was canceled

trigger_dev_replay_run

Replay a Trigger.dev run, creating a new run with the same payload and options as the original.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to replay (starts with run_)

Output

ParameterTypeDescription
idstringID of the new run created by the replay

trigger_dev_reschedule_run

Reschedule a delayed Trigger.dev run with a new delay. Only valid while the run is in the DELAYED state.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the delayed run to reschedule (starts with run_)
delaystringYesNew delay for the run, as a duration ("30m", "1h", "2d") or an ISO 8601 date to delay until

Output

ParameterTypeDescription
idstringUnique ID of the run (starts with run_)
statusstringRun status (PENDING_VERSION, DELAYED, QUEUED, EXECUTING, REATTEMPTING, FROZEN, COMPLETED, CANCELED, FAILED, CRASHED, INTERRUPTED, or SYSTEM_FAILURE)
taskIdentifierstringIdentifier of the task the run executes
versionstringWorker version the run executes on
idempotencyKeystringIdempotency key the run was triggered with
isTestbooleanWhether the run is a test run
createdAtstringISO timestamp when the run was created
updatedAtstringISO timestamp when the run was last updated
startedAtstringISO timestamp when the run started executing
finishedAtstringISO timestamp when the run finished
delayedUntilstringISO timestamp the run is delayed until
ttlstringTime-to-live before an unstarted run expires
expiredAtstringISO timestamp when the run expired
tagsarrayTags attached to the run
costInCentsnumberCompute cost of the run in cents
baseCostInCentsnumberBase invocation cost of the run in cents
durationMsnumberCompute duration of the run in milliseconds
envobjectEnvironment the run executes in
metadatajsonMetadata attached to the run
depthnumberDepth of the run in a parent-child run hierarchy
batchIdstringID of the batch the run belongs to, if batch-triggered
triggerFunctionstringFunction used to trigger the run (trigger, triggerAndWait, batchTrigger, or batchTriggerAndWait)
payloadjsonPayload the run was triggered with
payloadPresignedUrlstringPresigned URL to download the payload when it is too large to inline
outputjsonOutput returned by the run
outputPresignedUrlstringPresigned URL to download the output when it is too large to inline
scheduleobjectSchedule that triggered the run, if any
attemptsarrayAttempts made for the run
relatedRunsobjectRoot, parent, and child runs related to this run

trigger_dev_add_run_tags

Add tags to an existing Trigger.dev run. Runs can have up to 10 tags.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to tag (starts with run_)
tagsstringYesComma-separated tags to add to the run (max 10 total, each under 128 characters)

Output

ParameterTypeDescription
messagestringConfirmation message for the added tags

trigger_dev_update_run_metadata

Replace the metadata of a Trigger.dev run with a new JSON object.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
runIdstringYesID of the run to update (starts with run_)
metadatajsonYesJSON object to set as the run metadata. Example: {"stage": "approved"}

Output

ParameterTypeDescription
metadatajsonThe updated metadata of the run

trigger_dev_create_schedule

Create an imperative cron schedule that triggers a Trigger.dev task on a recurring basis.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
taskstringYesIdentifier of the task to schedule (e.g., "daily-report")
cronstringYesCron expression defining when the task runs (e.g., "0 0 * * *")
timezonestringNoIANA timezone the cron expression is evaluated in (e.g., "America/New_York"). Defaults to UTC
externalIdstringNoExternal identifier to associate with the schedule (e.g., a user ID)
deduplicationKeystringYesKey that prevents duplicate schedules; creating again with the same key updates the existing schedule

Output

ParameterTypeDescription
idstringUnique ID of the schedule (starts with sched_)
taskstringIdentifier of the task the schedule triggers
typestringSchedule type (DECLARATIVE or IMPERATIVE)
activebooleanWhether the schedule is active
deduplicationKeystringDeduplication key of the schedule
externalIdstringExternal ID associated with the schedule
cronstringCron expression of the schedule
cronDescriptionstringHuman-readable description of the cron expression
timezonestringIANA timezone of the schedule
nextRunstringISO timestamp of the next scheduled run
environmentsarrayEnvironments the schedule runs in

trigger_dev_get_schedule

Retrieve a Trigger.dev schedule by its ID.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
scheduleIdstringYesID of the schedule to retrieve (starts with sched_)

Output

ParameterTypeDescription
idstringUnique ID of the schedule (starts with sched_)
taskstringIdentifier of the task the schedule triggers
typestringSchedule type (DECLARATIVE or IMPERATIVE)
activebooleanWhether the schedule is active
deduplicationKeystringDeduplication key of the schedule
externalIdstringExternal ID associated with the schedule
cronstringCron expression of the schedule
cronDescriptionstringHuman-readable description of the cron expression
timezonestringIANA timezone of the schedule
nextRunstringISO timestamp of the next scheduled run
environmentsarrayEnvironments the schedule runs in

trigger_dev_list_schedules

List Trigger.dev schedules in the project, with page-based pagination.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
pagenumberNoPage number to return (default 1)
perPagenumberNoNumber of schedules per page

Output

ParameterTypeDescription
schedulesarraySchedules in the project
paginationobjectPage-based pagination details

trigger_dev_update_schedule

Update an imperative Trigger.dev schedule by its ID, replacing its task, cron expression, timezone, and external ID.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
scheduleIdstringYesID of the schedule to update (starts with sched_)
taskstringYesIdentifier of the task the schedule triggers (e.g., "daily-report")
cronstringYesCron expression defining when the task runs (e.g., "0 0 * * *")
timezonestringNoIANA timezone the cron expression is evaluated in (e.g., "America/New_York"). Defaults to UTC
externalIdstringNoExternal identifier to associate with the schedule (e.g., a user ID)

Output

ParameterTypeDescription
idstringUnique ID of the schedule (starts with sched_)
taskstringIdentifier of the task the schedule triggers
typestringSchedule type (DECLARATIVE or IMPERATIVE)
activebooleanWhether the schedule is active
deduplicationKeystringDeduplication key of the schedule
externalIdstringExternal ID associated with the schedule
cronstringCron expression of the schedule
cronDescriptionstringHuman-readable description of the cron expression
timezonestringIANA timezone of the schedule
nextRunstringISO timestamp of the next scheduled run
environmentsarrayEnvironments the schedule runs in

trigger_dev_delete_schedule

Delete an imperative Trigger.dev schedule by its ID.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
scheduleIdstringYesID of the schedule to delete (starts with sched_)

Output

ParameterTypeDescription
deletedbooleanWhether the schedule was deleted
scheduleIdstringID of the schedule that was deleted

trigger_dev_activate_schedule

Activate an imperative Trigger.dev schedule so it resumes triggering its task.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
scheduleIdstringYesID of the schedule to activate (starts with sched_)

Output

ParameterTypeDescription
idstringUnique ID of the schedule (starts with sched_)
taskstringIdentifier of the task the schedule triggers
typestringSchedule type (DECLARATIVE or IMPERATIVE)
activebooleanWhether the schedule is active
deduplicationKeystringDeduplication key of the schedule
externalIdstringExternal ID associated with the schedule
cronstringCron expression of the schedule
cronDescriptionstringHuman-readable description of the cron expression
timezonestringIANA timezone of the schedule
nextRunstringISO timestamp of the next scheduled run
environmentsarrayEnvironments the schedule runs in

trigger_dev_deactivate_schedule

Deactivate an imperative Trigger.dev schedule so it stops triggering its task.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
scheduleIdstringYesID of the schedule to deactivate (starts with sched_)

Output

ParameterTypeDescription
idstringUnique ID of the schedule (starts with sched_)
taskstringIdentifier of the task the schedule triggers
typestringSchedule type (DECLARATIVE or IMPERATIVE)
activebooleanWhether the schedule is active
deduplicationKeystringDeduplication key of the schedule
externalIdstringExternal ID associated with the schedule
cronstringCron expression of the schedule
cronDescriptionstringHuman-readable description of the cron expression
timezonestringIANA timezone of the schedule
nextRunstringISO timestamp of the next scheduled run
environmentsarrayEnvironments the schedule runs in

trigger_dev_list_env_vars

List the environment variables of a Trigger.dev project environment. Values are returned in plaintext and will appear in workflow outputs and run history — scope this operation carefully.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
projectRefstringYesExternal ref of the project, from the project settings (starts with proj_)
environmentstringYesEnvironment to list variables for: dev, staging, or prod

Output

ParameterTypeDescription
variablesarrayEnvironment variables in the project environment

trigger_dev_create_env_var

Create an environment variable in a Trigger.dev project environment.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
projectRefstringYesExternal ref of the project, from the project settings (starts with proj_)
environmentstringYesEnvironment to create the variable in: dev, staging, or prod
namestringYesName of the environment variable (e.g., "SLACK_API_KEY")
valuestringYesValue of the environment variable

Output

ParameterTypeDescription
successbooleanWhether the environment variable was created
namestringName of the environment variable that was created

trigger_dev_get_env_var

Retrieve an environment variable from a Trigger.dev project environment. The value is returned in plaintext and will appear in workflow outputs and run history.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
projectRefstringYesExternal ref of the project, from the project settings (starts with proj_)
environmentstringYesEnvironment to read the variable from: dev, staging, or prod
namestringYesName of the environment variable (e.g., "SLACK_API_KEY")

Output

ParameterTypeDescription
namestringName of the environment variable
valuestringPlaintext value of the environment variable; appears in workflow outputs and run history

trigger_dev_update_env_var

Update the value of an environment variable in a Trigger.dev project environment.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
projectRefstringYesExternal ref of the project, from the project settings (starts with proj_)
environmentstringYesEnvironment the variable belongs to: dev, staging, or prod
namestringYesName of the environment variable to update (e.g., "SLACK_API_KEY")
valuestringYesNew value of the environment variable

Output

ParameterTypeDescription
successbooleanWhether the environment variable was updated
namestringName of the environment variable that was updated

trigger_dev_delete_env_var

Delete an environment variable from a Trigger.dev project environment.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
projectRefstringYesExternal ref of the project, from the project settings (starts with proj_)
environmentstringYesEnvironment the variable belongs to: dev, staging, or prod
namestringYesName of the environment variable to delete (e.g., "SLACK_API_KEY")

Output

ParameterTypeDescription
successbooleanWhether the environment variable was deleted
namestringName of the environment variable that was deleted

trigger_dev_import_env_vars

Upload multiple environment variables to a Trigger.dev project environment in one request.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
projectRefstringYesExternal ref of the project, from the project settings (starts with proj_)
environmentstringYesEnvironment to upload the variables to: dev, staging, or prod
variablesjsonYesJSON array of environment variables to upload. Example: [{"name": "SLACK_API_KEY", "value": "slack_123"}]
overridestringNoWhether to override existing variables: "true" or "false" (default false)

Output

ParameterTypeDescription
successbooleanWhether the environment variables were uploaded
countnumberNumber of environment variables submitted

trigger_dev_get_queue

Retrieve a Trigger.dev queue by ID, task identifier, or custom queue name, including its running and queued counts.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
queueNamestringYesQueue ID (starts with queue_), task identifier, or custom queue name, depending on the queue type
queueTypestringNoHow to interpret the queue name: "id" (default) for a queue ID, "task" for a task identifier, or "custom" for a custom queue name

Output

ParameterTypeDescription
idstringUnique ID of the queue (starts with queue_)
namestringName of the queue
typestringQueue type (task for task-default queues, custom for named queues)
runningnumberNumber of runs currently executing
queuednumberNumber of runs waiting in the queue
pausedbooleanWhether the queue is paused
concurrencyLimitnumberMaximum number of runs that can execute concurrently
concurrencyobjectConcurrency details for the queue

trigger_dev_list_queues

List the queues in the environment of the API key, including running and queued counts, with page-based pagination.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
pagenumberNoPage number to return (default 1)
perPagenumberNoNumber of queues per page

Output

ParameterTypeDescription
queuesarrayQueues in the environment
paginationobjectPage-based pagination details

trigger_dev_pause_queue

Pause a Trigger.dev queue so no new runs start. Runs that are currently executing continue to completion.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
queueNamestringYesQueue ID (starts with queue_), task identifier, or custom queue name, depending on the queue type
queueTypestringNoHow to interpret the queue name: "id" (default) for a queue ID, "task" for a task identifier, or "custom" for a custom queue name

Output

ParameterTypeDescription
idstringUnique ID of the queue (starts with queue_)
namestringName of the queue
typestringQueue type (task for task-default queues, custom for named queues)
runningnumberNumber of runs currently executing
queuednumberNumber of runs waiting in the queue
pausedbooleanWhether the queue is paused
concurrencyLimitnumberMaximum number of runs that can execute concurrently
concurrencyobjectConcurrency details for the queue

trigger_dev_resume_queue

Resume a paused Trigger.dev queue so new runs can start again.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
queueNamestringYesQueue ID (starts with queue_), task identifier, or custom queue name, depending on the queue type
queueTypestringNoHow to interpret the queue name: "id" (default) for a queue ID, "task" for a task identifier, or "custom" for a custom queue name

Output

ParameterTypeDescription
idstringUnique ID of the queue (starts with queue_)
namestringName of the queue
typestringQueue type (task for task-default queues, custom for named queues)
runningnumberNumber of runs currently executing
queuednumberNumber of runs waiting in the queue
pausedbooleanWhether the queue is paused
concurrencyLimitnumberMaximum number of runs that can execute concurrently
concurrencyobjectConcurrency details for the queue

trigger_dev_override_queue_concurrency

Override the concurrency limit of a Trigger.dev queue with a new value.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
queueNamestringYesQueue ID (starts with queue_), task identifier, or custom queue name, depending on the queue type
queueTypestringNoHow to interpret the queue name: "id" (default) for a queue ID, "task" for a task identifier, or "custom" for a custom queue name
concurrencyLimitnumberYesNew concurrency limit for the queue (0 to 100000)

Output

ParameterTypeDescription
idstringUnique ID of the queue (starts with queue_)
namestringName of the queue
typestringQueue type (task for task-default queues, custom for named queues)
runningnumberNumber of runs currently executing
queuednumberNumber of runs waiting in the queue
pausedbooleanWhether the queue is paused
concurrencyLimitnumberMaximum number of runs that can execute concurrently
concurrencyobjectConcurrency details for the queue

trigger_dev_reset_queue_concurrency

Reset the concurrency limit of a Trigger.dev queue back to its base value, removing any override.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
queueNamestringYesQueue ID (starts with queue_), task identifier, or custom queue name, depending on the queue type
queueTypestringNoHow to interpret the queue name: "id" (default) for a queue ID, "task" for a task identifier, or "custom" for a custom queue name

Output

ParameterTypeDescription
idstringUnique ID of the queue (starts with queue_)
namestringName of the queue
typestringQueue type (task for task-default queues, custom for named queues)
runningnumberNumber of runs currently executing
queuednumberNumber of runs waiting in the queue
pausedbooleanWhether the queue is paused
concurrencyLimitnumberMaximum number of runs that can execute concurrently
concurrencyobjectConcurrency details for the queue

trigger_dev_list_deployments

List Trigger.dev deployments in the environment of the API key, with optional status and creation-time filters.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
statusstringNoDeployment status to filter by: PENDING, BUILDING, DEPLOYING, DEPLOYED, FAILED, CANCELED, or TIMED_OUT
periodstringNoOnly return deployments created in the given period (e.g., "1h", "7d")
fromstringNoOnly return deployments created on or after this ISO 8601 timestamp
tostringNoOnly return deployments created on or before this ISO 8601 timestamp
pageSizenumberNoNumber of deployments per page (5 to 100, default 20)
pageAfterstringNoCursor to start the page after, from the previous response pagination

Output

ParameterTypeDescription
deploymentsarrayDeployments matching the filters
paginationobjectCursor pagination details

trigger_dev_get_deployment

Retrieve a Trigger.dev deployment by its ID, including its status, version, and registered tasks.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
deploymentIdstringYesID of the deployment to retrieve

Output

ParameterTypeDescription
idstringUnique ID of the deployment
statusstringDeployment status (PENDING, INSTALLING, BUILDING, DEPLOYING, DEPLOYED, FAILED, CANCELED, or TIMED_OUT)
versionstringDeployment version (e.g., "20250228.1")
shortCodestringShort code of the deployment
createdAtstringISO timestamp when the deployment was created
deployedAtstringISO timestamp when the deployment was promoted to DEPLOYED
runtimestringRuntime used by the deployment (e.g., "node")
runtimeVersionstringRuntime version of the deployment
gitjsonGit metadata associated with the deployment
errorjsonError details when the deployment failed
tasksarrayTasks registered by the deployed worker

trigger_dev_get_latest_deployment

Retrieve the latest Trigger.dev deployment in the environment of the API key.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)

Output

ParameterTypeDescription
idstringUnique ID of the deployment
statusstringDeployment status (PENDING, INSTALLING, BUILDING, DEPLOYING, DEPLOYED, FAILED, CANCELED, or TIMED_OUT)
versionstringDeployment version (e.g., "20250228.1")
shortCodestringShort code of the deployment
createdAtstringISO timestamp when the deployment was created
deployedAtstringISO timestamp when the deployment was promoted to DEPLOYED
runtimestringRuntime used by the deployment (e.g., "node")
runtimeVersionstringRuntime version of the deployment
gitjsonGit metadata associated with the deployment
errorjsonError details when the deployment failed
tasksarrayTasks registered by the deployed worker

trigger_dev_promote_deployment

Promote a Trigger.dev deployment version so new runs execute on it (e.g., to roll back to a previous version).

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
versionstringYesDeployment version to promote (e.g., "20250228.1")

Output

ParameterTypeDescription
idstringID of the promoted deployment
versionstringVersion of the promoted deployment
shortCodestringShort code of the promoted deployment

trigger_dev_execute_query

Execute a TRQL (SQL-like) query against Trigger.dev run data for reporting and analytics.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
querystringYesTRQL query to execute (e.g., "SELECT run_id, status, triggered_at FROM runs WHERE status = 'Failed' LIMIT 10")
scopestringNoScope of data to query: environment (default), project, or organization
periodstringNoTime period shorthand (e.g., "1h", "7d", "30d"). Cannot be combined with from/to
fromstringNoStart of the time range as an ISO 8601 timestamp. Must be used with "to"
tostringNoEnd of the time range as an ISO 8601 timestamp. Must be used with "from"
formatstringNoResponse format: "json" (default) for structured rows or "csv" for a CSV string

Output

ParameterTypeDescription
formatstringFormat of the results (json or csv)
resultsjsonQuery results: an array of row objects for json format, a CSV string for csv

trigger_dev_get_query_schema

Retrieve the TRQL query schema: the tables and columns available for Execute Query, with types and allowed values.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)

Output

ParameterTypeDescription
tablesarrayTables that can be queried with TRQL

trigger_dev_create_waitpoint_token

Create a Trigger.dev waitpoint token that a task can wait on until it is completed from outside (e.g., a human approval).

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
timeoutstringNoHow long before the token times out, as a duration ("30s", "1m", "2h", "3d") or an ISO 8601 date
idempotencyKeystringNoIdempotency key; passing the same key before it expires returns the original token
idempotencyKeyTTLstringNoHow long the idempotency key is valid, as a duration ("30s", "1m", "2h", "3d")
tagsstringNoComma-separated tags to attach to the waitpoint (max 10, each under 128 characters)

Output

ParameterTypeDescription
idstringUnique ID of the waitpoint token (starts with waitpoint_)
isCachedbooleanWhether an existing token was returned because the same idempotency key was reused
urlstringHTTP callback URL; a POST request to this URL completes the waitpoint without an API key

trigger_dev_complete_waitpoint_token

Complete a Trigger.dev waitpoint token, resuming any task waiting on it and passing it optional JSON data.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
waitpointIdstringYesID of the waitpoint token to complete (starts with waitpoint_)
datajsonNoJSON data passed back to the waiting run as the token result. Example: {"status": "approved"}

Output

ParameterTypeDescription
successbooleanWhether the waitpoint token was completed

trigger_dev_get_waitpoint_token

Retrieve a Trigger.dev waitpoint token by its ID, including its status, timeout, and completion data.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
waitpointIdstringYesID of the waitpoint token to retrieve (starts with waitpoint_)

Output

ParameterTypeDescription
idstringUnique ID of the waitpoint token (starts with waitpoint_)
urlstringHTTP callback URL; a POST request to this URL completes the waitpoint without an API key
statusstringStatus of the waitpoint token (WAITING, COMPLETED, or TIMED_OUT)
idempotencyKeystringIdempotency key used when creating the token
idempotencyKeyExpiresAtstringISO timestamp when the idempotency key expires
timeoutAtstringISO timestamp when the token times out
completedAtstringISO timestamp when the token was completed
outputjsonData passed when completing the token, parsed when the output type is JSON
outputTypestringContent type of the serialized output (e.g., application/json)
outputIsErrorbooleanWhether the output represents an error (e.g., a timeout)
tagsarrayTags attached to the waitpoint
createdAtstringISO timestamp when the token was created

trigger_dev_list_waitpoint_tokens

List Trigger.dev waitpoint tokens in the environment of the API key, with optional status, tag, and creation-time filters.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
statusstringNoWaitpoint status to filter by: WAITING, COMPLETED, or TIMED_OUT
idempotencyKeystringNoIdempotency key to filter by
tagsstringNoComma-separated tags to filter by
periodstringNoOnly return tokens created in the given period (e.g., "1h", "7d")
fromstringNoOnly return tokens created on or after this ISO 8601 timestamp
tostringNoOnly return tokens created on or before this ISO 8601 timestamp
pageSizenumberNoNumber of tokens per page (max 100)
pageAfterstringNoWaitpoint ID to start the page after, for forward pagination
pageBeforestringNoWaitpoint ID to start the page before, for backward pagination

Output

ParameterTypeDescription
tokensarrayWaitpoint tokens matching the filters
paginationobjectCursor pagination details

trigger_dev_list_timezones

List the IANA timezones supported by Trigger.dev schedules, for use as the timezone of a cron schedule.

Input

ParameterTypeRequiredDescription
apiKeystringYesTrigger.dev secret API key (starts with tr_)
excludeUtcstringNoSet to "true" to exclude UTC from the returned timezones

Output

ParameterTypeDescription
timezonesarrayIANA timezones supported by schedules

Notes

  • Category: tools
  • Type: trigger_dev
On this page

On this page

Usage Instructions
Tools
trigger_dev_trigger_task
Input
Output
trigger_dev_batch_trigger_task
Input
Output
trigger_dev_get_batch
Input
Output
trigger_dev_get_batch_results
Input
Output
trigger_dev_get_run
Input
Output
trigger_dev_get_run_result
Input
Output
trigger_dev_get_run_events
Input
Output
trigger_dev_get_run_trace
Input
Output
trigger_dev_list_runs
Input
Output
trigger_dev_cancel_run
Input
Output
trigger_dev_replay_run
Input
Output
trigger_dev_reschedule_run
Input
Output
trigger_dev_add_run_tags
Input
Output
trigger_dev_update_run_metadata
Input
Output
trigger_dev_create_schedule
Input
Output
trigger_dev_get_schedule
Input
Output
trigger_dev_list_schedules
Input
Output
trigger_dev_update_schedule
Input
Output
trigger_dev_delete_schedule
Input
Output
trigger_dev_activate_schedule
Input
Output
trigger_dev_deactivate_schedule
Input
Output
trigger_dev_list_env_vars
Input
Output
trigger_dev_create_env_var
Input
Output
trigger_dev_get_env_var
Input
Output
trigger_dev_update_env_var
Input
Output
trigger_dev_delete_env_var
Input
Output
trigger_dev_import_env_vars
Input
Output
trigger_dev_get_queue
Input
Output
trigger_dev_list_queues
Input
Output
trigger_dev_pause_queue
Input
Output
trigger_dev_resume_queue
Input
Output
trigger_dev_override_queue_concurrency
Input
Output
trigger_dev_reset_queue_concurrency
Input
Output
trigger_dev_list_deployments
Input
Output
trigger_dev_get_deployment
Input
Output
trigger_dev_get_latest_deployment
Input
Output
trigger_dev_promote_deployment
Input
Output
trigger_dev_execute_query
Input
Output
trigger_dev_get_query_schema
Input
Output
trigger_dev_create_waitpoint_token
Input
Output
trigger_dev_complete_waitpoint_token
Input
Output
trigger_dev_get_waitpoint_token
Input
Output
trigger_dev_list_waitpoint_tokens
Input
Output
trigger_dev_list_timezones
Input
Output
Notes
Trigger.dev