Hi Community
,
I’m trying to build an agent-based workflow in n8n that works with my Postgres database.
Here’s my goal:
-
Work inside a specific database and table.
-
Fetch all rows.
-
Analyse one specific column.
-
If any value in that column is non-numeric, update it to
0. -
Finally, validate that all values are numeric after the update.
I see that the Postgres nodes allow:
-
Select rows from Postgres in a table -
Insert_or_update_rows_in_a_table_in_Postgres
But I’m not sure how to best structure the agent prompt/workflow so that the agent:
-
Selects all rows,
-
Checks for non-numeric values in the chosen column,
-
Applies updates using the insert/update node,
-
Validates again at the end.
Has anyone implemented something similar with n8n Agents + Postgres?
Any guidance, examples, or best practices would be super helpful ![]()
Thanks in advance!