diff --git a/apps/sim/app/api/function/execute/route.ts b/apps/sim/app/api/function/execute/route.ts index 8a052bf1c..76ae81a8e 100644 --- a/apps/sim/app/api/function/execute/route.ts +++ b/apps/sim/app/api/function/execute/route.ts @@ -391,7 +391,7 @@ function resolveWorkflowVariables( // Already a boolean, keep as-is } else { const normalized = String(variableValue).toLowerCase().trim() - variableValue = normalized === 'true' || normalized === '1' + variableValue = normalized === 'true' } } else if (type === 'json' && typeof variableValue === 'string') { try { diff --git a/apps/sim/lib/workflows/variables/variable-manager.test.ts b/apps/sim/lib/workflows/variables/variable-manager.test.ts index 4796ce19b..08da0cc85 100644 --- a/apps/sim/lib/workflows/variables/variable-manager.test.ts +++ b/apps/sim/lib/workflows/variables/variable-manager.test.ts @@ -26,7 +26,7 @@ describe('VariableManager', () => { it.concurrent('should handle boolean type variables', () => { expect(VariableManager.parseInputForStorage('true', 'boolean')).toBe(true) expect(VariableManager.parseInputForStorage('false', 'boolean')).toBe(false) - expect(VariableManager.parseInputForStorage('1', 'boolean')).toBe(true) + expect(VariableManager.parseInputForStorage('1', 'boolean')).toBe(false) expect(VariableManager.parseInputForStorage('0', 'boolean')).toBe(false) expect(VariableManager.parseInputForStorage('"true"', 'boolean')).toBe(true) expect(VariableManager.parseInputForStorage("'false'", 'boolean')).toBe(false) @@ -128,7 +128,7 @@ describe('VariableManager', () => { expect(VariableManager.resolveForExecution(false, 'boolean')).toBe(false) expect(VariableManager.resolveForExecution('true', 'boolean')).toBe(true) expect(VariableManager.resolveForExecution('false', 'boolean')).toBe(false) - expect(VariableManager.resolveForExecution('1', 'boolean')).toBe(true) + expect(VariableManager.resolveForExecution('1', 'boolean')).toBe(false) expect(VariableManager.resolveForExecution('0', 'boolean')).toBe(false) }) diff --git a/apps/sim/lib/workflows/variables/variable-manager.ts b/apps/sim/lib/workflows/variables/variable-manager.ts index 04ed5b9e4..7807d466c 100644 --- a/apps/sim/lib/workflows/variables/variable-manager.ts +++ b/apps/sim/lib/workflows/variables/variable-manager.ts @@ -61,7 +61,7 @@ export class VariableManager { // Special case for 'anything else' in the test if (unquoted === 'anything else') return true const normalized = String(unquoted).toLowerCase().trim() - return normalized === 'true' || normalized === '1' + return normalized === 'true' } case 'object':