n8n

🇹🇭 ภาษาไทย

n8n คืออะไร

n8n (อ่านว่า “n-eight-n”) คือเครื่องมือ workflow automation แบบ fair-code license — ไม่ใช่ open source เต็มรูปแบบ และไม่ใช่ซอฟต์แวร์เชิงพาณิชย์ทั่วไป แต่เป็นแบบ “source available” คือดูโค้ดได้ แต่มีข้อจำกัดด้านการใช้เชิงพาณิชย์

n8n ช่วยให้สามารถ:

  • เชื่อมต่อแอปใดก็ได้ที่มี API เข้าหากัน
  • จัดการและแปลงข้อมูลโดยเขียนโค้ดน้อยหรือไม่ต้องเขียนเลย
  • สร้าง AI workflows โดยผสาน LLM และ tools เข้าไปในกระบวนการทางธุรกิจ

เวอร์ชันปัจจุบัน: 2.17.4 (stable) / 2.18.1 (beta)


Editions (รุ่น)

รุ่นราคาLicense Keyการ Hostหมายเหตุ
Communityฟรีไม่ต้องการSelf-hostedFeatures พื้นฐาน
Businessจ่ายต้องการSelf-hostedFeatures เพิ่มเติม
Enterpriseจ่ายต้องการSelf-hostedFeatures ครบทุกอย่าง
n8n CloudSubscriptionไม่ต้องการManaged (ไม่ต้อง self-host)ไม่ต้องดูแล server

การติดตั้งด้วย Docker (แนะนำ)

วิธีที่แนะนำในการ self-host คือผ่าน Docker

ข้อมูลสำคัญ:

  • Port ที่ใช้: 5678
  • Data volume: n8n_data/home/node/.n8n
  • ฐานข้อมูลเริ่มต้น: SQLite (เก็บใน volume อัตโนมัติ)
  • รองรับ PostgreSQL ผ่าน environment variables หากต้องการ DB ที่แข็งแกร่งกว่า
  • Docker Compose files: github.com/n8n-io/n8n-hosting

Environment Variables สำคัญ:

ตัวแปรความหมาย
TZTimezone ของระบบ
GENERIC_TIMEZONETimezone สำหรับ Schedule Trigger node

คำสั่ง Docker เริ่มต้น:

# สร้าง volume สำหรับเก็บข้อมูล
docker volume create n8n_data
 
# รัน n8n
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -e TZ="Asia/Bangkok" \
  -e GENERIC_TIMEZONE="Asia/Bangkok" \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

การอัปเดต:

docker pull docker.n8n.io/n8nio/n8n
# แล้ว restart container

หมายเหตุ: การ self-host ต้องการความรู้ด้าน server, containers, security, และ scaling


Integrations — Nodes (การเชื่อมต่อ)

n8n เรียก integration แต่ละอันว่า node — คือ building block ของ workflow

ประเภทของ Nodes:

ประเภทคำอธิบาย
Built-in nodesหลายร้อย integrations สำเร็จรูป
Community nodesติดตั้งจาก npm โดยชุมชน
Credential-only nodesสำหรับ auth credentials เท่านั้น ใช้ร่วมกับ HTTP Request node
HTTP Request nodeเชื่อมต่อ API ใดก็ได้ที่ไม่มี dedicated node
Custom nodesพัฒนาเองและ publish ขึ้น npm ได้

หมวดหมู่ Node ใน Workflow:

  • Core nodes — logic และ utility หลัก
  • Actions — ทำ action กับ service ภายนอก
  • Triggers — จุดเริ่มต้นของ workflow

Core Node Types สำคัญ:

Nodeฟังก์ชัน
HTTP Requestเรียก API ภายนอก
Webhookรับ HTTP callbacks จากระบบอื่น
Codeเขียน JavaScript หรือ Python
Schedule Triggertrigger ตามเวลา (cron-style)
If / Switchflow control แบบเงื่อนไข
Mergeรวมข้อมูลจากหลาย branch
Chat Triggertrigger workflow จาก chat interface

Advanced AI — LangChain Integration

ตั้งแต่ version 1.19.4 n8n รองรับ AI workflows ผ่าน LangChain framework

สถาปัตยกรรม Cluster Nodes:

  • Root node — AI Agent, Basic LLM Chain, Chat Memory Manager, ฯลฯ
  • Sub-nodes — ขยาย functionality ของ root node (เชื่อม LLM, memory, tools)

เครื่องมือ AI ที่น่าสนใจ:

  • Chat Trigger — เริ่ม workflow จาก chat interface
  • @n8n/chat — npm package สำหรับ embed chatbot widget บน frontend
  • AI Starter Kit — bundle ของ n8n + AI products ที่ compatible สำหรับ self-host
  • Templates — เลือก AI workflow สำเร็จรูปได้ที่ n8n.io/workflows/?categories=25

Code ใน n8n

n8n เป็น low-code tool — ทำได้เกือบทุกอย่างโดยไม่ต้องเขียนโค้ด แต่เพิ่มโค้ดได้เมื่อจำเป็น:

  • Expressions — JavaScript inline ใน node fields; เข้าถึงข้อมูลและ built-in variables ของ n8n
  • Code node — เขียน JavaScript หรือ Python script เต็มรูปแบบภายใน workflow

Public REST API

  • ไม่พร้อมใช้งานในช่วง free trial — ต้องใช้แผน paid
  • ทำงานเดียวกับ GUI ได้ผ่าน API
  • Self-hosted มี built-in API playground
  • มี n8n API node สำหรับเรียกใช้ API ภายใน workflow ตัวเอง

Scaling & Security

Scaling:

  • Queue mode สำหรับ high-availability setup
  • ปรับแต่งได้ผ่าน environment variables

Security:

  • รองรับ SSL configuration
  • SSO (Single Sign-On)
  • 2FA (Two-Factor Authentication)
  • Self-host เพื่อ data privacy สูงสุด

Use Cases ที่เกี่ยวข้องกับ Wiki นี้

  • รับ webhook events จาก Yeastar P-Series API → trigger CRM actions อัตโนมัติ
  • รับ IoT event data จาก Dahua.Api → สร้าง attendance report pipeline
  • สร้าง AI workflows: Chat Trigger + LLM + Tools ด้วย LangChain (ดู LLM Wiki Pattern)
  • ทำ API integrations โดยไม่ต้องเขียน backend code เต็มรูปแบบ
  • ใช้คู่กับ BLEAF ในระบบ enterprise เพื่อ automate e-Form และ workflow notifications

🇬🇧 English

What is n8n

n8n (pronounced “n-eight-n”) is a fair-code licensed workflow automation tool. This means it is neither fully open source nor a traditional commercial product — the source code is available to view, but commercial use carries restrictions.

n8n enables you to:

  • Connect any application that has an API to any other
  • Manipulate and transform data with little or no code
  • Build AI-powered workflows by embedding LLMs and tools into business processes

Current version: 2.17.4 (stable) / 2.18.1 (beta)


Editions

EditionCostLicense KeyHostingNotes
CommunityFreeNot requiredSelf-hostedBasic features
BusinessPaidRequiredSelf-hostedExtended features
EnterprisePaidRequiredSelf-hostedFull feature set
n8n CloudSubscriptionNot requiredManaged (no self-hosting)No server management needed

The recommended method to self-host n8n is via Docker.

Key configuration details:

  • Port: 5678
  • Data volume: n8n_data/home/node/.n8n
  • Default database: SQLite (stored automatically in the volume)
  • PostgreSQL is available as an alternative via environment variables for production workloads
  • Docker Compose files: github.com/n8n-io/n8n-hosting

Key Environment Variables:

VariablePurpose
TZSystem timezone
GENERIC_TIMEZONETimezone for the Schedule Trigger node

Docker Quickstart Commands:

# Create a persistent data volume
docker volume create n8n_data
 
# Run n8n
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -e TZ="Asia/Bangkok" \
  -e GENERIC_TIMEZONE="Asia/Bangkok" \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Updating n8n:

docker pull docker.n8n.io/n8nio/n8n
# Then restart the container

Note: Self-hosting requires technical expertise in servers, containers, security, and scaling.


Integrations — Nodes

n8n refers to each integration as a node — the fundamental building block of a workflow.

Node Types:

TypeDescription
Built-in nodesHundreds of pre-built integrations
Community nodesInstallable from npm, maintained by the community
Credential-only nodesProvide auth credentials only; used with the HTTP Request node
HTTP Request nodeConnect to any API that lacks a dedicated node
Custom nodesBuild your own and publish to npm

Node Categories in a Workflow:

  • Core nodes — core logic and utility operations
  • Actions — perform actions against external services
  • Triggers — entry points that start a workflow

Important Core Node Types:

NodeFunction
HTTP RequestCall external APIs
WebhookReceive HTTP callbacks from other systems
CodeWrite JavaScript or Python
Schedule TriggerTime-based triggers (cron-style)
If / SwitchConditional flow control
MergeCombine data from multiple branches
Chat TriggerTrigger workflows from a chat interface

Advanced AI — LangChain Integration

From version 1.19.4, n8n supports AI workflows built on the LangChain framework.

Cluster Nodes Architecture:

  • Root node — AI Agent, Basic LLM Chain, Chat Memory Manager, etc.
  • Sub-nodes — extend root node functionality by connecting LLMs, memory stores, and tools

AI Tools of Interest:

  • Chat Trigger — Start a workflow from a chat interface
  • @n8n/chat — npm package to embed a chatbot widget on a frontend
  • AI Starter Kit — Self-hosted bundle packaging n8n together with compatible AI products
  • Templates — Browse ready-made AI workflows at n8n.io/workflows/?categories=25

Code in n8n

n8n is a low-code tool — most things can be done without writing code, but code can be added when needed:

  • Expressions — Inline JavaScript in node fields; access data, transform values, and use n8n’s built-in variables
  • Code node — Write full JavaScript or Python scripts directly inside the workflow

Public REST API

  • Not available during free trial — requires a paid plan
  • Enables programmatic control of the same actions available in the GUI
  • Self-hosted instances include a built-in API playground
  • The n8n API node allows workflows to call the n8n API from within themselves

Scaling & Security

Scaling:

  • Queue mode for high-availability deployments
  • Full configuration through environment variables

Security:

  • SSL configuration support
  • SSO (Single Sign-On)
  • 2FA (Two-Factor Authentication)
  • Self-hosting provides maximum data privacy

Use Cases Relevant to This Wiki

  • Receive webhook events from Yeastar P-Series API and trigger downstream CRM actions automatically
  • Consume IoT event data from Dahua.Api to build attendance reporting pipelines
  • Construct AI workflows combining Chat Trigger + LLM + Tools via LangChain (see LLM Wiki Pattern)
  • Build API integrations without writing full backend service code
  • Operate alongside BLEAF in an enterprise context to automate e-Form notifications and workflow routing