Skip to content

My workflow 11

A simple database query workflow that connects to a PostgreSQL database and retrieves data from a specified table. This workflow provides a manual way to execute database select operations through n8n's interface.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

How It Works

  1. Manual Trigger: The workflow starts when a user manually clicks the "Execute workflow" button in the n8n interface
  2. Database Query: Connects to a PostgreSQL database and executes a SELECT operation on a configured table in the public schema
  3. Data Retrieval: Returns the selected rows from the database table

Workflow Diagram

graph TD
    A["When clicking 'Execute workflow'<br/>(Manual Trigger)"] --> B["Select rows from a table<br/>(PostgreSQL)"]

Trigger

Manual Trigger: This workflow is triggered manually by clicking the "Execute workflow" button in the n8n interface. It does not run automatically or on a schedule.

Nodes Used

Node Type Node Name Purpose
Manual Trigger When clicking 'Execute workflow' Provides manual execution control for the workflow
PostgreSQL Select rows from a table Executes SELECT queries against a PostgreSQL database

External Services & Credentials Required

PostgreSQL Database

  • Service: PostgreSQL database server
  • Credentials needed:
    • Database host/connection string
    • Database name
    • Username and password
    • Port (typically 5432)
  • Permissions required: SELECT permissions on the target table

Environment Variables

No environment variables are explicitly configured in this workflow. Database connection details are managed through n8n's credential system.

Data Flow

Input

  • No external input data required
  • Database connection parameters configured in the PostgreSQL node
  • Table selection configured in the node parameters

Output

  • Returns rows from the selected PostgreSQL table
  • Data format depends on the table structure and selected columns
  • Output is in JSON format as returned by the PostgreSQL node

Error Handling

This workflow does not implement explicit error handling. Potential failure points include: - Database connection issues - Invalid table name or schema - Insufficient database permissions - Network connectivity problems

Known Limitations

  • The workflow is currently incomplete as no specific table is configured in the PostgreSQL node
  • No data transformation or filtering is applied to the query results
  • Manual execution only - no automated scheduling or event-based triggers

No related workflows identified from the provided context.

Setup Instructions

  1. Import the workflow into your n8n instance
  2. Configure PostgreSQL credentials:
    • Go to the PostgreSQL node
    • Set up database connection credentials
    • Test the connection
  3. Configure the table selection:
    • In the PostgreSQL node, select the target table from the dropdown
    • Optionally configure specific columns or WHERE conditions
  4. Test the workflow:
    • Click "Execute workflow" to test the database connection
    • Verify that data is returned as expected
  5. Activate if needed: Currently the workflow is inactive - activate it if you want it available for manual execution

Prerequisites

  • Access to a PostgreSQL database
  • Database credentials with SELECT permissions
  • n8n instance with PostgreSQL node available