Generate and insert data into a Postgres database
Needs changesWhat this workflow does
This workflow has 3 nodes and runs on a schedule (legacy Cron node). Along the way it connects Postgres.
How it runs
Trigger: On a schedule (legacy Cron node).
- Function: runs custom JavaScript (legacy Function node)
- Postgres: uses Postgres
Services it uses
Before you upgrade to n8n 3.0
2 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- Cron: replace with Schedule Trigger.
- Function (legacy) in Function: replace with Code node, mode 'Run Once for All Items'.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2020 — 25% of templates published before 2025 need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| Cron Cron | Schedule Trigger |
| Function (legacy) Function | Code node, mode 'Run Once for All Items' |
Nodes used (3)
- Cron
n8n-nodes-base.cron - Function
n8n-nodes-base.function - Postgres
n8n-nodes-base.postgres
From the author
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…