Accumulation Set Item¶
Updates an item at a specific index within an accumulation. It writes the provided value into the accumulation's internal list at the given index 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 modify an element within an existing accumulation, such as updating a computed result, replacing a placeholder, or correcting a value in a workflow that builds or refines lists over time. Typically paired with nodes that create or transform accumulations, and often used inside iterative or conditional logic branches.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| accumulation | True | ACCUMULATION | The accumulation object containing an ordered list of items to be updated. | {"accum": ["a", "b", "c"]} |
| index | True | INT | Zero-based index of the item to update. Negative indices refer to items from the end (e.g., -1 is the last item). | 1 |
| value | True | WILDCARD | The new value to store at the specified index. Can be any supported type compatible with the accumulation's item type. | "z" |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| accumulation | ACCUMULATION | The accumulation after attempting to set the item at the specified index. If the operation fails (e.g., invalid index), the original accumulation is returned. | {"accum": ["a", "z", "c"]} |
Important Notes¶
- Indexing: Uses zero-based indexing; negative indices are allowed and reference from the end of the list.
- Mutation behavior: The accumulation is updated in place; downstream nodes will see the modified accumulation.
- Failure handling: If the index is out of range or the accumulation is missing its internal list, the node returns the input accumulation unchanged.
- Type flexibility: The value input is a wildcard; ensure it matches the expected type for consumers of the accumulation.
- Structure expectation: The accumulation must contain an internal list of items (typically accessible as "accum").
Troubleshooting¶
- Index out of range: Verify the index is within the accumulation's length or use negative indices for items from the end. Consider checking length beforehand with an appropriate length node.
- No change after execution: This can occur if the index was invalid or the accumulation structure was malformed. Confirm the accumulation contains a valid list and the index is correct.
- Unexpected item type errors downstream: Ensure the 'value' you set matches what downstream nodes expect (e.g., do not mix text with image objects unless intended).
- Concurrent modifications: If multiple branches update the same accumulation reference, results may be unpredictable. Sequence updates or duplicate the accumulation before parallel edits.