Ready-to-use Aexol patterns for common development scenarios. Copy and adapt these recipes to jumpstart your projects.
Each recipe shows a complete Aexol spec — types, enums, workflows, visitors, and agents. Use them as:
type Task {
id: string
title: string
description: string
status: TaskStatus
assigneeId: string
}
enum TaskStatus {
todo
in_progress
done
}
workflow TaskFlow {
initial: todo
todo -> in_progress
in_progress -> done
in_progress -> todo when reverted
}
visitor TaskManager {
"create tasks"
"view tasks"
"edit tasks"
"delete tasks"
"assign tasks"
}
visitor TeamMember {
"view tasks"
"update own tasks"
}
✨ Edit in StudioUse case: Project management, issue tracking, task boards
type Order {
id: string
customerId: string
items: OrderItem[]
total: number
status: OrderStatus
}
type OrderItem {
productId: string
quantity: number
price: number
}
enum OrderStatus {
pending
payment_received
processing
shipped
delivered
cancelled
}
workflow OrderProcessing {
initial: pending
pending -> payment_received when payment_confirmed
payment_received -> processing
processing -> shipped when items_packed
shipped -> delivered when customer_confirms
pending -> cancelled when timeout
payment_received -> cancelled when refund_requested
}
visitor Customer {
"create orders"
"view own orders"
"cancel own pending orders"
}
visitor Merchant {
"view all orders"
"process orders"
"update order status"
"handle refunds"
}
agent OrderProcessor {
"validate order"
"process payment"
"notify customer"
"update inventory"
}
✨ Edit in StudioUse case: Online stores, marketplaces, subscription services
type Document {
id: string
title: string
content: string
authorId: string
status: DocumentStatus
reviewers: string[]
}
enum DocumentStatus {
draft
pending_review
approved
rejected
published
}
workflow DocumentApproval {
initial: draft
draft -> pending_review when submitted
pending_review -> approved when all_reviewers_approve
pending_review -> rejected when reviewer_rejects
rejected -> draft when author_revises
approved -> published when author_publishes
}
visitor Author {
"create documents"
"edit own draft documents"
"submit for review"
"revise rejected documents"
}
visitor Reviewer {
"view pending documents"
"approve documents"
"reject documents"
"add comments"
}
visitor Publisher {
"view approved documents"
"publish documents"
"unpublish documents"
}
✨ Edit in StudioUse case: Content management, legal docs, approval flows
type Ticket {
id: string
customerId: string
subject: string
description: string
priority: Priority
status: TicketStatus
assignedTo: string
}
enum Priority { low, medium, high, urgent }
enum TicketStatus {
open
assigned
in_progress
waiting_customer
resolved
closed
}
workflow TicketLifecycle {
initial: open
open -> assigned when agent_assigned
assigned -> in_progress when agent_starts
in_progress -> waiting_customer when info_needed
waiting_customer -> in_progress when customer_responds
in_progress -> resolved when issue_fixed
resolved -> closed when customer_confirms
resolved -> in_progress when customer_reopens
}
visitor Customer {
"create tickets"
"view own tickets"
"respond to tickets"
"close own tickets"
}
visitor Agent {
"view all tickets"
"assign tickets"
"update ticket status"
"respond to tickets"
"resolve tickets"
}
visitor Manager {
"view all tickets"
"reassign tickets"
"view reports"
"manage agents"
}
agent TicketRouter {
"classify ticket"
"assign based on priority"
"escalate urgent tickets"
"send notifications"
}
✨ Edit in StudioUse case: Help desk, customer support, IT ticketing
type User {
id: string
email: string
name: string
status: UserStatus
emailVerified: boolean
profileCompleted: boolean
}
enum UserStatus {
pending
email_sent
email_verified
profile_setup
active
suspended
}
workflow UserOnboarding {
initial: pending
pending -> email_sent when registration_submitted
email_sent -> email_verified when email_confirmed
email_verified -> profile_setup when user_continues
profile_setup -> active when profile_completed
active -> suspended when violation_detected
suspended -> active when appeal_approved
}
visitor NewUser {
"register"
"verify email"
"complete profile"
}
visitor User {
"view own profile"
"update own profile"
"deactivate own account"
}
visitor Admin {
"view all users"
"suspend users"
"activate users"
"delete users"
}
agent OnboardingBot {
"send welcome email"
"send verification email"
"send reminder emails"
"track completion"
}
✨ Edit in StudioUse case: SaaS onboarding, user registration, KYC flows
type Payment {
id: string
orderId: string
amount: number
currency: string
status: PaymentStatus
method: PaymentMethod
}
enum PaymentStatus { pending, processing, succeeded, failed, refunded, disputed }
enum PaymentMethod { credit_card, debit_card, paypal, bank_transfer }
workflow PaymentFlow {
initial: pending
pending -> processing when payment_submitted
processing -> succeeded when payment_confirmed
processing -> failed when payment_declined
failed -> pending when retry_allowed
succeeded -> refunded when refund_issued
succeeded -> disputed when customer_disputes
}
visitor Customer {
"submit payments"
"view own payments"
"dispute payments"
}
visitor Merchant {
"process payments"
"issue refunds"
"view transactions"
}
agent PaymentProcessor {
"validate payment details"
"charge payment method"
"handle webhooks"
"send receipts"
}
✨ Edit in StudioUse case: Payment gateways, billing systems, transaction processing
type Product {
id: string
name: string
sku: string
quantity: number
status: StockStatus
reorderLevel: number
}
enum StockStatus { in_stock, low_stock, out_of_stock, discontinued }
workflow InventoryManagement {
initial: in_stock
in_stock -> low_stock when quantity_below_threshold
low_stock -> out_of_stock when quantity_zero
out_of_stock -> in_stock when stock_replenished
low_stock -> in_stock when stock_replenished
in_stock -> discontinued when product_discontinued
}
visitor WarehouseManager {
"add products"
"update stock levels"
"set reorder levels"
"discontinue products"
}
visitor PurchasingAgent {
"view low stock items"
"create purchase orders"
"receive inventory"
}
agent StockMonitor {
"check stock levels"
"send low stock alerts"
"auto-create purchase orders"
"notify suppliers"
}
✨ Edit in StudioUse case: Warehouse management, retail inventory, supply chain
type Appointment {
id: string
patientId: string
providerId: string
datetime: string
status: AppointmentStatus
duration: number
}
enum AppointmentStatus {
requested
confirmed
checked_in
in_progress
completed
cancelled
no_show
}
workflow AppointmentFlow {
initial: requested
requested -> confirmed when provider_accepts
requested -> cancelled when patient_cancels
confirmed -> checked_in when patient_arrives
checked_in -> in_progress when appointment_starts
in_progress -> completed when appointment_ends
confirmed -> no_show when patient_absent
confirmed -> cancelled when provider_cancels
}
visitor Patient {
"request appointments"
"view own appointments"
"cancel own appointments"
"check in"
}
visitor Provider {
"view own schedule"
"confirm appointments"
"cancel appointments"
"mark completed"
}
visitor Receptionist {
"view all appointments"
"check in patients"
"reschedule appointments"
"handle walk-ins"
}
agent AppointmentReminder {
"send confirmation"
"send reminder 24h before"
"send reminder 1h before"
"handle responses"
}
✨ Edit in StudioUse case: Healthcare, consulting, service bookings
type Enrollment {
id: string
studentId: string
courseId: string
status: EnrollmentStatus
progress: number
grade: number
}
enum EnrollmentStatus {
pending
active
in_progress
completed
dropped
failed
}
workflow EnrollmentFlow {
initial: pending
pending -> active when payment_received
active -> in_progress when student_starts
in_progress -> completed when all_modules_finished
in_progress -> failed when deadline_passed
active -> dropped when student_withdraws
pending -> dropped when payment_expired
}
visitor Student {
"browse courses"
"enroll in courses"
"view own enrollments"
"drop courses"
"access course materials"
}
visitor Instructor {
"view enrolled students"
"grade assignments"
"post announcements"
"provide feedback"
}
visitor Admin {
"manage courses"
"manage enrollments"
"process refunds"
"generate reports"
}
agent ProgressTracker {
"track completion"
"calculate grades"
"send progress updates"
"award certificates"
}
✨ Edit in StudioUse case: E-learning platforms, training programs, certifications
type Build {
id: string
commitHash: string
branch: string
status: BuildStatus
startTime: string
endTime: string
}
enum BuildStatus {
queued
building
testing
deploying
succeeded
failed
cancelled
}
workflow CICDPipeline {
initial: queued
queued -> building when runner_available
building -> testing when build_succeeds
building -> failed when build_fails
testing -> deploying when tests_pass
testing -> failed when tests_fail
deploying -> succeeded when deploy_succeeds
deploying -> failed when deploy_fails
queued -> cancelled when user_cancels
building -> cancelled when user_cancels
}
visitor Developer {
"trigger builds"
"view build logs"
"cancel builds"
}
visitor DevOps {
"view all builds"
"trigger deployments"
"rollback deployments"
"configure pipelines"
}
agent PipelineRunner {
"checkout code"
"run build commands"
"execute tests"
"deploy artifacts"
"send notifications"
}
✨ Edit in StudioUse case: DevOps automation, continuous delivery, deployment pipelines
| Recipe | States | Roles | Agents | Complexity |
|---|---|---|---|---|
| Todo App | 3 | 2 | — | Beginner |
| E-commerce | 5 + 2 dead-ends | 2 | 1 | Intermediate |
| Document Approval | 4 + 1 loop | 3 | — | Intermediate |
| Support Ticket | 6 + 1 loop | 3 | 1 | Advanced |
| User Onboarding | 5 + 1 recovery | 3 | 1 | Intermediate |
| Payment Processing | 5 + retry loop | 2 | 1 | Intermediate |
| Inventory | 4 + 2 replenish | 2 | 1 | Beginner |
| Appointments | 6 + 2 dead-ends | 3 | 1 | Advanced |
| Course Enrollment | 5 + 2 dead-ends | 3 | 1 | Intermediate |
| CI/CD | 7 + cancel short-circuits | 2 | 1 | Advanced |
Use only necessary states. More states = more complexity.
// ❌ Too many states
enum Status { created, validated, processed, verified, approved, published, archived }
// ✅ Just enough states
enum Status { draft, approved, published }
✨ Edit in StudioUse descriptive names that indicate the state of the entity.
// ❌ Unclear
enum Status { s1, s2, s3 }
// ✅ Clear
enum Status { pending, processing, completed }
✨ Edit in StudioMake transition conditions explicit in your workflow.
workflow OrderFlow {
pending -> processing when payment_confirmed
processing -> shipped when items_ready
processing -> cancelled when out_of_stock
}
✨ Edit in StudioUse different visitors for different roles. Don't give the Customer admin
powers — create a dedicated Admin visitor instead.
visitor Customer {
"view orders"
"create orders"
}
visitor Admin {
"view all orders"
"cancel orders"
"issue refunds"
}
✨ Edit in StudioLet agents handle automated tasks like notifications, monitoring, and scheduled work.
agent NotificationService {
"send email"
"send sms"
"send push notification"
}
✨ Edit in Studio