Adds a new item to a list in the Agent’s state. Useful for tracking multiple values over time.Documentation Index
Fetch the complete documentation index at: https://dev.writer.com/llms.txt
Use this file to discover all available pages before exploring further.

Overview
This block adds a string value to a list in the agent’s state. It behaves differently depending on the state element’s type:- If the state element doesn’t already exist, the block creates it and adds the value to it.
- If the state element already exists as a list, the block adds the value to the list.
- If the state element exists but isn’t a list, the block fails.
Example
The following example shows an Add to state list block as part of a For-each workflow.
text_gen_results.
On the initial run, the Add to state list block creates the state element and adds the first value to it. Every subsequent run, the block adds the next value to the list.
Fields
| Name | Type | Control | Default | Description | Options | Validation |
|---|---|---|---|---|---|---|
| Link Variable | Binding | - | - | Set the variable here and use it across your agent. | - | - |
| Value | Text | Textarea | - | - | - | - |
End states
Below are the possible end states of the block call.| Name | Field | Type | Description |
|---|---|---|---|
| Success | - | success | The item was added to the list. |
| Error | - | error | There was an error adding the item to the list. |