Accumulation Set Item¶
Updates a single element within an accumulation at a specified index. It modifies the accumulation in place and returns the updated accumulation. If the index is invalid or the accumulation is malformed, it returns the original accumulation unchanged.

Usage¶
Use this node when you need to replace an element inside an accumulation (a list-like container used across Salt nodes). Typical workflow: build or receive an accumulation, update one position with a new value, then pass the updated accumulation to subsequent nodes. Useful for correcting or refining list contents mid-graph.
Inputs¶
| Field | Required | Type | Description | Example | 
|---|---|---|---|---|
| accumulation | True | ACCUMULATION | The accumulation object containing an internal ordered collection of items. Usually produced by nodes like Accumulate or List to Accumulation. | {'accum': [1, 2, 3]} | 
| index | True | INT | Zero-based index of the element to replace. Negative indices follow Python semantics (e.g., -1 targets the last element). Must be within bounds of the accumulation. | 1 | 
| value | True | ANY | The new value to set at the specified index. Should be compatible with downstream consumers of the accumulation. | updated item | 
Outputs¶
| Field | Type | Description | Example | 
|---|---|---|---|
| accumulation | ACCUMULATION | The same accumulation object with the item at the given index replaced by the provided value. | {'accum': [1, 'updated item', 3]} | 
Important Notes¶
- In-place modification: The node mutates the provided accumulation. If the same accumulation is used elsewhere in parallel branches, those branches will observe the updated value.
- Index bounds: If the index is out of range or the accumulation is malformed, the node returns the original accumulation unchanged.
- Value type: While any value is accepted, ensure it matches expectations of nodes that will consume this accumulation.
- Negative indices: Negative indexing is supported (e.g., -1 for last element) as long as it resolves to a valid position.
Troubleshooting¶
- Item not updated: Check that the index is within bounds of the accumulation length. Use Accumulation Get Length to verify size.
- Downstream type errors: Ensure the new value's type aligns with what subsequent nodes expect. Replace with a compatible type if needed.
- Unexpected changes in other branches: Because this node mutates in place, duplicate or clone your accumulation before branching if you need isolated edits.
- Malformed accumulation: Ensure the input is a valid accumulation produced by compatible nodes (e.g., Accumulate or List to Accumulation). If not, rebuild the accumulation before setting an item.