OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilot

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilot
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Database

  • Overview of the ecosystem
  • ORM frameworks
    • Java
      • Spring Boot
      • Spring Batch
      • Use Spring JDBC to connect to OceanBase Database
      • Spring Data JPA
      • Hibernate
      • MyBatis
      • jOOQ
    • Python
      • Use SQLAlchemy to connect to OceanBase Database
      • Connect to OceanBase Database by using peewee
      • Use Tortoise ORM to connect to OceanBase Database
    • Go
      • Connect to OceanBase Database by using GORM
      • beego ORM
    • Rust
      • SeaORM Connection to OceanBase Database
      • Diesel Connection to OceanBase Database
    • Ruby
      • Active Record
      • Sequel Connection to OceanBase Database
      • Connect to OceanBase Database by using Ruby on Rails
    • Node.js
      • Sequelize
      • TypeORM
      • Prisma
      • Drizzle
    • C#
      • Dapper
      • SqlSugar
      • FreeSQL
    • PHP
      • Connect to OceanBase Database by using the Yii 2.0 ORM
      • Connect to OceanBase Database by using Laravel Eloquent ORM
      • CakePHP
  • Database version management
    • Liquibase
    • Flyway
  • Data integration
    • Flink
      • Apache Flink
      • Flink DirectLoad
      • Flink Connector OceanBase
    • dbt
    • SeaTunnel
    • Maxwell
    • Debezium
    • Spark Catalog
    • NiFi
    • Qlik Replicate
    • RisingWave CDC
    • Flume
    • Migrate data from SQL Server to OceanBase Database by using MySQL Workbench
  • SQL development
    • WebLogic
    • DBeaver
    • Navicat
    • DataGrip
    • TablePlus
    • DMS
  • Orchestration and scheduling
    • Airflow
    • PowerJob
    • DolphinScheduler
    • Linkis
  • Visualization tools
    • Superset
    • Excel
    • Power BI
    • Quick BI
    • Tableau
    • GuanData
    • vividime
    • DataV
    • Metabase
    • Redash
    • FineReport
  • Database management
    • NineData
    • Bytebase
    • DataHub
    • Zabbix
  • AI
    • OpenAI
    • Qwen
    • LangChain
    • LlamaIndex
    • Dify
    • n8n
    • Trae
    • SpringAI
    • Cline
    • Cursor
    • Continue
    • MCP Toolbox
    • CamelAI
    • Firecrawl
    • Hugging Face
    • Ollama
    • Google Gemini
    • Cloudflare Workers AI
    • DB GPT
    • Jina AI
    • Augment Code
    • Claude Code
    • Kiro
    • GPT4All
  • Application
    • Ghost
    • Jira
    • Seata
    • SAP Crystal Reports
  • Middleware
    • Apache Pulsar

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. master

Integrate OceanBase Database with n8n

Last Updated:2026-09-04 07:40:45

Prerequisites
Step 1: Get database connection details
Step 2: Create a test table and insert data
Step 3: Deploy the tools
Deploy n8n (self-hosted)
Deploy the Qwen3 model with Ollama
Step 4: Build the AI Agent workflow
Workflow overview

n8n is a workflow automation platform with built-in AI capabilities. It gives technical teams the flexibility of code and the speed of no-code tooling. With more than 400 integrations, native AI features, and a fair-code license, n8n lets you build powerful automations while keeping full control of your data and deployment.

This topic shows how to use n8n to build a Chat-to-OceanBase workflow: a template that lets users query your OceanBase database through natural language.

Prerequisites

  • You have deployed OceanBase Database and created a MySQL-compatible tenant.

  • This integration is demonstrated in a Docker environment. Ensure you have Docker installed and running.

Step 1: Get database connection details

Obtain the database connection string from your OceanBase deployment team or administrator. For example:

obclient -h$host -P$port -u$user_name -p$password -D$database_name

Parameters:

  • $host: The IP address for connecting to OceanBase. When using OceanBase Database Proxy (ODP), use the ODP address. For direct connection, use the IP of an OBServer node.

  • $port: The connection port. ODP uses 2883 by default (configurable at ODP deployment). Direct connection uses 2881 by default (configurable at OceanBase deployment).

  • $database_name: The name of the database you want to use.

    Notice

    The user that connects to the tenant must have CREATE, INSERT, DROP, and SELECT privileges on that database.

  • $user_name: The tenant account. For ODP: username@tenant#cluster or cluster:tenant:username. For direct connection: username@tenant.

  • $password: The account password.

Step 2: Create a test table and insert data

Before building the workflow, create an example table in OceanBase to store book data and insert sample rows.

CREATE TABLE books (
    id VARCHAR(255) PRIMARY KEY,
    isbn13 VARCHAR(255),
    author TEXT,
    title VARCHAR(255),
    publisher VARCHAR(255),
    category TEXT,
    pages INT,
    price DECIMAL(10,2),
    format VARCHAR(50),
    rating DECIMAL(3,1),
    release_year YEAR
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'database-internals',
    '978-1492040347',
    '"Alexander Petrov"',
    'Database Internals: A deep-dive into how distributed data systems work',
    'O\'Reilly',
    '["databases","information systems"]',
    350,
    47.28,
    'paperback',
    4.5,
    2019
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'designing-data-intensive-applications',
    '978-1449373320',
    '"Martin Kleppmann"',
    'Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems',
    'O\'Reilly',
    '["databases"]',
    590,
    31.06,
    'paperback',
    4.4,
    2017
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'kafka-the-definitive-guide',
    '978-1491936160',
    '["Neha Narkhede", "Gwen Shapira", "Todd Palino"]',
    'Kafka: The Definitive Guide: Real-time data and stream processing at scale',
    'O\'Reilly',
    '["databases"]',
    297,
    37.31,
    'paperback',
    3.9,
    2017
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'effective-java',
    '978-1491936160',
    '"Joshua Block"',
    'Effective Java',
    'Addison-Wesley',
    '["programming languages", "java"]',
    412,
    27.91,
    'paperback',
    4.2,
    2017
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'daemon',
    '978-1847249616',
    '"Daniel Suarez"',
    'Daemon',
    'Quercus',
    '["dystopia","novel"]',
    448,
    12.03,
    'paperback',
    4.0,
    2011
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'cryptonomicon',
    '978-1847249616',
    '"Neal Stephenson"',
    'Cryptonomicon',
    'Avon',
    '["thriller", "novel"]',
    1152,
    6.99,
    'paperback',
    4.0,
    2002
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'garbage-collection-handbook',
    '978-1420082791',
    '["Richard Jones", "Antony Hosking", "Eliot Moss"]',
    'The Garbage Collection Handbook: The Art of Automatic Memory Management',
    'Taylor & Francis',
    '["programming algorithms"]',
    511,
    87.85,
    'paperback',
    5.0,
    2011
);

INSERT INTO books (
    id, isbn13, author, title, publisher, category, pages, price, format, rating, release_year
) VALUES (
    'radical-candor',
    '978-1250258403',
    '"Kim Scott"',
    'Radical Candor: Be a Kick-Ass Boss Without Losing Your Humanity',
    'Macmillan',
    '["human resources","management", "new work"]',
    404,
    7.29,
    'paperback',
    4.0,
    2018
);

Step 3: Deploy the tools

Deploy n8n (self-hosted)

n8n is a Node.js-based workflow automation platform with many integrations and extensibility. Self-hosting n8n gives you control over the runtime and keeps your data on your own infrastructure. To run n8n in Docker:

sudo docker run -d   --name n8n   -p 5678:5678   -e N8N_SECURE_COOKIE=false   n8nio/n8n

Deploy the Qwen3 model with Ollama

Ollama is an open-source AI model server that supports multiple models. Using Ollama, you can run the Qwen3 model locally to power your AI agent. To run Ollama in Docker and pull Qwen3:

# Run Ollama in Docker
sudo docker run -d  -p 11434:11434 --name ollama ollama/ollama
# Pull and run the Qwen3 model
sudo docker exec -it ollama sh -c 'ollama run qwen3:latest'

Step 4: Build the AI Agent workflow

n8n provides nodes that you can combine into an AI Agent workflow. This section walks through building a Chat-to-OceanBase template by adding five nodes.

  1. Add a trigger.

    Add an HTTP Request trigger node to receive incoming HTTP requests.

    4-1

  2. Add an AI Agent node.

    Add an AI Agent node to handle the agent logic.

    4-2

  3. Add an Ollama Chat Model node.

    You can choose from several free models. This example uses Qwen3. After selecting the model, configure the Ollama account.

    4-3

    4-4

  4. Add a Simple Memory node.

    The Simple Memory node provides short-term context: it keeps the last five exchanges in the conversation.

    4-5

  5. Add a Tool node.

    The Tool node runs database operations against OceanBase. Under AI agent-tool, add a MySQL tool.

    4-6

    Configure the MySQL tool as follows:

    4-7

    Click the Edit icon shown above and enter your MySQL (OceanBase) connection details.

    4-8

    After saving, you can click Test step in the top-right of the configuration panel to run a simple SQL test, or click Back to canvas to return to the workflow.

  6. Save the workflow.

    Once all five nodes are configured, save the workflow. You can then test it.

    4-9

Workflow overview

The completed workflow looks like this:

0

Previous topic

Dify
Last

Next topic

Trae
Next
on this page
Prerequisites
Step 1: Get database connection details
Step 2: Create a test table and insert data
Step 3: Deploy the tools
Deploy n8n (self-hosted)
Deploy the Qwen3 model with Ollama
Step 4: Build the AI Agent workflow
Workflow overview