diff --git a/packages/global/core/workflow/runtime/type.d.ts b/packages/global/core/workflow/runtime/type.d.ts index f5db3a89cb..2ab34bfbe5 100644 --- a/packages/global/core/workflow/runtime/type.d.ts +++ b/packages/global/core/workflow/runtime/type.d.ts @@ -40,6 +40,7 @@ export type ChatDispatchProps = { id: string; // May be the id of the system plug-in (cannot be used directly to look up the table) teamId: string; tmbId: string; // App tmbId + isChildApp?: boolean; }; runningUserInfo: { teamId: string; diff --git a/packages/service/core/workflow/dispatch/plugin/run.ts b/packages/service/core/workflow/dispatch/plugin/run.ts index b509952007..c5a37e3a43 100644 --- a/packages/service/core/workflow/dispatch/plugin/run.ts +++ b/packages/service/core/workflow/dispatch/plugin/run.ts @@ -90,7 +90,8 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise => { runningAppInfo: { id: String(appData._id), teamId: String(appData.teamId), - tmbId: String(appData.tmbId) + tmbId: String(appData.tmbId), + isChildApp: true }, runtimeNodes: storeNodes2RuntimeNodes(nodes, getWorkflowEntryNodeIds(nodes)), runtimeEdges: initWorkflowEdgeStatus(edges), diff --git a/packages/service/core/workflow/dispatch/tools/runUpdateVar.ts b/packages/service/core/workflow/dispatch/tools/runUpdateVar.ts index d0f0d64f41..00daeab1f1 100644 --- a/packages/service/core/workflow/dispatch/tools/runUpdateVar.ts +++ b/packages/service/core/workflow/dispatch/tools/runUpdateVar.ts @@ -19,7 +19,14 @@ type Props = ModuleDispatchProps<{ type Response = DispatchNodeResultType<{}>; export const dispatchUpdateVariable = async (props: Props): Promise => { - const { params, variables, runtimeNodes, workflowStreamResponse, externalProvider } = props; + const { + params, + variables, + runtimeNodes, + workflowStreamResponse, + externalProvider, + runningAppInfo + } = props; const { updateList } = params; const nodeIds = runtimeNodes.map((node) => node.nodeId); @@ -78,10 +85,12 @@ export const dispatchUpdateVariable = async (props: Props): Promise => return value; }); - workflowStreamResponse?.({ - event: SseResponseEventEnum.updateVariables, - data: removeSystemVariable(variables, externalProvider.externalWorkflowVariables) - }); + if (!runningAppInfo.isChildApp) { + workflowStreamResponse?.({ + event: SseResponseEventEnum.updateVariables, + data: removeSystemVariable(variables, externalProvider.externalWorkflowVariables) + }); + } return { [DispatchNodeResponseKeyEnum.newVariables]: variables, diff --git a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx index 9f54347db8..8ec2b2f864 100644 --- a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx +++ b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx @@ -65,7 +65,7 @@ const ChatTest = ({ isOpen, nodes = [], edges = [], onClose }: Props) => { }} />