Skip to content

Commit 4ee9b4d

Browse files
author
Theodore Li
committed
fix(ui) fix workflow not showing up when mothership calls run
1 parent 44016ad commit 4ee9b4d

File tree

1 file changed

+12
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/home/hooks

1 file changed

+12
-0
lines changed

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,18 @@ export function useChat(
651651
) {
652652
clientExecutionStarted.add(id)
653653
const args = data?.arguments ?? data?.input ?? {}
654+
const targetWorkflowId =
655+
typeof (args as Record<string, unknown>).workflowId === 'string'
656+
? ((args as Record<string, unknown>).workflowId as string)
657+
: useWorkflowRegistry.getState().activeWorkflowId
658+
if (targetWorkflowId) {
659+
const meta = useWorkflowRegistry.getState().workflows[targetWorkflowId]
660+
addResource({
661+
type: 'workflow',
662+
id: targetWorkflowId,
663+
title: meta?.name ?? 'Workflow',
664+
})
665+
}
654666
executeRunToolOnClient(id, name, args as Record<string, unknown>)
655667
}
656668
break

0 commit comments

Comments
 (0)