Skip to content

Commit 3d5bd00

Browse files
authored
fix(triggers): add copilot as a trigger type (#3191)
* fix(triggers): add copilot as a trigger type * update color
1 parent 13a9111 commit 3d5bd00

File tree

8 files changed

+18
-5
lines changed

8 files changed

+18
-5
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: 'pink',
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/components/emcn/components/badge/badge.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const badgeVariants = cva(
2727
amber: `${STATUS_BASE} bg-[#fde68a] text-[#a16207] dark:bg-[rgba(245,158,11,0.2)] dark:text-[#fcd34d]`,
2828
teal: `${STATUS_BASE} bg-[#99f6e4] text-[#0f766e] dark:bg-[rgba(20,184,166,0.2)] dark:text-[#5eead4]`,
2929
cyan: `${STATUS_BASE} bg-[var(--surface-4)] text-[#0891b2] dark:bg-[rgba(14,165,233,0.2)] dark:text-[#7dd3fc]`,
30+
pink: `${STATUS_BASE} bg-[#fbcfe8] text-[#be185d] dark:bg-[rgba(236,72,153,0.2)] dark:text-[#f9a8d4]`,
3031
'gray-secondary': `${STATUS_BASE} bg-[var(--surface-4)] text-[var(--text-secondary)]`,
3132
},
3233
size: {
@@ -54,6 +55,7 @@ const STATUS_VARIANTS = [
5455
'amber',
5556
'teal',
5657
'cyan',
58+
'pink',
5759
'gray-secondary',
5860
] as const
5961

@@ -87,7 +89,7 @@ export interface BadgeProps
8789
* Supports two categories of variants:
8890
* - **Bordered**: `default`, `outline`, `type` - traditional badges with borders
8991
* - **Status colors**: `green`, `red`, `gray`, `blue`, `blue-secondary`, `purple`,
90-
* `orange`, `amber`, `teal`, `cyan`, `gray-secondary` - borderless colored badges
92+
* `orange`, `amber`, `teal`, `cyan`, `pink`, `gray-secondary` - borderless colored badges
9193
*
9294
* Status color variants can display a dot indicator via the `dot` prop.
9395
* All variants support an optional `icon` prop for leading icons.

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: '#ec4899' },
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?: 'api' | 'chat' | 'copilot'
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
@@ -190,6 +190,7 @@ export const CORE_TRIGGER_TYPES = [
190190
'webhook',
191191
'mcp',
192192
'a2a',
193+
'copilot',
193194
] as const
194195

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

0 commit comments

Comments
 (0)