fix(executor/function): fix resolution of tag inputs to function block

This commit is contained in:
Waleed Latif
2025-03-04 13:38:09 -08:00
parent fd08e7e5eb
commit 6e7c34992b
3 changed files with 37 additions and 4 deletions
+15
View File
@@ -494,6 +494,21 @@ export class Executor {
}
if (blockType === 'condition') {
if (output && typeof output === 'object' && 'response' in output) {
return {
response: {
...output.response,
conditionResult: output.response.conditionResult || false,
selectedPath: output.response.selectedPath || {
blockId: '',
blockType: '',
blockTitle: '',
},
selectedConditionId: output.response.selectedConditionId || '',
},
}
}
return {
response: {
conditionResult: output?.conditionResult || false,
+3
View File
@@ -223,6 +223,9 @@ export class InputResolver {
if (currentBlock.metadata?.id === 'condition') {
formattedValue = this.stringifyForCondition(replacementValue)
} else if (currentBlock.metadata?.id === 'function' && typeof replacementValue === 'string') {
// For function blocks, we need to properly quote string values to avoid syntax errors
formattedValue = JSON.stringify(replacementValue)
} else {
formattedValue =
typeof replacementValue === 'object'