Skip to content

Commit 035cdc0

Browse files
committed
fix(triggers): add copilot as a trigger type
1 parent 8a24b56 commit 035cdc0

File tree

7 files changed

+15
-4
lines changed

7 files changed

+15
-4
lines changed

apps/sim/app/workspace/[workspaceId]/logs/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const TRIGGER_VARIANT_MAP: Record<string, React.ComponentProps<typeof Badge>['va
7272
webhook: 'orange',
7373
mcp: 'cyan',
7474
a2a: 'teal',
75+
copilot: 'indigo',
7576
}
7677

7778
interface StatusBadgeProps {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface WorkflowExecutionOptions {
1010
onStream?: (se: StreamingExecution) => Promise<void>
1111
executionId?: string
1212
onBlockComplete?: (blockId: string, output: any) => Promise<void>
13-
overrideTriggerType?: 'chat' | 'manual' | 'api'
13+
overrideTriggerType?: 'chat' | 'manual' | 'api' | 'copilot'
1414
stopAfterBlockId?: string
1515
/** For run_from_block / run_block: start from a specific block using cached state */
1616
runFromBlock?: {

apps/sim/lib/copilot/client-sse/run-tool-execution.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ async function doExecuteRunTool(
115115
const result = await executeWorkflowWithFullLogging({
116116
workflowInput,
117117
executionId,
118+
overrideTriggerType: 'copilot',
118119
stopAfterBlockId,
119120
runFromBlock,
120121
})

apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools/mutations.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export async function executeRunWorkflow(
172172
generateRequestId(),
173173
params.workflow_input || params.input || undefined,
174174
context.userId,
175-
{ enabled: true, useDraftState }
175+
{ enabled: true, useDraftState, workflowTriggerType: 'copilot' }
176176
)
177177

178178
return {
@@ -408,7 +408,12 @@ export async function executeRunWorkflowUntilBlock(
408408
generateRequestId(),
409409
params.workflow_input || params.input || undefined,
410410
context.userId,
411-
{ enabled: true, useDraftState, stopAfterBlockId: params.stopAfterBlockId }
411+
{
412+
enabled: true,
413+
useDraftState,
414+
stopAfterBlockId: params.stopAfterBlockId,
415+
workflowTriggerType: 'copilot',
416+
}
412417
)
413418

414419
return {
@@ -540,6 +545,7 @@ export async function executeRunFromBlock(
540545
{
541546
enabled: true,
542547
useDraftState,
548+
workflowTriggerType: 'copilot',
543549
runFromBlock: { startBlockId: params.startBlockId, sourceSnapshot: snapshot },
544550
}
545551
)
@@ -602,6 +608,7 @@ export async function executeRunBlock(
602608
{
603609
enabled: true,
604610
useDraftState,
611+
workflowTriggerType: 'copilot',
605612
runFromBlock: { startBlockId: params.blockId, sourceSnapshot: snapshot },
606613
stopAfterBlockId: params.blockId,
607614
}

apps/sim/lib/logs/get-trigger-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export function getTriggerOptions(): TriggerOption[] {
3939
{ value: 'webhook', label: 'Webhook', color: '#ea580c' },
4040
{ value: 'mcp', label: 'MCP', color: '#dc2626' },
4141
{ value: 'a2a', label: 'A2A', color: '#14b8a6' },
42+
{ value: 'copilot', label: 'Copilot', color: '#6366f1' },
4243
]
4344

4445
for (const trigger of triggers) {

apps/sim/lib/workflows/executor/execute-workflow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface ExecuteWorkflowOptions {
1313
enabled: boolean
1414
selectedOutputs?: string[]
1515
isSecureMode?: boolean
16-
workflowTriggerType?: 'api' | 'chat'
16+
workflowTriggerType?: string
1717
onStream?: (streamingExec: StreamingExecution) => Promise<void>
1818
onBlockComplete?: (blockId: string, output: unknown) => Promise<void>
1919
skipLoggingComplete?: boolean

apps/sim/stores/logs/filters/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export const CORE_TRIGGER_TYPES = [
189189
'webhook',
190190
'mcp',
191191
'a2a',
192+
'copilot',
192193
] as const
193194

194195
export type CoreTriggerType = (typeof CORE_TRIGGER_TYPES)[number]

0 commit comments

Comments
 (0)