API Endpoint for Dynamic PostgreSQL Table Listing
detail.loadingPreview
This n8n workflow provides a secure API endpoint to dynamically fetch and list all base table names from a specified PostgreSQL database's public schema. It's an efficient way to programmatically retrieve database schema information for various applications or monitoring needs.
About This Workflow
Empower your applications and internal tools with real-time PostgreSQL schema discovery using this n8n workflow. Triggered securely via a custom webhook with header authentication, it connects to your PostgreSQL instance, executes a precise SQL query to identify all base tables within the public schema, and then consolidates these table names into a single, easy-to-consume string. The result is immediately returned to the requesting application. This workflow is ideal for developers, operations teams, or anyone needing quick, programmatic access to their database structure without direct database console access, enhancing automation and integration capabilities.
Key Features
- Secure Webhook Trigger: Initiates the workflow via an authenticated HTTP request using header authentication.
- PostgreSQL Integration: Directly queries your PostgreSQL database to retrieve schema information.
- Dynamic Table Listing: Fetches all base table names from the
publicschema. - Concatenated Output: Summarizes multiple table names into a single string for simplified consumption.
- Instant API Response: Provides immediate feedback to the calling system with the requested data.
How To Use
- Configure the Webhook Trigger: The 'Webhook' node (
id: 3eb54a82-034c-4f3f-aa99-3b6aeb744ce2) is configured with a specific path (d8db9fa3-04fe-43c8-9acf-e191246347f) and requiresheaderAuth. Ensure your calling application provides the correct authentication headers. - Set up PostgreSQL Credentials: The 'Postgres' node (
id: 2cd15801-ea79-4a53-b1be-0c047029966a) uses existing credentials (id: AXJoQJaFRsoL9Qk8,name: Postgres account). Make sure these credentials are properly configured in your n8n instance to connect to your target PostgreSQL database. - Understand the Query: The 'Postgres' node executes a specific SQL query to fetch
table_namefrominformation_schema.tableswheretable_schema = 'public'andtable_type = 'BASE TABLE'. Modify this query if you need to target a different schema or table type. - Review Summarization: The 'Summarize' node (
id: 8b66e814-e553-451c-818a-fc93699b341c) concatenates alltable_namefields. If you require a different aggregation or output format, adjust its parameters. - Test the Endpoint: Once activated, trigger the workflow by sending an authenticated HTTP request to the webhook URL. The response will contain the concatenated list of table names.
Apps Used
Workflow JSON
{
"id": "ecf80d29-0217-4686-9a56-096bf4bdbf50",
"name": "API Endpoint for Dynamic PostgreSQL Table Listing",
"nodes": 12,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: ecf80d29-0217...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Effortless Bug Reporting: Slack Slash Command to Linear Issue
Streamline your bug reporting process by instantly creating Linear issues directly from Slack using a simple slash command. This workflow enhances team collaboration by providing immediate feedback and a structured approach to logging defects, saving valuable time for development and QA teams.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.