Aexol Language Reference
Complete syntax reference for the Aexol specification language.
Types
Define data structures with fields. Fields support primitive types, custom types, arrays, and circular references.
type User {
id: string
name: string
email: string
age: number
isActive: boolean
}
✨ Edit in StudioField Types
| Type | Example |
|---|---|
string | name: string |
number | age: number |
boolean | isActive: boolean |
datetime | createdAt: datetime |
| Custom type | author: User |
| Array | tags: string[] |
| Nested array | matrix: number[][] |
Circular References
Types can reference themselves or each other:
type User {
id: string
name: string
posts: Post[]
comments: Comment[]
}
type Post {
id: string
title: string
author: User
comments: Comment[]
}
type Comment {
id: string
text: string
author: User
post: Post
}
✨ Edit in StudioEnums
Define fixed sets of named values:
enum Priority {
low
medium
high
critical
}
enum TaskStatus {
todo
in_progress
done
archived
}
✨ Edit in StudioUse enums as field types:
type Task {
id: string
status: TaskStatus
priority: Priority
}
✨ Edit in StudioVisitors
Visitors define capability hierarchies — what each actor can do in the system. Capabilities are quoted strings:
visitor Admin {
"manage users"
"view reports"
"configure system"
}
✨ Edit in StudioNested Capabilities
Capabilities can be nested to model hierarchical access:
visitor DocumentEditor {
"login" {
"create document"
"edit document"
"delete document"
}
}
✨ Edit in StudioAnonymous Visitor
At most one anonymous visitor (unnamed) is allowed per specification:
visitor {
"view public content"
"search"
}
✨ Edit in StudioRoles
Roles define permission sets with explicit resource access:
role Editor {
permission documents {
create,
read,
update,
delete
}
permission comments {
create,
read,
delete own
}
}
✨ Edit in StudioWorkflows
Workflows define state machines with transitions between states. Use the initial keyword to set the starting state:
workflow OrderFlow {
initial: pending
pending -> processing when payment_confirmed
processing -> shipped when items_packed
shipped -> delivered when customer_confirms
pending -> cancelled when timeout
}
✨ Edit in StudioTransition Conditions
Add when clauses to transitions:
workflow ArticleFlow {
initial: draft
draft -> review when submitted
review -> published when approved
review -> draft when changes_requested
published -> archived when deprecated
}
✨ Edit in StudioMultiple Transitions
A state can transition to multiple targets:
workflow PaymentFlow {
initial: pending
pending -> authorized
pending -> failed
authorized -> captured
authorized -> voided
captured -> completed
captured -> refunded
}
✨ Edit in StudioAgents
Agents define autonomous entities with capabilities:
agent NotificationService {
"send email"
"send sms"
"send push notification"
}
✨ Edit in StudioAgents can be associated with roles:
agent ContentProcessor: Editor {
"fetch document"
"process content"
"publish document"
}
✨ Edit in StudioComplete Example
type User {
id: string
email: string
name: string
role: UserRole
posts: Post[]
}
enum UserRole {
admin
editor
viewer
}
type Post {
id: string
title: string
content: string
status: PostStatus
author: User
comments: Comment[]
tags: string[]
}
enum PostStatus {
draft
review
published
archived
}
workflow PostFlow {
initial: draft
draft -> review when submitted
review -> published when approved
review -> draft when changes_requested
published -> archived when deprecated
}
visitor Admin {
"manage users"
"manage all posts"
"configure system"
}
visitor Editor {
"create posts"
"edit own posts"
"submit for review"
}
visitor Viewer {
"view published posts"
"add comments"
}
agent PublicationBot {
"schedule posts"
"notify reviewers"
"archive old posts"
}
✨ Edit in StudioValidation Rules
The Aexol validator checks:
- ✅ Unique type, visitor, agent, role, and workflow names
- ✅ At most one anonymous visitor
- ✅ All type references resolve to existing types
- ✅ Workflow states reference defined states
- ✅ Valid capability verbs
- ✅ No circular references in required fields
See Also
- Advanced Types — Arrays, circular references, and complex structures
- Workflows & Recipes — Workflow patterns and real-world recipes
- CLI & Tooling — Command-line tools
- API Reference — Programmatic API