i wonder if dify do not allow boolean output in a code node #30800
Replies: 1 comment 2 replies
-
|
Dify's backend does support boolean outputs in code nodes, as shown by the presence of boolean types in the allowed output types for code node validation logic (source). However, the validation error you encountered comes from the frontend or schema validation, which currently only allows string, number, object, array[number], array[string], array[object], or array[file] as output types—boolean is not included in this list (source). This means boolean outputs are blocked at the UI/schema level even though the backend could handle them. A common workaround is to convert boolean values to a supported type, such as using 1/0 or "true"/"false" instead of True/False in your code node output. There are ongoing user requests to lift this restriction and allow all supported types, including boolean, in custom plugins and code nodes (source). For now, converting your boolean outputs to string or number is the most reliable approach. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
error message:
1 validation error for CodeNodeData
default_value.6.type
Input should be 'string', 'number', 'object', 'array[number]', 'array[string]', 'array[object]' or 'array[file]'
[type=enum, input_value='boolean', input_type=str]
Beta Was this translation helpful? Give feedback.
All reactions