AI Chatbot for Uniconta ERP Data Query using Text-to-SQL - n8n Workflow

Deploy a powerful n8n workflow using an AI agent, OpenAI, and Peliqan to transform natural language questions into accurate SQL queries against your Uniconta ERP data, leveraging Text-to-SQL technology.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Business Analysts needing quick insights from Uniconta ERP data.
Developers building custom internal tools and chat interfaces.
Automation specialists looking for advanced Text-to-SQL n8n templates.
Companies using n8n to connect AI services with proprietary business data.

Overview

This expert n8n workflow solves the challenge of non-technical users accessing complex ERP data by transforming natural language queries into executable SQL commands. By leveraging an AI Agent framework combined with the Peliqan data synchronization tool, this solution provides real-time access to Uniconta ERP information (like creditor status, GL accounts, stock levels, and invoices).

The core value of this n8n template lies in the precise configuration of the AI Agent. The agent is trained specifically on the Uniconta data model (schema provided in the system message), ensuring that the generated SQL is accurate and relevant to your actual data structure. This sophisticated n8n node setup enables fast, reliable, and conversational data retrieval, dramatically improving efficiency for data-driven decisions.

How it Works

This automation initiates when a user sends a message, leveraging a specialized n8n trigger for chat interfaces.


  1. Incoming Chat Trigger: The workflow starts with the When chat message received n8n trigger, capturing the user's natural language question.

  2. AI Orchestration: The query is passed to the powerful AI Agent n8n node. This agent connects to the OpenAI Chat Model for reasoning and uses the Simple Memory n8n node to maintain conversational context.

  3. Text-to-SQL Generation: Based on the extensive Uniconta data schema provided in the agent's system message, the AI determines the optimal SQL query required to answer the user's question.

  4. Data Retrieval Tool: The AI Agent invokes the Execute an SQL query via Peliqan n8n tool. This Peliqan n8n node is specifically configured to receive the AI-generated SQL query and execute it against the Uniconta data synchronized in the Peliqan data warehouse.

  5. Result Interpretation: The Peliqan tool returns the resulting data set back to the AI Agent.

  6. Final Response: The agent processes the raw data, formats it into a coherent natural language response, and sends it back to the user via the initial n8n trigger connection, completing the complex data retrieval cycle established by this n8n workflow.

Installation Guide

To deploy this advanced n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' menu.

  2. Peliqan Setup: Sign up for Peliqan.io, connect it to your Uniconta ERP instance, and obtain your Peliqan API key (Settings > API key).

  3. Credential Setup: In n8n, navigate to Credentials and configure the following:

OpenAI API: Provide your OpenAI API Key for the OpenAI Chat Model n8n node.
Peliqan API: Configure a new Peliqan account credential using your Peliqan API key.

  1. Peliqan Node Configuration: Open the Execute an SQL query via Peliqan n8n node and select your specific Peliqan data warehouse name or ID.

  2. Enable Tool Usage: Crucially, because this n8n workflow uses the Peliqan node as an AI tool, you must set the environment variable on your n8n server: export N8NCOMMUNITYPACKAGESALLOWTOOL_USAGE=True.

  3. Activate: Set the n8n workflow to 'Active' to start listening for chat messages.

Node Details

When chat message received (n8n trigger): Acts as the entry point for the n8n workflow, listening for user input from the chat interface to initiate the Text-to-SQL process.
AI Agent (Langchain Agent n8n node): The core orchestrator.
Function: Manages the conversation flow, selects the appropriate tool, and generates SQL based on the system instructions.
Key Configuration: Contains an extensive system message defining the AI's role and providing the complete Uniconta database schema (tables like uniconta.debtorclient, uniconta.glaccountclient, etc.) necessary for accurate SQL generation.
OpenAI Chat Model (Langchain LLM n8n node): Provides the language model capability (the 'brain') for the AI Agent, handling the complex reasoning required for Text-to-SQL.
Simple Memory (Langchain Memory n8n node): Ensures the AI Agent remembers the context of previous messages within the chat session, enabling multi-turn conversations.
Execute an SQL query via Peliqan (Peliqan Tool n8n node):
Function: Executes the dynamically generated SQL against the Peliqan data warehouse containing the Uniconta data.
Key Configuration*: Query Sql is set dynamically using the expression {{ $fromAI('SQL_Query', , 'string') }}, capturing the SQL output from the AI Agent.

Related n8n Workflows

Free

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

Peliqan.io is the one-click data foundation for our n8n AI Agents. Add all your business applications for RAG and "Text to SQL", and build AI chatbots and AI Agents that can interact with all internal company data from CRM, ERP, cloud storage, accounting, HRM/ATS etc.

Featured*