Closed AndyMik90 closed 1 day ago
The Iteration node in Dify version 0.6.9 shows a red tooltip indicating an error when the input variable is a string because it is designed to work with list types. The filterInputVar
function only accepts array types, such as VarType.array
, VarType.arrayString
, VarType.arrayNumber
, and VarType.arrayObject
. Since a string is not one of these types, it triggers the error tooltip [1].
Additionally, the _run
method in the IterationNode
class checks if the input variable is a list and raises a ValueError
if it is not:
class IterationNode(BaseIterationNode):
def _run(self, variable_pool: VariablePool) -> BaseIterationState:
iterator = variable_pool.get_variable_value(cast(IterationNodeData, self.node_data).iterator_selector)
if not isinstance(iterator, list):
raise ValueError(f"Invalid iterator value: {iterator}, please provide a list.")
# Additional logic...
To avoid the error tooltip, ensure that the input variable is an array type [2].
To continue the conversation, mention @dosu.
Self Checks
Dify version
0.6.9
Cloud or Self Hosted
Cloud, Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
When adding tools to the iteration node, the input variable is string (item) and gives a red tooltip that there is an error, but the workflow works as expected.
If you want a workflow to debug on, I can send a DSL file on Discord (username: andremik)
✔️ Expected Behavior
Show that the input from the iteration node is correct.
❌ Actual Behavior
Gives error on string item.