op: set
Set a field to a value, overwriting any existing value.
Allowed phases
| Phase | Status |
|---|---|
preflight | ✗ forbidden |
core | ✓ allowed |
side_effects | ✗ forbidden |
Syntax
- op: set
path: /status
value: purchased
- op: set
path: /cart/total
value: "sum(map(entity.cart.items ?: [], 'quantity * price')) ?: 0"Parameters
| Field | Required | Description |
|---|---|---|
path | yes | Field path in slash notation (/cart/total) |
value | yes | Literal or expression string |
if_missing | no | create (default), fail, or skip when path does not exist |
target_stream | no | Cross-stream write — avoid; prefer submit in side_effects |
target_entity | no | Entity ID expression when using target_stream |
Behavior
- Runs in core only. Direct cross-stream
setis discouraged — usesubmitto invoke an action on the target entity. - Nested object paths use slash notation in
pathand dot notation in expressions (entity.cart.total). - Use
if_missing: failwhen the field must already exist;skipto no-op when absent.
Related operations
See also
- Operations index — all ops by phase
- actions — rule structure and phases
- Intents: Rules — narrative examples