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);
Related Templates
Extract Title tag and Meta description from url for SEO analysis with Airtable
Extract Title tag and meta description from url for SEO analysis. How it works The workflows takes records from Airtabl...
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Extract Named Entities from Web Pages with Google Natural Language API
Who is this for? Content strategists analyzing web page semantic content SEO professionals conducting entity-based anal...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments