Skip to content

Task State

Task State is a collection of Key-Value pairs stored against a task. Initial values can be set in a task definition, then values can be updated for a specific task instance using mutations or via the JSON Patch API.

Updating State with a Mutation

If you wanted to update a state property called your-state-property for a task, you could use a mutation like this:

json
[{
   "op": "add",
   "path": "/state/your-state-proprty",
   "value": "{{ updateContext.your-new-value }}"
}]

This would rely on the context of the event that triggers your mutation looking something like this:

xml
<xml><your-new-value>example value</your-new-value></xml>

For more information about mutations, see this page