Each trace has a state object which contains the business data but also metadata about the trace’s lifecycle.The state object can be accessed in the effects via dsl.$variables.state and has the following properties:
The dsl.$variables.state.data property is an object that holds the business data for the trace,
structured according to the workflow’s specifications.The data are updated by the effects of each action and is usually used to display
the trace’s data in the workflow overview table and trace infos.
The dsl.$variables.state.nextActions property defines which actions are available for each group.
It is defined as a map between a group label and a list of actions keys.
Typescript
Copy
type NextActions< GroupLabel extends string, ActionKey extends string> = { [key in GroupLabel]?: ActionKey[];};
The dsl.$variables.state.tasks property, also referred to as priorities, defines which next actions are the most relevant for a group.
When a group has a next priority action defined, it will be displayed in the Trace UI homepage.
Copy
{ ... tasks: { groups: { cook: { // the group label responsibility: 1, todo: ['cookOrder'] // the next priority } }, deadlines: [ { date: '2025-11-20' // optional deadline } ] } ...};
The read-only dsl.$variables.meta object contains metadata about the trace, as well as the last performed action.
It is automatically generated before effects are applied and can not be modified.It’s usually used to get context about the trace in the effects or to display information using widgets.