System Overview
An F&B manufacturing business in Ho Chi Minh City processes 100+ orders/day across multiple channels: retail, wholesale, and supermarket. Initial challenges: manual data entry, error risks, and lack of failover mechanism when automation systems encounter issues.
Solution: A clearly decoupled 3-layer architecture:
- Data Layer: LarkBase as relational core (single source of truth)
- Automation Layer: n8n workflow handling orders via chat messages
- Interface Layer: Astro Admin as failover channel + extensible module platform
Layer 1: Interface & Input
Layer 2: Automation
Layer 3: Data Core
Data Layer: LarkBase as Relational Core
The system was built from scratch with 15+ interconnected tables, including: products, customers, promotions, routes, orders (master), order details, inventory, production, and reporting.
Schema Design Principles
- 3rd Normal Form: Avoid data duplication, ensure integrity
- Explicit foreign keys: Every relationship clearly defined for easy tracing
- Strategic indexing: Optimize queries for real-time dashboards
Automation Layer: 29-Node n8n Workflow
This workflow handles the flow: Lark Messenger → Validate → Write to DB → Reply confirmation.
Operational Mechanism (Zero AI Parsing)
- User sends message in standard format:
ORDER|CUST_ID|PROD_CODE|QTY - n8n webhook receives payload, validates via Function node
- Writes to 2 tables:
orders(master) +order_details(child) - Sends confirmation message with order ID back to chat
Technical Differentiators
- Zero AI dependency: Rule-based validation, no LLM parsing → deterministic, easy to debug
- Explicit error handling: Each node has retry logic + fallback notification
- Centralized logging: Every step logged for traceability
Interface Layer: Astro Admin (Failover Channel)
When n8n/VPS encounters issues, Astro Admin serves as a failover channel to ensure business continuity.
Phase 1 Features (Implemented)
- Auth system: 5 users (1 admin + 4 staff), role-based access control
- Order form: Simple UI, client-side + server-side validation
- Direct sync: Writes directly to LarkBase, no middleware
Phase 2+ Roadmap
- Production management module: Track progress, raw material inventory
- Inventory reconciliation dashboard: Real-time visualization
- Reporting engine: PDF/Excel export, scheduled delivery
Lesson: Failover Design Pattern
Why Three Order Entry Paths?
| Path | Mechanism | Pros | Cons | Use Case |
|---|---|---|---|---|
| Native LarkBase Form | Manual entry: orders → order_details | Built-in, no setup | Time-consuming, error-prone | Data correction |
| n8n + Lark Messenger | 1 message = auto-create 2 tables | Fast, natural UX | Depends on VPS/n8n | Daily operations |
| Astro Admin Form | Form web → direct LarkBase write | Static hosting, fewer failures | Slower than chat | Failover when n8n down |
Native LarkBase form requires multi-step manual entry:
1. Go to
orders table → create new record → copy order ID2. Go to
order_details table → create record for product 1 + paste order ID3. Repeat step 2 for products 2, 3...
The n8n workflow consolidates this into 1 chat message → auto-creates master + N child records → reduces manual steps by ~90%.
Conclusion & Next Steps
Key Takeaways
- Clear layer separation enables easier maintenance and scalability
- Failover design is essential for critical business operations
- No-code + code hybrid (n8n + Astro) balances speed and flexibility
Next Roadmap
- Reporting module: PDF export, scheduled email delivery
- Alerting system: Telegram/Zalo notifications for threshold breaches
- Payment gateway integration: Sync with fulfilled orders