From 5259bab7785ec21db408570c9279a5c491d3d700 Mon Sep 17 00:00:00 2001 From: russelj1 Date: Wed, 30 Jul 2025 21:26:21 +0100 Subject: [PATCH] Fix: dot notation for nested output variable resolution (#4983) Addressed issue of casting value to a string --- packages/server/src/utils/buildAgentflow.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utils/buildAgentflow.ts b/packages/server/src/utils/buildAgentflow.ts index 63201784..d9267519 100644 --- a/packages/server/src/utils/buildAgentflow.ts +++ b/packages/server/src/utils/buildAgentflow.ts @@ -351,8 +351,14 @@ export const resolveVariables = async ( const formattedValue = Array.isArray(variableValue) || (typeof variableValue === 'object' && variableValue !== null) ? JSON.stringify(variableValue) - : String(variableValue) - resolvedValue = resolvedValue.replace(match, formattedValue) + : variableValue + // If the resolved value is exactly the match, replace it directly + if (resolvedValue === match) { + resolvedValue = formattedValue + } else { + // Otherwise do a standard string‐replace + resolvedValue = String(resolvedValue).replace(match, String(formattedValue)) + } // Skip fallback logic continue }