Skip to content

Commit 9e5f989

Browse files
committed
Run workflow improvements
1 parent 4d24abd commit 9e5f989

9 files changed

Lines changed: 755 additions & 53 deletions

File tree

apps/sim/lib/copilot/generated/tool-catalog-v1.ts

Lines changed: 57 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface ToolCatalogEntry {
4646
| 'get_page_contents'
4747
| 'get_platform_actions'
4848
| 'get_workflow_data'
49+
| 'get_workflow_run_options'
4950
| 'glob'
5051
| 'grep'
5152
| 'job'
@@ -145,6 +146,7 @@ export interface ToolCatalogEntry {
145146
| 'get_page_contents'
146147
| 'get_platform_actions'
147148
| 'get_workflow_data'
149+
| 'get_workflow_run_options'
148150
| 'glob'
149151
| 'grep'
150152
| 'job'
@@ -2012,6 +2014,22 @@ export const GetWorkflowData: ToolCatalogEntry = {
20122014
},
20132015
}
20142016

2017+
export const GetWorkflowRunOptions: ToolCatalogEntry = {
2018+
id: 'get_workflow_run_options',
2019+
name: 'get_workflow_run_options',
2020+
route: 'sim',
2021+
mode: 'async',
2022+
parameters: {
2023+
type: 'object',
2024+
properties: {
2025+
workflowId: {
2026+
type: 'string',
2027+
description: 'Optional workflow ID. If not provided, uses the current workflow in context.',
2028+
},
2029+
},
2030+
},
2031+
}
2032+
20152033
export const Glob: ToolCatalogEntry = {
20162034
id: 'glob',
20172035
name: 'glob',
@@ -2067,9 +2085,13 @@ export const Grep: ToolCatalogEntry = {
20672085
path: {
20682086
type: 'string',
20692087
description:
2070-
"Optional path prefix to scope the search (e.g. 'workflows/', 'environment/', 'internal/', 'components/blocks/').",
2088+
"Optional scope. A prefix (e.g. 'workflows/', 'environment/', 'internal/') searches the VFS map under it. An exact single-file path under files/ or uploads/ (optionally with /content) searches that file's content only; folders and multi-file trees are rejected for content search.",
2089+
},
2090+
pattern: {
2091+
type: 'string',
2092+
description:
2093+
"Regex pattern to search for. Searches VFS map entries (workflow JSON, metadata, plans, memories) by default; searches a single file's extracted text when path is one files/ or uploads/ file leaf.",
20712094
},
2072-
pattern: { type: 'string', description: 'Regex pattern to search for in file contents.' },
20732095
toolTitle: {
20742096
type: 'string',
20752097
description:
@@ -2246,7 +2268,7 @@ export const KnowledgeBase: ToolCatalogEntry = {
22462268
workspaceId: {
22472269
type: 'string',
22482270
description:
2249-
"Workspace ID. Required for 'create' when there is no workspace in context (otherwise the current workspace context is used); optional filter for 'list'.",
2271+
"Workspace ID. Required for 'create' when there is no workspace in context; otherwise the current workspace context is used.",
22502272
},
22512273
},
22522274
},
@@ -2659,23 +2681,13 @@ export const MaterializeFile: ToolCatalogEntry = {
26592681
'The names of the uploaded files to materialize (e.g. ["report.pdf", "data.csv"])',
26602682
items: { type: 'string' },
26612683
},
2662-
knowledgeBaseId: {
2663-
type: 'string',
2664-
description:
2665-
'ID of an existing knowledge base to add the file to (only used with operation "knowledge_base"). If omitted, a new KB is created.',
2666-
},
26672684
operation: {
26682685
type: 'string',
26692686
description:
2670-
'What to do with the file. "save" promotes it to files/. "import" imports a workflow JSON. "table" converts CSV/TSV/JSON to a table. "knowledge_base" saves and adds to a KB. Defaults to "save".',
2671-
enum: ['save', 'import', 'table', 'knowledge_base'],
2687+
'What to do with the file. "save" promotes it to a permanent files/ path. "import" imports a workflow JSON as a workspace workflow. Defaults to "save".',
2688+
enum: ['save', 'import'],
26722689
default: 'save',
26732690
},
2674-
tableName: {
2675-
type: 'string',
2676-
description:
2677-
'Custom name for the table (only used with operation "table"). Defaults to the file name without extension.',
2678-
},
26792691
},
26802692
required: ['fileNames'],
26812693
},
@@ -2837,7 +2849,8 @@ export const OpenResource: ToolCatalogEntry = {
28372849
id: { type: 'string', description: 'Canonical resource ID for non-file resources.' },
28382850
path: {
28392851
type: 'string',
2840-
description: 'Canonical VFS path for type "file", e.g. "files/Reports/report.pdf".',
2852+
description:
2853+
'Encoded VFS path for type "file" (percent-encoded per segment, e.g. "files/Reports/Q4%20Report.pdf"). Copy it verbatim from glob/read/workspace context output — do not decode it to a display name or re-encode it.',
28412854
},
28422855
type: {
28432856
type: 'string',
@@ -3000,7 +3013,7 @@ export const Read: ToolCatalogEntry = {
30003013
path: {
30013014
type: 'string',
30023015
description:
3003-
"Path to the file to read (e.g. 'workflows/My%20Workflow/state.json' or 'workflows/Projects/Q1/My%20Workflow/state.json').",
3016+
"Path to the VFS resource to read (e.g. 'workflows/My%20Workflow/state.json', 'files/Q4%20Report.pdf/content' for file bytes/parsed text, or 'uploads/data.csv' for a chat upload). Copy paths verbatim from glob/grep/read output.",
30043017
},
30053018
},
30063019
required: ['path'],
@@ -3295,24 +3308,35 @@ export const RunWorkflow: ToolCatalogEntry = {
32953308
parameters: {
32963309
type: 'object',
32973310
properties: {
3311+
inputFromExecutionId: {
3312+
type: 'string',
3313+
description:
3314+
'Reuse the recorded input from a past execution of this workflow (from query_logs) instead of supplying workflow_input — handy for replaying a run without retyping inputs. The reused input is re-validated against the trigger. Mutually exclusive with workflow_input and useMockPayload.',
3315+
},
32983316
triggerBlockId: {
32993317
type: 'string',
33003318
description:
3301-
'Optional trigger block ID when the workflow has multiple entrypoints and you need to target a specific one.',
3319+
'Trigger block ID to run from (from get_workflow_run_options). Required when the workflow has multiple entrypoints.',
33023320
},
33033321
useDeployedState: {
33043322
type: 'boolean',
33053323
description:
33063324
'When true, runs the deployed version instead of the live draft. Default: false (draft).',
33073325
},
3326+
useMockPayload: {
3327+
type: 'boolean',
3328+
description:
3329+
"When true, run with the trigger's generated mock payload instead of workflow_input. Prefer building your own workflow_input; use this only when you can't.",
3330+
},
33083331
workflowId: {
33093332
type: 'string',
33103333
description:
33113334
'Optional workflow ID to run. If not provided, uses the current workflow in context.',
33123335
},
33133336
workflow_input: {
33143337
type: 'object',
3315-
description: 'JSON object with key-value mappings where each key is an input field name',
3338+
description:
3339+
"JSON object matching the target trigger's inputSchema (from get_workflow_run_options). For external/webhook triggers this is the event payload; for API/Input triggers it is the form fields.",
33163340
},
33173341
},
33183342
},
@@ -3328,28 +3352,39 @@ export const RunWorkflowUntilBlock: ToolCatalogEntry = {
33283352
parameters: {
33293353
type: 'object',
33303354
properties: {
3355+
inputFromExecutionId: {
3356+
type: 'string',
3357+
description:
3358+
'Reuse the recorded input from a past execution of this workflow (from query_logs) instead of supplying workflow_input. The reused input is re-validated against the trigger. Mutually exclusive with workflow_input and useMockPayload.',
3359+
},
33313360
stopAfterBlockId: {
33323361
type: 'string',
33333362
description: 'The block ID to stop after. Execution halts once this block completes.',
33343363
},
33353364
triggerBlockId: {
33363365
type: 'string',
33373366
description:
3338-
'Optional trigger block ID when the workflow has multiple entrypoints and you need to target a specific one.',
3367+
'Trigger block ID to run from (from get_workflow_run_options). Required when the workflow has multiple entrypoints.',
33393368
},
33403369
useDeployedState: {
33413370
type: 'boolean',
33423371
description:
33433372
'When true, runs the deployed version instead of the live draft. Default: false (draft).',
33443373
},
3374+
useMockPayload: {
3375+
type: 'boolean',
3376+
description:
3377+
"When true, run with the trigger's generated mock payload instead of workflow_input. Prefer building your own workflow_input; use this only when you can't.",
3378+
},
33453379
workflowId: {
33463380
type: 'string',
33473381
description:
33483382
'Optional workflow ID to run. If not provided, uses the current workflow in context.',
33493383
},
33503384
workflow_input: {
33513385
type: 'object',
3352-
description: 'JSON object with key-value mappings where each key is an input field name',
3386+
description:
3387+
"JSON object matching the target trigger's inputSchema (from get_workflow_run_options). For external/webhook triggers this is the event payload; for API/Input triggers it is the form fields.",
33533388
},
33543389
},
33553390
required: ['stopAfterBlockId'],
@@ -4368,8 +4403,6 @@ export const ManageSkillOperationValues = [
43684403
export const MaterializeFileOperation = {
43694404
save: 'save',
43704405
import: 'import',
4371-
table: 'table',
4372-
knowledgeBase: 'knowledge_base',
43734406
} as const
43744407

43754408
export type MaterializeFileOperation =
@@ -4378,8 +4411,6 @@ export type MaterializeFileOperation =
43784411
export const MaterializeFileOperationValues = [
43794412
MaterializeFileOperation.save,
43804413
MaterializeFileOperation.import,
4381-
MaterializeFileOperation.table,
4382-
MaterializeFileOperation.knowledgeBase,
43834414
] as const
43844415

43854416
export const UserMemoryOperation = {
@@ -4525,6 +4556,7 @@ export const TOOL_CATALOG: Record<string, ToolCatalogEntry> = {
45254556
[GetPageContents.id]: GetPageContents,
45264557
[GetPlatformActions.id]: GetPlatformActions,
45274558
[GetWorkflowData.id]: GetWorkflowData,
4559+
[GetWorkflowRunOptions.id]: GetWorkflowRunOptions,
45284560
[Glob.id]: Glob,
45294561
[Grep.id]: Grep,
45304562
[Job.id]: Job,

apps/sim/lib/copilot/generated/tool-schemas-v1.ts

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,19 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18091809
},
18101810
resultSchema: undefined,
18111811
},
1812+
get_workflow_run_options: {
1813+
parameters: {
1814+
type: 'object',
1815+
properties: {
1816+
workflowId: {
1817+
type: 'string',
1818+
description:
1819+
'Optional workflow ID. If not provided, uses the current workflow in context.',
1820+
},
1821+
},
1822+
},
1823+
resultSchema: undefined,
1824+
},
18121825
glob: {
18131826
parameters: {
18141827
type: 'object',
@@ -1859,11 +1872,12 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18591872
path: {
18601873
type: 'string',
18611874
description:
1862-
"Optional path prefix to scope the search (e.g. 'workflows/', 'environment/', 'internal/', 'components/blocks/').",
1875+
"Optional scope. A prefix (e.g. 'workflows/', 'environment/', 'internal/') searches the VFS map under it. An exact single-file path under files/ or uploads/ (optionally with /content) searches that file's content only; folders and multi-file trees are rejected for content search.",
18631876
},
18641877
pattern: {
18651878
type: 'string',
1866-
description: 'Regex pattern to search for in file contents.',
1879+
description:
1880+
"Regex pattern to search for. Searches VFS map entries (workflow JSON, metadata, plans, memories) by default; searches a single file's extracted text when path is one files/ or uploads/ file leaf.",
18671881
},
18681882
toolTitle: {
18691883
type: 'string',
@@ -2045,7 +2059,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
20452059
workspaceId: {
20462060
type: 'string',
20472061
description:
2048-
"Workspace ID. Required for 'create' when there is no workspace in context (otherwise the current workspace context is used); optional filter for 'list'.",
2062+
"Workspace ID. Required for 'create' when there is no workspace in context; otherwise the current workspace context is used.",
20492063
},
20502064
},
20512065
},
@@ -2455,23 +2469,13 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
24552469
type: 'string',
24562470
},
24572471
},
2458-
knowledgeBaseId: {
2459-
type: 'string',
2460-
description:
2461-
'ID of an existing knowledge base to add the file to (only used with operation "knowledge_base"). If omitted, a new KB is created.',
2462-
},
24632472
operation: {
24642473
type: 'string',
24652474
description:
2466-
'What to do with the file. "save" promotes it to files/. "import" imports a workflow JSON. "table" converts CSV/TSV/JSON to a table. "knowledge_base" saves and adds to a KB. Defaults to "save".',
2467-
enum: ['save', 'import', 'table', 'knowledge_base'],
2475+
'What to do with the file. "save" promotes it to a permanent files/ path. "import" imports a workflow JSON as a workspace workflow. Defaults to "save".',
2476+
enum: ['save', 'import'],
24682477
default: 'save',
24692478
},
2470-
tableName: {
2471-
type: 'string',
2472-
description:
2473-
'Custom name for the table (only used with operation "table"). Defaults to the file name without extension.',
2474-
},
24752479
},
24762480
required: ['fileNames'],
24772481
},
@@ -2605,7 +2609,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
26052609
},
26062610
path: {
26072611
type: 'string',
2608-
description: 'Canonical VFS path for type "file", e.g. "files/Reports/report.pdf".',
2612+
description:
2613+
'Encoded VFS path for type "file" (percent-encoded per segment, e.g. "files/Reports/Q4%20Report.pdf"). Copy it verbatim from glob/read/workspace context output — do not decode it to a display name or re-encode it.',
26092614
},
26102615
type: {
26112616
type: 'string',
@@ -2771,7 +2776,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
27712776
path: {
27722777
type: 'string',
27732778
description:
2774-
"Path to the file to read (e.g. 'workflows/My%20Workflow/state.json' or 'workflows/Projects/Q1/My%20Workflow/state.json').",
2779+
"Path to the VFS resource to read (e.g. 'workflows/My%20Workflow/state.json', 'files/Q4%20Report.pdf/content' for file bytes/parsed text, or 'uploads/data.csv' for a chat upload). Copy paths verbatim from glob/grep/read output.",
27752780
},
27762781
},
27772782
required: ['path'],
@@ -3055,24 +3060,35 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
30553060
parameters: {
30563061
type: 'object',
30573062
properties: {
3063+
inputFromExecutionId: {
3064+
type: 'string',
3065+
description:
3066+
'Reuse the recorded input from a past execution of this workflow (from query_logs) instead of supplying workflow_input — handy for replaying a run without retyping inputs. The reused input is re-validated against the trigger. Mutually exclusive with workflow_input and useMockPayload.',
3067+
},
30583068
triggerBlockId: {
30593069
type: 'string',
30603070
description:
3061-
'Optional trigger block ID when the workflow has multiple entrypoints and you need to target a specific one.',
3071+
'Trigger block ID to run from (from get_workflow_run_options). Required when the workflow has multiple entrypoints.',
30623072
},
30633073
useDeployedState: {
30643074
type: 'boolean',
30653075
description:
30663076
'When true, runs the deployed version instead of the live draft. Default: false (draft).',
30673077
},
3078+
useMockPayload: {
3079+
type: 'boolean',
3080+
description:
3081+
"When true, run with the trigger's generated mock payload instead of workflow_input. Prefer building your own workflow_input; use this only when you can't.",
3082+
},
30683083
workflowId: {
30693084
type: 'string',
30703085
description:
30713086
'Optional workflow ID to run. If not provided, uses the current workflow in context.',
30723087
},
30733088
workflow_input: {
30743089
type: 'object',
3075-
description: 'JSON object with key-value mappings where each key is an input field name',
3090+
description:
3091+
"JSON object matching the target trigger's inputSchema (from get_workflow_run_options). For external/webhook triggers this is the event payload; for API/Input triggers it is the form fields.",
30763092
},
30773093
},
30783094
},
@@ -3082,28 +3098,39 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
30823098
parameters: {
30833099
type: 'object',
30843100
properties: {
3101+
inputFromExecutionId: {
3102+
type: 'string',
3103+
description:
3104+
'Reuse the recorded input from a past execution of this workflow (from query_logs) instead of supplying workflow_input. The reused input is re-validated against the trigger. Mutually exclusive with workflow_input and useMockPayload.',
3105+
},
30853106
stopAfterBlockId: {
30863107
type: 'string',
30873108
description: 'The block ID to stop after. Execution halts once this block completes.',
30883109
},
30893110
triggerBlockId: {
30903111
type: 'string',
30913112
description:
3092-
'Optional trigger block ID when the workflow has multiple entrypoints and you need to target a specific one.',
3113+
'Trigger block ID to run from (from get_workflow_run_options). Required when the workflow has multiple entrypoints.',
30933114
},
30943115
useDeployedState: {
30953116
type: 'boolean',
30963117
description:
30973118
'When true, runs the deployed version instead of the live draft. Default: false (draft).',
30983119
},
3120+
useMockPayload: {
3121+
type: 'boolean',
3122+
description:
3123+
"When true, run with the trigger's generated mock payload instead of workflow_input. Prefer building your own workflow_input; use this only when you can't.",
3124+
},
30993125
workflowId: {
31003126
type: 'string',
31013127
description:
31023128
'Optional workflow ID to run. If not provided, uses the current workflow in context.',
31033129
},
31043130
workflow_input: {
31053131
type: 'object',
3106-
description: 'JSON object with key-value mappings where each key is an input field name',
3132+
description:
3133+
"JSON object matching the target trigger's inputSchema (from get_workflow_run_options). For external/webhook triggers this is the event payload; for API/Input triggers it is the form fields.",
31073134
},
31083135
},
31093136
required: ['stopAfterBlockId'],

0 commit comments

Comments
 (0)