Skip to content

Accumulation Get Length

Returns the number of items stored inside an Accumulation. If the provided input is not a valid Accumulation, the node safely returns 0.
Preview

Usage

Use this node when you need the count of items that have been collected through Accumulation-based workflows (e.g., after iteratively adding items with Accumulate). Commonly used for conditional logic, branching, or validating that an Accumulation contains items before further processing.

Inputs

FieldRequiredTypeDescriptionExample
accumulationTrueACCUMULATIONThe Accumulation object to measure. This should be created by Accumulate or related Accumulation nodes and internally holds a list of collected items.{'accum': ['a', 'b', 'c']}

Outputs

FieldTypeDescriptionExample
lengthINTThe number of items contained in the input Accumulation.3

Important Notes

  • If the input is missing or not a valid Accumulation, the node returns 0.
  • This node only reads the Accumulation; it does not modify it.
  • Designed to work with Accumulation objects produced by nodes like Accumulate, Accumulation Head/Tail, and Accumulation Get/Set Item.

Troubleshooting

  • Length is always 0: Ensure the input is a valid Accumulation object produced by compatible nodes and that it contains items.
  • Unexpected length value: Verify that items were actually added to the Accumulation before this node executes.
  • Type errors upstream: Confirm that the upstream node outputs an ACCUMULATION type, not a plain list or other data structure.