Skip to content

Commit 95dd3ee

Browse files
committed
improvement(integrations): address Trigger.dev review feedback
Reads the delete schedule response instead of hardcoding success, and adds explicit plaintext-secret warnings to the env var read operations and docs.
1 parent f49784d commit 95dd3ee

5 files changed

Lines changed: 34 additions & 13 deletions

File tree

apps/docs/content/docs/en/integrations/trigger_dev.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ With Trigger.dev, you can:
2323
- **Control queues**: Inspect queue depth and concurrency, and pause or resume queues during incidents
2424

2525
In Sim, the Trigger.dev integration lets your agents drive this entire lifecycle. An agent can trigger a deployed task with a payload, poll the run until it completes and use its output downstream, monitor for failed runs and replay the transient ones, manage per-customer cron schedules, and pause a queue when something goes wrong. Connect it with a project-scoped secret API key (starts with `tr_`) — the key determines which environment the runs, schedules, and queues belong to. This makes Sim a natural control plane for the background jobs that power your product.
26+
27+
Note: the environment variable operations (List Env Vars, Get Env Var) return variable values in plaintext, and those values appear in workflow outputs and run history. Scope workflows that read environment variables carefully.
2628
{/* MANUAL-CONTENT-END */}
2729

2830

@@ -959,7 +961,7 @@ Deactivate an imperative Trigger.dev schedule so it stops triggering its task.
959961

960962
### `trigger_dev_list_env_vars`
961963

962-
List the environment variables of a Trigger.dev project environment, including their values.
964+
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.
963965

964966
#### Input
965967

@@ -975,7 +977,7 @@ List the environment variables of a Trigger.dev project environment, including t
975977
| --------- | ---- | ----------- |
976978
| `variables` | array | Environment variables in the project environment |
977979
|`name` | string | Name of the environment variable |
978-
|`value` | string | Value of the environment variable |
980+
|`value` | string | Plaintext value of the environment variable; appears in workflow outputs and run history |
979981

980982
### `trigger_dev_create_env_var`
981983

@@ -1000,7 +1002,7 @@ Create an environment variable in a Trigger.dev project environment.
10001002

10011003
### `trigger_dev_get_env_var`
10021004

1003-
Retrieve an environment variable from a Trigger.dev project environment.
1005+
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.
10041006

10051007
#### Input
10061008

@@ -1016,7 +1018,7 @@ Retrieve an environment variable from a Trigger.dev project environment.
10161018
| Parameter | Type | Description |
10171019
| --------- | ---- | ----------- |
10181020
| `name` | string | Name of the environment variable |
1019-
| `value` | string | Value of the environment variable |
1021+
| `value` | string | Plaintext value of the environment variable; appears in workflow outputs and run history |
10201022

10211023
### `trigger_dev_update_env_var`
10221024

apps/sim/lib/integrations/integrations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14904,15 +14904,15 @@
1490414904
},
1490514905
{
1490614906
"name": "List Env Vars",
14907-
"description": "List the environment variables of a Trigger.dev project environment, including their values."
14907+
"description": "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."
1490814908
},
1490914909
{
1491014910
"name": "Create Env Var",
1491114911
"description": "Create an environment variable in a Trigger.dev project environment."
1491214912
},
1491314913
{
1491414914
"name": "Get Env Var",
14915-
"description": "Retrieve an environment variable from a Trigger.dev project environment."
14915+
"description": "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."
1491614916
},
1491714917
{
1491814918
"name": "Update Env Var",

apps/sim/tools/trigger_dev/delete_schedule.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ export const triggerDevDeleteScheduleTool: ToolConfig<
3636
headers: (params) => buildTriggerDevHeaders(params.apiKey),
3737
},
3838

39-
transformResponse: async (_response, params) => {
39+
transformResponse: async (response, params) => {
40+
const text = await response.text()
41+
let deleted = response.ok
42+
if (text) {
43+
try {
44+
const data = JSON.parse(text)
45+
if (typeof data.success === 'boolean') deleted = data.success
46+
} catch {
47+
deleted = response.ok
48+
}
49+
}
4050
return {
41-
success: true,
51+
success: deleted,
4252
output: {
43-
deleted: true,
53+
deleted,
4454
scheduleId: params?.scheduleId ?? '',
4555
},
4656
}

apps/sim/tools/trigger_dev/get_env_var.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const triggerDevGetEnvVarTool: ToolConfig<
1111
> = {
1212
id: 'trigger_dev_get_env_var',
1313
name: 'Trigger.dev Get Env Var',
14-
description: 'Retrieve an environment variable from a Trigger.dev project environment.',
14+
description:
15+
'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.',
1516
version: '1.0.0',
1617

1718
params: {
@@ -60,6 +61,10 @@ export const triggerDevGetEnvVarTool: ToolConfig<
6061

6162
outputs: {
6263
name: { type: 'string', description: 'Name of the environment variable' },
63-
value: { type: 'string', description: 'Value of the environment variable' },
64+
value: {
65+
type: 'string',
66+
description:
67+
'Plaintext value of the environment variable; appears in workflow outputs and run history',
68+
},
6469
},
6570
}

apps/sim/tools/trigger_dev/list_env_vars.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const triggerDevListEnvVarsTool: ToolConfig<
1212
id: 'trigger_dev_list_env_vars',
1313
name: 'Trigger.dev List Env Vars',
1414
description:
15-
'List the environment variables of a Trigger.dev project environment, including their values.',
15+
'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.',
1616
version: '1.0.0',
1717

1818
params: {
@@ -65,7 +65,11 @@ export const triggerDevListEnvVarsTool: ToolConfig<
6565
description: 'Environment variable',
6666
properties: {
6767
name: { type: 'string', description: 'Name of the environment variable' },
68-
value: { type: 'string', description: 'Value of the environment variable' },
68+
value: {
69+
type: 'string',
70+
description:
71+
'Plaintext value of the environment variable; appears in workflow outputs and run history',
72+
},
6973
},
7074
},
7175
},

0 commit comments

Comments
 (0)