Execute Command repeat

I would like to execute execute command for each record of a function that gives me all records how do you do it?

The execute command node will execute automatically as many times as input items it receives. Just connect the node that returns multiple inputs to the execute command node.

2 Likes

great, solved, I have the same problem with a mysql update; basically i would like to update multiple records with mysql passed by a function

Hey @marconte!

That should be handled by n8n itself. You just have to make sure that you’re returning multiple items from the previous node.

1 Like

it returns me multiple register function but mysql does not update all records

Hey @marconte , concerning the mysql node it updates correctly based on the items number.
here is an example for creating and updating a set of records.

Please let me know if that help, otherwise you can forward your workflow for better debugging.

2 Likes

Great, really interesting, thanks for your attention

this form is important? Updated${items[i].json.name}
it must always be inserted before the mysql update

That is an example of updating record (changing the ‘name’ field), you can use the same concept to apply changes for your items. Let me know if that helps.