Inline Symbols
Inline symbols indicate references within a line.
@ (Actor)
Reference to a machine/actor:
flow
machine: @order
on :checkout from @customer (api)
emit :request to @payment: (Event)
Reference to an event:
flow
on :checkout from @customer (api)
emit :payment_request to @payment
on :payment_success from @payment# (State)
Reference to a machine state:
flow
order moves to #pending
? order is in #paid
order transitions to #completed$ (Context Variable)
Reference to context data:
flow
$total becomes 100
$items adds "Laptop"
? $total > 0With type annotation:
flow
$total: number becomes 100
$items: array adds "Laptop"Type Annotations
Optional types for context variables:
| Type | Description | Example |
|---|---|---|
string | Text values | $name: string becomes "John" |
number | Integers and decimals | $total: number becomes 100 |
boolean | True/false | $active: boolean becomes true |
array | List of items | $items: array becomes empty |
object | Key-value pairs | $config: object becomes empty |
^ (Binding Transformer)
Reference to a binding transformer for complex response transformations:
flow
on :get_order_report from @admin (api)
reply 200 with ^order_reportBinding transformers:
- Execute code that transforms response data
- Handle complex business logic not expressible in EventFlow
- Map to PHP/JS classes with the
#[ResponseTransformer]attribute
php
#[ResponseTransformer('order_report')]
class OrderReportTransformer {
public function transform(Context $context): array {
return [
'summary' => $this->buildSummary($context),
'charts' => $this->generateChartData($context),
];
}
}See Machine Responses for details.