FM
FlowMarket
Social Media & Content Beginner ⚡ 5 n8n Nodes

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 bl...

🔌 Nodes & Integrations Used (3)

Cron PostgreSQL Twilio

📖 Implementation & Setup Guide

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](https://blog.n8n.io/database-monitoring-and-alerting-with-n8n/).

Prerequisites

  • A Postgres database set up and [credentials](https://docs.n8n.io/integrations/credentials/postgres/)
  • A Twilio account and [credentials](https://docs.n8n.io/integrations/credentials/twilio/)

Nodes

  • [Cron node](https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.cron/) triggers the workflow every minute, so the database is queried at regular intervals.
  • [Postgres nodes](https://docs.n8n.io/integrations/nodes/n8n-nodes-base.postgres/) extract values from, and update values in the database.
  • [Twilio node](https://docs.n8n.io/integrations/nodes/n8n-nodes-base.twilio/) sends an alert SMS about the outlier reading to a specified phone number.
  • [Set node](https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.set/) sets the notification value to *true*.

⚡ How to import this workflow into n8n:

  1. Click the Direct Download JSON button above to save Send_SMS_alerts_based_on_database_queries_Twilio_and_Postgres_.json.
  2. Log in to your n8n Cloud or self-hosted n8n instance.
  3. In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
  4. Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
  5. Click Execute Workflow to test and switch to Active!

Related Social Media & Content Workflows

View All in Social Media & Content →