Skip to content
FlowHubFluxonLab
Postgres
PostgreSQLfree

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

by tanaypantadapted from n8n official workflow galleryUpdated Aug 2026
RequiresPostgresPostgresTwilioTwilio
Share Post Share
CrCronPostgresTwilioSeSetPostgres11234
1/5
STEPS · 4
Runs on a schedule

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.

Tags

n8nreference-onlypostgrestwilio
Connects
postgresPostgrestwilioTwilio
CategoryPostgreSQL
Triggermanual
Complexitysimple
Nodes5
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
postgres
free

Generate and insert data into a Postgres database

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. You can create the database for this workflow with the following SQL statement: CREATE TABLE n8n (id SERIAL, sensor_id VARCHAR, value INT, time_stamp TIMESTAMP, notification BOOLEAN);

by tanaypant