Fixes state interpolation when using {{ output }} (#5039)

* Fixes the lossy-replace when a new state assignment contains the {{ output }} variable

* Replaces replace with replaceAll

---------

Co-authored-by: Corentin <corentin.hoareau@sogeti.com>
This commit is contained in:
corentin-hoareau
2025-08-08 16:08:59 +02:00
committed by GitHub
parent fa15b6873d
commit bbcfb5ab63
5 changed files with 5 additions and 5 deletions
@@ -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)
}
}
}