The code node cannot store array fields containing multiple objects

python code:

for item in _input.all():
arr =
for i in range(0,20):
new_item = {
“index”: i,
“num”: i + 1,
“test”: “asdasd”
}
arr.append(new_item)
item.json.barr = arr
return _input.all()

After executing the above code, the code node will display a continuously running state.

Hi @song_wade

This works in javascript. Here’s a workflow. Let me try in python as well.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community

@song_wade

Here’s a workflow with both the python version and the javascript version.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community

Thanks, I’ll give it a try.