Send an Array in SQL Query agent possible?

If i send a query in postgres module like that my function work
SELECT valider_reservation_multi(
72, – id_client
ARRAY[1,2], – id_tables (tableau PostgreSQL)
‘2025-02-14’, – date_service
‘13:00:00’, – heure
‘midi’, – service
1, – sous_service
10, – nombre_personnes
NULL – extra_info
);

Now if i try to do it in SQL tool for AI : { {{ $fromAI(“id_table”)}} }
it always seems to add like that :

N8N adds quotes that break the array: ‘ARRAY[1’,‘2]’ instead of ARRAY[1,2].

Information on your n8n setup

**n8n version:**1.78
**Database (default: SQLite):**postgres
**n8n EXECUTIONS_PROCESS setting (default: own, main):**default
**Running n8n via (Docker, npm, n8n cloud, desktop app):**docker with coolify
**Operating system:**debian 12

There’s currently no official support to send arrays using $fromAI function.

But you can use a workaround:

1. Configure the AI Tool to return either a single number or a comma-separated string:

$fromAI("user_ids","User IDs (comma-separated for multiple users, e.g., '3,4,5')", "string")

2. Use a Code node to turn the data into an array:

.
.
:point_right: If my reply answers your question, please remember to mark it as a solution.

Thanks ,Thats why i couldnt do it !! it was impossible

Yeah hahah does that solve your issue?

At least for now… until the team implements the array feature

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.