Skip to content
FlowHubFluxonLab
Postgres
PostgreSQLfree

Generate and insert data into a Postgres database

by tanaypantadapted from n8n official workflow galleryUpdated Aug 2026
RequiresPostgresPostgres
Share Post Share
CrCronFuFunctionPostgres12
1/5
STEPS · 2
Runs on a schedule

This is Workflow 1 in the blog tutorial Database activity monitoring and alerting. Prerequisites A Postgres database set up and credentials. Basic knowledge of JavaScript and SQL. Nodes Cron node starts the workflow every minute. Function node generates sensor data (sensor id (preset), a randomly generated value, timestamp, and notification (preset as false) ) Postgres node inserts the data into a Postgres database.

Tags

n8nreference-onlypostgres
Connects
postgresPostgres
CategoryPostgreSQL
Triggermanual
Complexitysimple
Nodes3
AddedMay 5, 2020

Related workflows

See all PostgreSQL
postgres
free

Insert Excel data to Postgres

Read XLS from file Convert it to JSON Insert it in Postgres

by Jan Oberhauser
postgres
free

Transfer data from Postgres to Excel

Read data from Postgres Converting it to XLS Save it to disk

by Jan Oberhauser
postgrestwilio
free

Send SMS alerts based on database queries (Twilio and Postgres)

This workflow automatically queries a Postgres database to find outlier readings for which SMS notifications have not been sent. This is Workflow 2 in the blog tutorial Database activity monitoring and alerting. Prerequisites A Postgres database set up and credentials A Twilio account and credentials Nodes Cron node triggers the workflow every minute, so the database is queried at regular intervals. Postgres nodes extract values from, and update values in the database. Twilio node sends an alert SMS about the outlier reading to a specified phone number. Set node sets the notification value to true.

by tanaypant