Skip to main content

Automate testing and collect responses via Telegram in Postgres (module "Quiz")

Workflow preview

Workflow preview
100%
Automate testing and collect responses via Telegram in Postgres (module "Quiz") preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? This template is ideal for educators, HR professionals, and anyone looking to automate testing and collect responses through Telegram, while storing results in a Postgres database....

Best for

  • HR automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.switch, n8n-nodes-base.telegram, n8n-nodes-base.sort, n8n-nodes-base.wait, n8n-nodes-base.set, n8n-nodes-base.merge, n8n-nodes-base.postgres, n8n-nodes-base.telegramtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Andrew.

Original n8n.io source

1.1 Workflow description

Title
Automate testing and collect responses via Telegram in Postgres (module "Quiz")
Workflow name
Automate testing and collect responses via Telegram in Postgres (module "Quiz")

Who is this for?

This template is ideal for educators, HR professionals, and anyone looking to automate testing and collect responses through Telegram, while storing results in a Postgres database.

What problem is this workflow solving?

Manually organizing and managing tests can be time-consuming and prone to error. This workflow automates the test distribution, response collection, and scoring process, ensuring a seamless and efficient testing experience.

What this workflow does

  • Adds test content, including questions and answers, to a Postgres database
  • Sends a Telegram bot link to test participants
  • Automatically delivers the test via the Telegram bot
  • Collects and stores responses
  • Displays the participant's ranking at the end of the test

Setup

  1. Create tables in Postgres

    • Replace "n8n" in the provided SQL script with the name of your actual schema
    • Run the script in your database to create the required tables
  2. Add credentials

    • Set up and connect your Telegram credentials
    • Set up and connect your Postgres credentials

How to customize this workflow to your needs

  • Modify the test content directly in the Postgres database
  • Customize the Telegram bot messages to match your tone and branding.
  • Adjust scoring logic if needed to reflect different evaluation methods.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - For Tests

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 2 - Test

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 3 - Randomize questions

Type / Role
n8n-nodes-base.sort - sort
Config choices
Version 1

Block 4 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 5 - Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 7 - Question

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 8 - Commands

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 9 - Buttons

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 10 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 11 - List tests

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Main Menu

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 13 - Update Bot Status on start

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 14 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.1

Block 15 - Initialization

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Any questions?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Delete message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 18 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - Get Questions AND Answers

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 20 - Update Answer

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 21 - Get Non-Answered Questions

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 22 - Get Tests

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 23 - Union Number with Question

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Union list

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Showing the first 24 of 36 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate testing and collect responses via Telegram in Postgres (module "Quiz")
Complexity advanced
Nodes 36
Categories HR
Author Andrew
Published 19 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3612/3612.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate testing and collect responses via Telegram in Postgres (module "Quiz") do?

Who is this for? This template is ideal for educators, HR professionals, and anyone looking to automate testing and collect responses through Telegram, while storing results in a Postgres database....

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your HR use case.