AutomationFlowsData & Sheets › Send Sms Alerts Based On Database Queries Twilio And Postgres

Send Sms Alerts Based On Database Queries Twilio And Postgres

Send Sms Alerts Based On Database Queries Twilio And Postgres. Uses postgres, twilio. Scheduled trigger; 5 nodes.

Cron / scheduled trigger★★★★☆ complexity5 nodesPostgresTwilio
Data & Sheets Trigger: Cron / scheduled Nodes: 5 Complexity: ★★★★☆

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        250,
        200
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "Postgres",
      "type": "n8n-nodes-base.postgres",
      "position": [
        450,
        200
      ],
      "parameters": {
        "query": "SELECT * FROM n8n WHERE value > 70 AND notification = false;",
        "operation": "executeQuery"
      },
      "credentials": {
        "postgres": "<your credential>"
      },
      "typeVersion": 1
    },
    {
      "name": "Twilio",
      "type": "n8n-nodes-base.twilio",
      "position": [
        650,
        200
      ],
      "parameters": {
        "to": "",
        "from": "",
        "message": "=\ud83d\udea8 The Sensor ({{$node[\"Postgres\"].json[\"sensor_id\"]}}) showed a reading of {{$node[\"Postgres\"].json[\"value\"]}}."
      },
      "credentials": {
        "twilioApi": "<your credential>"
      },
      "typeVersion": 1
    },
    {
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "position": [
        850,
        200
      ],
      "parameters": {
        "values": {
          "number": [
            {
              "name": "id",
              "value": "={{$node[\"Postgres\"].json[\"id\"]}}"
            }
          ],
          "boolean": [
            {
              "name": "notification",
              "value": true
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1
    },
    {
      "name": "Postgres1",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1050,
        200
      ],
      "parameters": {
        "table": "n8n",
        "columns": "notification",
        "operation": "update"
      },
      "credentials": {
        "postgres": "<your credential>"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Set": {
      "main": [
        [
          {
            "node": "Postgres1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron": {
      "main": [
        [
          {
            "node": "Postgres",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twilio": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres": {
      "main": [
        [
          {
            "node": "Twilio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

About this workflow

Send Sms Alerts Based On Database Queries Twilio And Postgres. Uses postgres, twilio. Scheduled trigger; 5 nodes.

Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →