This n8n workflow automates the process of importing data from a CSV file into a PostgreSQL database. It is triggered manually, making it ideal for ad hoc data imports or testing. The workflow starts with a manual trigger, then reads the CSV file from the specified file path, converts the CSV to a spreadsheet format for easy data handling, and finally inserts the data into a designated PostgreSQL table. This streamlined process saves time and reduces manual effort when updating databases with CSV data.
Step-by-step, the workflow begins with the manual trigger node, allowing a user to initiate the process. It then reads the CSV file stored at ‘/tmp/t1.csv’ using the ‘Read From File’ node. The file content is converted to a spreadsheet format in the ‘Convert To Spreadsheet’ node, making the data ready for database insertion. Lastly, the ‘Postgres’ node connects to a PostgreSQL database using configured credentials and inserts the CSV data into the ‘t1’ table within the ‘public’ schema, auto-mapping columns based on the CSV data.
This workflow is particularly useful for database administrators or developers who need to perform occasional or bulk CSV imports into PostgreSQL without manual data entry, ensuring data accuracy and efficiency.
Reviews
There are no reviews yet.