Multi-Channel Database-Driven Task Reminder System - n8n Workflow

Automate multi-channel task reminders using a powerful n8n workflow, PostgreSQL, Slack, Telegram, and Email. Use this robust n8n template for reliable scheduling and delivery.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

System administrators and developers building notification microservices.
Teams needing centralized, configurable reminder scheduling.
Users looking for robust, complex n8n templates for multi-channel communication.
Anyone requiring a resilient, database-backed automation solution using n8n.

Overview

This robust automation solves the challenge of creating a reliable, multi-channel task notification system. By utilizing an n8n workflow, tasks are ingested via a dedicated webhook and stored securely in a PostgreSQL database. A crucial part of this system is the scheduled n8n trigger that periodically checks for due tasks. The primary value proposition lies in its dynamic routing capability, allowing the user to specify their preferred communication channel—Email, Slack, or Telegram—upon task creation. This advanced n8n workflow architecture ensures that mission-critical reminders are delivered reliably where they are most likely to be seen, making it a highly valuable addition to any n8n automation collection. This template showcases best practices for using the PostgreSQL n8n node for data management and flow control within an n8n workflow.

How it Works

The n8n workflow is structured into two main components: Task Ingestion and Reminder Distribution.


  1. Task Ingestion (Webhook Trigger): The process starts when an external application calls the Webhook - Receive Task n8n trigger, submitting a JSON payload containing the task details.

  2. Validation: The Validate Input n8n node enforces constraints, ensuring that userId, taskName, and reminderTime are provided. Failure here results in an immediate Error Response.

  3. Persistence: Valid tasks proceed to the Save Task to Database n8n node, where they are stored in PostgreSQL with a 'pending' status. A successful operation sends a positive Success Response.

  4. Reminder Distribution (Scheduled Trigger): The second half of this n8n workflow is initiated by the Schedule Trigger - Every 5 Minutes n8n trigger, which runs on a cron schedule (/5 *).

  5. Database Query: The Fetch Due Tasks n8n node queries PostgreSQL for pending tasks where the reminder_time is approaching or passed.

  6. Flow Control: The Check Tasks Exist n8n node ensures the flow only continues if records were retrieved. The flow then splits records using the Split Into Items n8n node to process each task independently.

  7. Channel Routing: The Route by Channel n8n node dynamically routes the task based on the value in the channel field (email, slack, or telegram).

  8. Notification & Delivery: The appropriate communication n8n node (Send Email Reminder, Send Slack Reminder, or Send Telegram Reminder) delivers the customized notification message.

  9. Completion: Finally, the Update Task Status n8n node updates the task in PostgreSQL to 'sent', preventing duplicate notifications in future runs of this powerful n8n workflow.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' menu > 'Import from JSON'.

  2. PostgreSQL Setup: Configure the PostgreSQL credentials used by the Save Task to Database, Fetch Due Tasks, and Update Task Status n8n nodes. Ensure your database contains the tasks table with the schema provided in the sticky note.

  3. Communication Credentials: Set up credentials for the reminder delivery n8n nodes:

Email: Configure your SMTP credentials for the Send Email Reminder n8n node.
Slack: Configure your Slack API credentials for the Send Slack Reminder n8n node.
* Telegram: Configure your Telegram API credentials for the Send Telegram Reminder n8n node.

  1. Activate Webhook: Copy the webhook URL from the Webhook - Receive Task n8n trigger and integrate it into your task creation system.

  2. Activation: Ensure the n8n workflow is marked 'Active' for the scheduled trigger to start running.

Node Details

This n8n workflow uses several critical n8n nodes to achieve robust functionality:

Webhook - Receive Task (n8n trigger): The primary entry point. It listens on a specific path (task-YOUROPENAIKEYHERE-webhook) to receive new task creation requests.
Postgres Node (Save Task to Database): Stores the validated task data. Key configurations include setting the operation to 'Insert' and specifying the target table (implied tasks table).
Schedule Trigger - Every 5 Minutes (n8n trigger): Periodically initiates the reminder checking process using the cron expression /5 .
Postgres Node (Fetch Due Tasks): Executes a custom SQL query (SELECT FROM tasks WHERE status = 'pending' AND reminder
time <= NOW() + INTERVAL '5 minutes' AND remindertime > NOW()) to retrieve relevant records.
If Node (Validate Input & Check Tasks Exist): Essential for flow control. The validation node checks if key inputs are non-empty. The existence check verifies if the database returned any items.
Switch Node (Route by Channel): Determines the reminder delivery path based on the task's channel field, connecting the n8n flow to Email (Output 0), Slack (Output 1), or Telegram (Output 2).
Email Send Node (Send Email Reminder): Configured to send a personalized subject line (⏰ Task Reminder: {{ $json.taskname }}) and body content to the userid.
Slack Node (Send Slack Reminder): Sends a formatted markdown message, dynamically addressing the user via the user
id retrieved from the database item.
Telegram Node (Send Telegram Reminder): Sends a message using Markdown formatting to the target chatId ({{ $json.userid }}).
Postgres Node (Update Task Status): Executes an UPDATE query to set status = 'sent' and sent
at = NOW(), completing the loop for this powerful n8n node implementation.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

Featured*