Skip to content

List to Accumulation

Converts an input into an accumulation structure. If the input is a list, it becomes the accumulation contents directly; if it is a single value (not a list), it is wrapped into a one-element accumulation.
Preview

Usage

Use this node when you need to initialize or reset an accumulation from an existing list, or when you want to standardize a single value into an accumulation for downstream list/accumulation operations. Commonly used before nodes that operate on the ACCUMULATION type (e.g., get length, get/set item, head/tail).

Inputs

FieldRequiredTypeDescriptionExample
listTrueWILDCARDThe value to convert. If it is a Python list, its elements become the accumulation. Any non-list value is wrapped as a single element.[1, 2, 3] or "hello"

Outputs

FieldTypeDescriptionExample
accumulationACCUMULATIONAn accumulation object containing the input elements under the 'accum' key.{"accum": [1, 2, 3]}

Important Notes

  • This node treats only Python lists as lists; other iterables like tuples are considered single values and will be wrapped as one element.
  • If the input is already an accumulation object (a dict with an 'accum' key), it will be wrapped as a single element rather than merged.
  • Passing None results in an accumulation with a single None element.
  • On error, the node returns an empty accumulation: {"accum": []}.

Troubleshooting

  • Input is a tuple and doesn't expand: Convert your tuple to a list before this node if you want its elements to populate the accumulation.
  • Already have an ACCUMULATION and want a list: Use 'Accumulation to List' to extract elements instead of passing it here.
  • Unexpected empty result: Check for upstream errors or invalid types; the node returns {"accum": []} on exceptions.