diff --git a/apps/sim/app/workspace/[workspaceId]/logs/utils.ts b/apps/sim/app/workspace/[workspaceId]/logs/utils.ts index 570262d10..a1f59ec4e 100644 --- a/apps/sim/app/workspace/[workspaceId]/logs/utils.ts +++ b/apps/sim/app/workspace/[workspaceId]/logs/utils.ts @@ -72,6 +72,7 @@ const TRIGGER_VARIANT_MAP: Record['va webhook: 'orange', mcp: 'cyan', a2a: 'teal', + copilot: 'pink', } interface StatusBadgeProps { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts index 1f16dbc8d..c0e54ea43 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts @@ -10,7 +10,7 @@ export interface WorkflowExecutionOptions { onStream?: (se: StreamingExecution) => Promise executionId?: string onBlockComplete?: (blockId: string, output: any) => Promise - overrideTriggerType?: 'chat' | 'manual' | 'api' + overrideTriggerType?: 'chat' | 'manual' | 'api' | 'copilot' stopAfterBlockId?: string /** For run_from_block / run_block: start from a specific block using cached state */ runFromBlock?: { diff --git a/apps/sim/components/emcn/components/badge/badge.tsx b/apps/sim/components/emcn/components/badge/badge.tsx index 76665b88c..837bb85fe 100644 --- a/apps/sim/components/emcn/components/badge/badge.tsx +++ b/apps/sim/components/emcn/components/badge/badge.tsx @@ -27,6 +27,7 @@ const badgeVariants = cva( amber: `${STATUS_BASE} bg-[#fde68a] text-[#a16207] dark:bg-[rgba(245,158,11,0.2)] dark:text-[#fcd34d]`, teal: `${STATUS_BASE} bg-[#99f6e4] text-[#0f766e] dark:bg-[rgba(20,184,166,0.2)] dark:text-[#5eead4]`, cyan: `${STATUS_BASE} bg-[var(--surface-4)] text-[#0891b2] dark:bg-[rgba(14,165,233,0.2)] dark:text-[#7dd3fc]`, + pink: `${STATUS_BASE} bg-[#fbcfe8] text-[#be185d] dark:bg-[rgba(236,72,153,0.2)] dark:text-[#f9a8d4]`, 'gray-secondary': `${STATUS_BASE} bg-[var(--surface-4)] text-[var(--text-secondary)]`, }, size: { @@ -54,6 +55,7 @@ const STATUS_VARIANTS = [ 'amber', 'teal', 'cyan', + 'pink', 'gray-secondary', ] as const @@ -87,7 +89,7 @@ export interface BadgeProps * Supports two categories of variants: * - **Bordered**: `default`, `outline`, `type` - traditional badges with borders * - **Status colors**: `green`, `red`, `gray`, `blue`, `blue-secondary`, `purple`, - * `orange`, `amber`, `teal`, `cyan`, `gray-secondary` - borderless colored badges + * `orange`, `amber`, `teal`, `cyan`, `pink`, `gray-secondary` - borderless colored badges * * Status color variants can display a dot indicator via the `dot` prop. * All variants support an optional `icon` prop for leading icons. diff --git a/apps/sim/lib/copilot/client-sse/run-tool-execution.ts b/apps/sim/lib/copilot/client-sse/run-tool-execution.ts index dbf4ea5c4..37ccd80e7 100644 --- a/apps/sim/lib/copilot/client-sse/run-tool-execution.ts +++ b/apps/sim/lib/copilot/client-sse/run-tool-execution.ts @@ -115,6 +115,7 @@ async function doExecuteRunTool( const result = await executeWorkflowWithFullLogging({ workflowInput, executionId, + overrideTriggerType: 'copilot', stopAfterBlockId, runFromBlock, }) diff --git a/apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools/mutations.ts b/apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools/mutations.ts index 2b9d5142c..440de0ec3 100644 --- a/apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools/mutations.ts +++ b/apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools/mutations.ts @@ -172,7 +172,7 @@ export async function executeRunWorkflow( generateRequestId(), params.workflow_input || params.input || undefined, context.userId, - { enabled: true, useDraftState } + { enabled: true, useDraftState, workflowTriggerType: 'copilot' } ) return { @@ -408,7 +408,12 @@ export async function executeRunWorkflowUntilBlock( generateRequestId(), params.workflow_input || params.input || undefined, context.userId, - { enabled: true, useDraftState, stopAfterBlockId: params.stopAfterBlockId } + { + enabled: true, + useDraftState, + stopAfterBlockId: params.stopAfterBlockId, + workflowTriggerType: 'copilot', + } ) return { @@ -540,6 +545,7 @@ export async function executeRunFromBlock( { enabled: true, useDraftState, + workflowTriggerType: 'copilot', runFromBlock: { startBlockId: params.startBlockId, sourceSnapshot: snapshot }, } ) @@ -602,6 +608,7 @@ export async function executeRunBlock( { enabled: true, useDraftState, + workflowTriggerType: 'copilot', runFromBlock: { startBlockId: params.blockId, sourceSnapshot: snapshot }, stopAfterBlockId: params.blockId, } diff --git a/apps/sim/lib/logs/get-trigger-options.ts b/apps/sim/lib/logs/get-trigger-options.ts index 6aad83ae0..4130aeb3e 100644 --- a/apps/sim/lib/logs/get-trigger-options.ts +++ b/apps/sim/lib/logs/get-trigger-options.ts @@ -39,6 +39,7 @@ export function getTriggerOptions(): TriggerOption[] { { value: 'webhook', label: 'Webhook', color: '#ea580c' }, { value: 'mcp', label: 'MCP', color: '#dc2626' }, { value: 'a2a', label: 'A2A', color: '#14b8a6' }, + { value: 'copilot', label: 'Copilot', color: '#ec4899' }, ] for (const trigger of triggers) { diff --git a/apps/sim/lib/workflows/executor/execute-workflow.ts b/apps/sim/lib/workflows/executor/execute-workflow.ts index 82813ce76..6381d694f 100644 --- a/apps/sim/lib/workflows/executor/execute-workflow.ts +++ b/apps/sim/lib/workflows/executor/execute-workflow.ts @@ -13,7 +13,7 @@ export interface ExecuteWorkflowOptions { enabled: boolean selectedOutputs?: string[] isSecureMode?: boolean - workflowTriggerType?: 'api' | 'chat' + workflowTriggerType?: 'api' | 'chat' | 'copilot' onStream?: (streamingExec: StreamingExecution) => Promise onBlockComplete?: (blockId: string, output: unknown) => Promise skipLoggingComplete?: boolean diff --git a/apps/sim/stores/logs/filters/types.ts b/apps/sim/stores/logs/filters/types.ts index e5768d376..30a0a8b17 100644 --- a/apps/sim/stores/logs/filters/types.ts +++ b/apps/sim/stores/logs/filters/types.ts @@ -190,6 +190,7 @@ export const CORE_TRIGGER_TYPES = [ 'webhook', 'mcp', 'a2a', + 'copilot', ] as const export type CoreTriggerType = (typeof CORE_TRIGGER_TYPES)[number]