MYSQL module add "Stored Proceedure Call" option

The idea is:

If you execute a stored procedure call as a regular query, the results are kind of a mess. The row headers aren’t exposed easily, and the procedure results end up as an “extra” item that needs to be filtered out.

My use case:

Anything there the query is “CALL ”

I think it would be beneficial to add this because:

Eliminates a lot of post processing of results. Also, I think there are cases where a stored procedure can return multiple recordsets, and it’d be good to handle that intelligently.

Any resources to support this?

https://dev.mysql.com/doc/refman/8.0/en/call.html

Are you willing to work on this?

Nobody really wants me to touch code that others will use in production. :slight_smile:

I am dealing with this EXACT problem.

The biggest pain is that the MySQL node with the stored procedure call now returns 2 items and screws up all the subsequent nodes.

How did you solve it? And I seriously hope they implement a stored procedure call option for n8n!

1 Like

This was too long ago for me to remember what I did, sorry.

Are you self hosting? If so, you could install the mysql2 Node module and write a little script for the code module to make your stored procedure call, process the results, and output them in a format that you can use in the rest of your workflow.

There seem to be a lot of situations where “a little code” is a much better answer than “no code” which is why I like n8n so much more than Make.

Lee

i too was dealing with the return of 2 items. I solved it by going to the settings in the MySQL node and turning on the switch for run only once. and then it just outputted the 1 correct item. :-). but I had to use 2 MySQL nodes to use procedure calls, the first one did just the procedural call and the 2nd one took the variable it outputs and ran the query. chatGPT had to help me figure out that solution. :slight_smile: