Trigger.dev
Connect
Connect Trigger.dev from the terminal. Pass --help for the flags Trigger.dev accepts, plus --no-browser for headless environments.
polylane cloud connect --provider triggerdevAn environment secret key created with the "No restrictions" preset, from the environment's API Keys page.
- In Trigger.dev, open the environment's API Keys page and create a key with the "No restrictions" preset.
- Paste the key into Polylane and press Connect. The key names its own project and environment, so there is nothing else to type.
Polylane maps the environment, its deployment, tasks, schedules and queues. A task seen in runs but missing from the current version stays on the map and is flagged. Keys are encrypted and the agent never sees them.
Deploy and alert webhooks
Trigger.dev webhook alerts open an issue on a failed run and resolve deployment alerts on the next success. One alert per environment:
- On the environment's Alerts page, add a webhook alert with the URL from the account's Settings, under Webhooks, and the "Task run failure", "Deployment failure" and "Deployment success" events.
- Paste the signing secret Trigger.dev shows once into the same Webhooks card.
Troubleshooting
"Polylane needs a key created with the 'No restrictions' preset"
- Trigger only, Observer, Deploy only, Task operator and Variables only keys cannot be used: Polylane reads the project's identity through an endpoint only a "No restrictions" key can call. Create a "No restrictions" key in the environment's API Keys page and connect it.
"Trigger.dev did not recognize this key"
- Check the key was copied whole and has not been revoked.
"Dev keys only work while trigger dev runs" and "Preview keys are per branch and not supported"
- Use a prod or staging key.
Missing resources
- "Sync" from the account header refreshes before the next 15-minute pass.
Disconnecting
Disconnect in Polylane, then delete the key on the environment's API Keys page.
Connect Trigger.dev from a CI job or any other environment without a browser.
Connecting Trigger.dev needs no browser: the same endpoint the console calls fits in a CI job. One authenticated POST creates the connection and starts the first sync.
Prerequisites
- A Polylane API key with the
cloud_accounts:writeandcloud_accounts:readscopes. See API keys and OAuth. - Your workspace ID, which starts with
ws_. Read it fromGET /v1/workspaceswith the same key. - A Trigger.dev environment secret key (
tr_prod_sk_…ortr_stg_sk_…) from your project's prod or staging environment, under API Keys. Create it with the No restrictions preset: Polylane reads the project's identity through an endpoint only a "No restrictions" key can call, so Trigger only, Observer, Deploy only, Task operator and Variables only keys are refused, and so are dev and preview keys.
Create the connection
curl -X POST https://api.polylane.com/v1/cloud_accounts \
-H "x-api-key: $POLYLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "triggerdev",
"workspaceId": "ws_0abc123",
"apiKey": "<environment-secret-key>"
}'
The key names its own project and environment, and a key belongs to exactly one environment, so one call connects one environment: a prod key connects production and a staging key connects staging, each as its own account. Posting a key for an environment that is already connected replaces the account's key. There is no environment toggle to set. Connecting an environment is how you choose to watch it.
The response lists what was connected, with the first sync already running. Trimmed to the two fields the rest of the flow reads:
{
"success": true,
"result": {
"provider": "triggerdev",
"accounts": [{ "id": "acc_34gky74ibc92h8t2efn8csrh", "status": "syncing" }],
"failures": []
}
}
A key the API refuses lands in failures instead of accounts, with the message saying why, so repeating the call never duplicates a connection.
Wait for the first sync
Poll each returned account by its id until status reaches ready (new on registration, syncing while resources stream in):
until [ "$(curl -s "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY" | jq -r '.result.status')" = "ready" ]; do
sleep 15
done
Give the loop a deadline so a failed connect fails the job instead of hanging it. Once the account is ready, its resources are in the topology and Polylane has started its first check.
Disconnect from the API
Deleting the connection stops every sync and check and deletes the credentials Polylane held. The call needs the cloud_accounts:delete scope:
curl -X DELETE "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY"
Then revoke the Trigger.dev key on the provider side, as described under Disconnect below.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Trigger.dev's API lets it remove. The following stays until you remove it yourself:
- Trigger.dev webhook alert
polylane cloud disconnect <id>Tools
5Operations agents can perform in threads.
Supported resources
5Resource types that show up in your infrastructure graph.