Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Trigger.dev

Scalekit connector
Open markdown

The Trigger.dev connector lets your AI agent act in each user's Trigger.dev account. Each user connects their own Trigger.dev access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 59 tools.

Tools
59
What they doRead · write · destructive
28 · 28 · 328 read28 write3 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Trigger.dev connection

    In AgentKit > Connections, create a Trigger.dev connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'triggerdev'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Trigger.dev:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'triggerdev_get_latest_deployment',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Trigger.dev credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • triggerdev_execute_queryRun a TRQL (Trigger.dev Query Language) query, a SQL-style language, against run data to analyze runs and calculate metrics.Read-only

    Execute TRQL Query

    Run a TRQL (Trigger.dev Query Language) query, a SQL-style language, against run data to analyze runs and calculate metrics. Returns the result rows as JSON, or a CSV string when format is csv. Use get_query_schema first to see the tables and columns you can query.

    Inputs

    querystringrequired
    The TRQL query to run.
    formatstring
    Response format: json (default) or csv.one of jsoncsv
    fromstring
    Start of the time range as an ISO 8601 timestamp. Use together with to.
    periodstring
    Relative time range such as 7d, 30d or 1h. Do not combine with from and to.
    scopestring
    Scope of data to query: environment (default), project or organization.one of environmentprojectorganization
    tostring
    End of the time range as an ISO 8601 timestamp. Use together with from.
  • triggerdev_get_batchRetrieve a batch by id with its status and the ids of all runs in it.Read-only

    Get Batch

    Retrieve a batch by id with its status and the ids of all runs in it. Returns status, run counts, run ids and any errors. Use get_batch_results for the outputs of the finished runs.

    Inputs

    batch_idstringrequired
    ID of the batch, starting with batch_.
  • triggerdev_get_batch_resultsRetrieve the execution results of the finished runs in a batch.Read-only

    Get Batch Results

    Retrieve the execution results of the finished runs in a batch. Runs still executing are left out. Returns the batch id and an items array of run results. Use get_batch to see overall batch progress.

    Inputs

    batch_idstringrequired
    ID of the batch, starting with batch_.
  • triggerdev_get_bulk_actionRetrieve the status and aggregate processing counts of a bulk action.Read-only

    Get Bulk Action

    Retrieve the status and aggregate processing counts of a bulk action. Returns status, type and success and failure counts. Use list_bulk_actions to find ids.

    Inputs

    bulk_action_idstringrequired
    ID of the bulk action, starting with bulk_.
  • triggerdev_get_concurrency_limitRetrieve a concurrency limit by name with its bounds and live running and queued counts.Read-only

    Get Concurrency Limit

    Retrieve a concurrency limit by name with its bounds and live running and queued counts. With concurrency_key it returns the view for that key: its per-key bound, any override and the runs executing for the key. Use list_concurrency_limits to find names.

    Inputs

    namestringrequired
    Name of the concurrency limit.
    concurrency_keystring
    Return the view for this concurrency key instead of the whole limit.
  • triggerdev_get_deploymentRetrieve one deployment by id.Read-only

    Get Deployment

    Retrieve one deployment by id. Returns its version, status, timestamps and the tasks it registered. Use list_deployments to find deployment ids.

    Inputs

    deployment_idstringrequired
    ID of the deployment.
  • triggerdev_get_env_varRetrieve one environment variable of a project environment by name.Read-only

    Get Environment Variable

    Retrieve one environment variable of a project environment by name. Returns the variable value. Use list_env_vars to see all variables.

    Inputs

    envstringrequired
    Environment slug: dev, staging, prod or preview.
    namestringrequired
    Name of the environment variable.
    project_refstringrequired
    Project reference, starting with proj_ (shown in the dashboard project settings). Required for environment variable endpoints.
  • triggerdev_get_errorRetrieve one error group with its lifecycle state and the worker versions it affected.Read-only

    Get Error

    Retrieve one error group with its lifecycle state and the worker versions it affected. Returns the error details and occurrence data. Use list_errors to find error ids.

    Inputs

    error_idstringrequired
    ID of the error group, starting with error_.