diff --git a/packages/components/nodes/agentflow/Agent/Agent.ts b/packages/components/nodes/agentflow/Agent/Agent.ts index 035b1a718..09177cbce 100644 --- a/packages/components/nodes/agentflow/Agent/Agent.ts +++ b/packages/components/nodes/agentflow/Agent/Agent.ts @@ -1081,7 +1081,7 @@ class Agent_Agentflow implements INode { if (newState && Object.keys(newState).length > 0) { for (const key in newState) { if (newState[key].toString().includes('{{ output }}')) { - newState[key] = finalResponse + newState[key] = newState[key].replaceAll('{{ output }}', finalResponse) } } } diff --git a/packages/components/nodes/agentflow/CustomFunction/CustomFunction.ts b/packages/components/nodes/agentflow/CustomFunction/CustomFunction.ts index 8f31c0143..3bdc60681 100644 --- a/packages/components/nodes/agentflow/CustomFunction/CustomFunction.ts +++ b/packages/components/nodes/agentflow/CustomFunction/CustomFunction.ts @@ -194,7 +194,7 @@ class CustomFunction_Agentflow implements INode { if (newState && Object.keys(newState).length > 0) { for (const key in newState) { if (newState[key].toString().includes('{{ output }}')) { - newState[key] = finalOutput + newState[key] = newState[key].replaceAll('{{ output }}', finalOutput) } } } diff --git a/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts b/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts index ebb5ac36f..492c00af1 100644 --- a/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts +++ b/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts @@ -225,7 +225,7 @@ class ExecuteFlow_Agentflow implements INode { if (newState && Object.keys(newState).length > 0) { for (const key in newState) { if (newState[key].toString().includes('{{ output }}')) { - newState[key] = resultText + newState[key] = newState[key].replaceAll('{{ output }}', resultText) } } } diff --git a/packages/components/nodes/agentflow/Retriever/Retriever.ts b/packages/components/nodes/agentflow/Retriever/Retriever.ts index 8524fcd12..b9af63b76 100644 --- a/packages/components/nodes/agentflow/Retriever/Retriever.ts +++ b/packages/components/nodes/agentflow/Retriever/Retriever.ts @@ -201,7 +201,7 @@ class Retriever_Agentflow implements INode { if (newState && Object.keys(newState).length > 0) { for (const key in newState) { if (newState[key].toString().includes('{{ output }}')) { - newState[key] = finalOutput + newState[key] = newState[key].replaceAll('{{ output }}', finalOutput) } } } diff --git a/packages/components/nodes/agentflow/Tool/Tool.ts b/packages/components/nodes/agentflow/Tool/Tool.ts index be6c639a8..59b81f553 100644 --- a/packages/components/nodes/agentflow/Tool/Tool.ts +++ b/packages/components/nodes/agentflow/Tool/Tool.ts @@ -334,7 +334,7 @@ class Tool_Agentflow implements INode { if (newState && Object.keys(newState).length > 0) { for (const key in newState) { if (newState[key].toString().includes('{{ output }}')) { - newState[key] = toolOutput + newState[key] = newState[key].replaceAll('{{ output }}', toolOutput) } } }