# Tutorial 8: Expressions The expression system enables declarative logic that compiles to portable canonical JSON. All expressions are evaluable at runtime without recompilation. ## Path Navigation | Prefix | Source | Example | |--------|--------|---------| | `start.*` | Start request fields | `start.policyId` | | `state.*` | Mutable workflow state | `state.customerName` | | `payload.*` | Task completion payload | `payload.answer` | | `result.*` | Step result (by resultKey) | `result.productInfo.lob` | ## Built-in Functions | Function | Description | Example | |----------|-------------|---------| | `coalesce` | First non-null | `coalesce(state.id, start.id, 0)` | | `concat` | String join | `concat("Policy #", state.policyNo)` | | `add` | Sum | `add(state.attempt, 1)` | | `if` | Conditional | `if(state.isVip, "VIP", "Standard")` | | `isNullOrWhiteSpace` | Null/empty check | `isNullOrWhiteSpace(state.name)` | | `length` | String/array length | `length(state.items)` | | `upper` | Uppercase | `upper(state.annexType)` | | `first` | First array element | `first(state.objects)` | | `mergeObjects` | Deep merge | `mergeObjects(state, payload)` | ## Variants - [C# Expression Builder](csharp/) - [JSON Expression Format](json/) ## Next [Tutorial 9: Testing](../09-testing/) — unit test setup with recording transports.