Architecture • Execution • Infrastructure

Kiến trúc tổng thể của IAI Flow

IAI Flow được thiết kế như một AI workflow & automation orchestration platform thống nhất. Hệ thống này kết hợp visual builder, execution runtime, queue, scheduler, logs, metrics, node ecosystem và agent orchestration trong cùng một nền tảng.

Kiến trúc nhiều lớp

IAI Flow không được xây như một website đơn giản. Nó là một hệ điều phối nhiều lớp, trong đó UI, runtime, queue và orchestration engine phải hoạt động thống nhất.

1. Application Layer

Phần người dùng nhìn thấy và thao tác trực tiếp. Bao gồm dashboard, workflow builder, runtime monitor, logs viewer, module explorer và agent interface.

2. Execution Layer

Phần chịu trách nhiệm thực thi workflow, chạy node, quản lý retry, branch, parallel path và output của từng run.

3. Coordination Layer

Phần điều phối nhiều execution cùng lúc bằng queue và scheduler để workflow có thể chạy phân tán và ổn định ở production scale.

4. Data Layer

Lưu workflow definitions, run history, logs, metrics, schedules, execution states và các artifacts cần thiết để platform hoạt động lâu dài.

5. AI Layer

Cho phép workflow gọi AI nodes, agent tools, memory systems và các lớp intelligence để chuyển từ automation sang AI-native execution.

6. Platform Layer

Là nơi chứa auth, projects, permissions, API keys, secrets, audit trail và các chuẩn production cho toàn bộ hệ sinh thái.

Luồng thực thi chuẩn

Một workflow trong IAI Flow phải đi qua một execution pipeline rõ ràng thay vì chạy mơ hồ trong browser.

Definition Workflow được thiết kế, lưu và version hóa.
Validation Node graph, config, contract và input được kiểm tra.
Queue Execution được enqueue để đảm bảo orchestration chuẩn.
Runtime Engine claim job, tạo run state và bắt đầu thực thi từng node.
Observability Logs, metrics, status, output và traces được ghi lại.

Trạng thái một workflow run

State machine rõ ràng là điều bắt buộc để platform có thể đi lên production.

draft Workflow hoặc run mới được tạo nhưng chưa enqueue.
queued Đã vào queue và chờ claim bởi execution runtime.
claimed Một worker hoặc coordinator đã claim execution.
running Workflow đang chạy node theo execution graph.
waiting / retrying Workflow đang chờ delay, retry, approval hoặc wake-up signal.
completed / failed / cancelled Run kết thúc với output, lỗi hoặc bị dừng chủ động.

Production Runtime

IAI Flow được thiết kế để chạy ổn định ở production scale với API layer, execution engine và data layer phân tách rõ ràng.

flow.iai.one ↳ Frontend application, builder UI và dashboard api.flow.iai.one ↳ REST API layer, orchestration routes và runtime interface Execution Engine ↳ Workflow executor, node runtime, retry, parallel execution Data Layer ↳ Workflow definitions, runs, logs, metrics, schedules và state AI Layer ↳ Claude integration, agent tools, memory và prompt orchestration Infrastructure Layer ↳ Cloudflare Workers, Durable Objects, D1, KV, R2

Tầm nhìn kiến trúc dài hạn

IAI Flow được xây để đi từ visual builder ban đầu lên một AI Workflow Operating System. Trục phát triển dài hạn gồm workflow runtime production, distributed queue, scheduler, AI agent nodes, memory systems và operations UI thống nhất.