Browse Source

fix: add handling for non-string type in variable template parser (#4996)

Yeuoly 10 months ago
parent
commit
73dee84cab
1 changed files with 5 additions and 1 deletions
  1. 5 1
      api/core/workflow/utils/variable_template_parser.py

+ 5 - 1
api/core/workflow/utils/variable_template_parser.py

@@ -45,7 +45,11 @@ class VariableTemplateParser:
         def replacer(match):
             key = match.group(1)
             value = inputs.get(key, match.group(0))  # return original matched string if key not found
-
+            # convert the value to string
+            if isinstance(value, list | dict | bool | int | float):
+                value = str(value)
+                
+            # remove template variables if required
             if remove_template_variables:
                 return VariableTemplateParser.remove_template_variables(value)
             return value