Learn Aexol by building a complete e-commerce specification from scratch. By the end, you'll understand types, visitors, workflows, and agents.
Start with the data structures your system needs. Aexol types are like TypeScript interfaces — they define fields with types.
type Product {
id: string
name: string
price: number
inStock: boolean
}
type Order {
id: string
customerId: string
items: OrderItem[]
total: number
}
type OrderItem {
productId: string
quantity: number
}
✨ Edit in StudioWhat you just learned:
string, number, boolean built-in typescustomerId: string, items: OrderItem[])[]Enums define fixed sets of values. Add order status and payment status:
enum OrderStatus {
pending
confirmed
shipped
delivered
cancelled
}
enum PaymentMethod {
credit_card
paypal
bank_transfer
}
✨ Edit in StudioUpdate your Order type to use the enum:
type Order {
id: string
customerId: string
status: OrderStatus
paymentMethod: PaymentMethod
items: OrderItem[]
total: number
}
✨ Edit in StudioWhat you just learned:
Workflows define state machines — how entities move from state to state:
workflow OrderFlow {
initial: pending
pending -> confirmed when payment_received
pending -> cancelled
confirmed -> shipped when packed
shipped -> delivered when customer_receives
shipped -> cancelled when return_requested
}
✨ Edit in StudioWhat you just learned:
initial: marks the starting statewhen clauses make transitions conditionalVisitors define capability hierarchies — what different roles can do:
visitor Customer {
"browse products"
"place order" {
"view own orders"
"cancel own order"
}
"manage account" {
"view profile"
"update profile"
"view payment methods"
}
}
visitor Admin {
"manage products" {
"add product"
"edit product"
"remove product"
}
"manage orders" {
"view all orders"
"update order status"
"issue refund"
}
"view reports"
}
✨ Edit in StudioWhat you just learned:
"manage account" contains sub-capabilities"view own orders", you need access through
"place order"Agents define autonomous entities that perform tasks:
agent InventoryBot {
"check stock levels"
"alert low stock"
"auto-reorder"
}
agent NotificationService {
"send order confirmation"
"send shipping update"
"send delivery notification"
}
agent PaymentProcessor {
"validate payment"
"process charge"
"issue refund"
"send receipt"
}
✨ Edit in StudioWhat you just learned:
Here's the complete e-commerce spec:
type Product {
id: string
name: string
price: number
inStock: boolean
category: string
}
type Order {
id: string
customerId: string
status: OrderStatus
paymentMethod: PaymentMethod
items: OrderItem[]
total: number
createdAt: string
}
type OrderItem {
productId: string
quantity: number
price: number
}
enum OrderStatus {
pending
confirmed
shipped
delivered
cancelled
}
enum PaymentMethod {
credit_card
paypal
bank_transfer
}
workflow OrderFlow {
initial: pending
pending -> confirmed when payment_received
pending -> cancelled
confirmed -> shipped when packed
shipped -> delivered when customer_receives
shipped -> cancelled when return_requested
}
visitor Customer {
"browse products"
"place order" {
"view own orders"
"cancel own order"
}
"manage account" {
"view profile"
"update profile"
"view payment methods"
}
}
visitor Admin {
"manage products" {
"add product"
"edit product"
"remove product"
}
"manage orders" {
"view all orders"
"update order status"
"issue refund"
}
"view reports"
}
agent InventoryBot {
"check stock levels"
"alert low stock"
"auto-reorder"
}
agent NotificationService {
"send order confirmation"
"send shipping update"
"send delivery notification"
}
agent PaymentProcessor {
"validate payment"
"process charge"
"issue refund"
"send receipt"
}
✨ Edit in Studio| You can now... | Using... |
|---|---|
| Generate code from this spec | Studio → Code Generation or Remote MCP |
| Add advanced types (circular refs, multi-dim arrays) | Advanced Type Features |
| Explore more workflow patterns | Workflow Recipes |
| See the complete syntax | Language Reference |
| Integrate with your editor | Working with AI & IDEs |
initial, when, and transitionsBuild your spec, validate with Studio or the CLI, then generate production-ready code.