# Data Nodes General-purpose value handling: get/set on arbitrary objects, conditionals, sorting and selection, UUID generation, JSON parsing/serialization and length capping. _11 nodes._ | Node | Registry path | | --- | --- | | [Cap Length](#cap-length) | `data/CapLength` | | [Contains](#contains) | `data/Contains` | | [Get](#get) | `data/Get` | | [JSON](#json) | `data/JSON` | | [Length](#length) | `data/Length` | | [Select Item](#select-item) | `data/SelectItem` | | [Set](#set) | `data/Set` | | [Set Conditional](#set-conditional) | `data/SetConditional` | | [Sort](#sort) | `data/Sort` | | [Update Object](#update-object) | `data/UpdateObject` | | [UUID](#uuid) | `data/UUID` | ## Cap Length `data/CapLength` Applies a maximum length to an iterable (string or list), removing items from the specified side **Inputs** | Input | Type | Description | | --- | --- | --- | | `state` | `any` | The graph state | | `iterable` | `str, list` | Iterable (string or list) to cap | | `max_length` | `int` | Maximum length to cap the iterable to (optional) | **Outputs** | Output | Type | Description | | --- | --- | --- | | `state` | `any` | The state input, passed through | | `capped` | `str, list` | Capped iterable (same type as input) | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `max_length` | `int` | `100` | Maximum length to cap the iterable to | | `side` | `str` | `"right"` | Side to pop values from. Choices: `left`, `right`. | ## Contains `data/Contains` Checks if a value is in a list or dictionary **Inputs** | Input | Type | Description | | --- | --- | --- | | `object` | `any` | Object (list, dict, etc.) - if a generator is provided, it will be converted to a list | | `value` | `any` | Value | **Outputs** | Output | Type | Description | | --- | --- | --- | | `contains` | `bool` | True if value is in object, False otherwise | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `value` | `any` | `unset` | Value | ## Get `data/Get` Get a value from an object using getattr Dictionaries are read by key (missing keys yield None). Lists, tuples and sets are read by index - the attribute must be an integer, and an out-of-range index yields UNRESOLVED. Any other object is read via getattr, yielding None if the attribute does not exist. **Inputs** | Input | Type | Description | | --- | --- | --- | | `object` | `any` | Object to read from | | `attribute` | `str` | Attribute name, dict key, or index | **Outputs** | Output | Type | Description | | --- | --- | --- | | `value` | `any` | The retrieved value | | `attribute` | `str` | The attribute input, passed through | | `object` | `any` | The object input, passed through | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `attribute` | `str` | `unset` | Attribute | ## JSON `data/JSON` Node that converts a JSON string to a Python object **Inputs** | Input | Type | Description | | --- | --- | --- | | `json` | `str` | JSON string | **Outputs** | Output | Type | Description | | --- | --- | --- | | `data` | `dict,list` | Python object (dict or list) | ## Length `data/Length` Gets the length of an iterable **Inputs** | Input | Type | Description | | --- | --- | --- | | `object` | `any` | Object (list, dict, etc.) | **Outputs** | Output | Type | Description | | --- | --- | --- | | `length` | `int` | Length of the object (number of items) | ## Select Item `data/SelectItem` Node that takes in a list of items and selects one based on the selection function - random: picks a random item - cycle: picks the next item on each execution, wrapping around - sorted_cycle: like cycle, but iterates the items in sorted order - direct: picks the item at the index property The cycle position is stored in the graph state per node, so it persists across executions within a run. **Inputs** | Input | Type | Description | | --- | --- | --- | | `items` | `list` | List of items | | `except` | `any` | (optional) Item (or list of items) to exclude from selection | **Outputs** | Output | Type | Description | | --- | --- | --- | | `selected_item` | `any` | Selected item | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `index` | `int` | `0` | index | | `cycle_index` | `int` | `0` | cycle index. Read-only. | | `selection_function` | `str` | `"cycle"` | Selection function. Choices: `random`, `cycle`, `sorted_cycle`, `direct`. | ## Set `data/Set` Set a value on an object using setattr Dictionaries are written by key. Lists are written by index - the attribute must be an integer. Any other object is written via setattr. The object is modified in place. **Inputs** | Input | Type | Description | | --- | --- | --- | | `object` | `any` | Object to modify | | `attribute` | `str` | Attribute name, dict key, or list index | | `value` | `any` | Value to set | **Outputs** | Output | Type | Description | | --- | --- | --- | | `object` | `any` | The modified object | | `attribute` | `str` | The attribute input, passed through | | `value` | `any` | The value input, passed through | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `attribute` | `str` | `unset` | Attribute | ## Set Conditional `data/SetConditional` Same as Set, but with a state passthrough so it can be placed in a conditional execution chain Dictionaries are written by key, lists by integer index, any other object via setattr. The object is modified in place. **Inputs** | Input | Type | Description | | --- | --- | --- | | `state` | `any` | The graph state | | `object` | `any` | Object to modify | | `attribute` | `str` | Attribute name, dict key, or list index | | `value` | `any` | Value to set | **Outputs** | Output | Type | Description | | --- | --- | --- | | `state` | `any` | The state input, passed through | | `object` | `any` | The modified object | | `attribute` | `str` | The attribute input, passed through | | `value` | `any` | The value input, passed through | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `attribute` | `str` | `unset` | Attribute | ## Sort `data/Sort` Sorts a list of items If sort_keys is provided, items are sorted by the named attributes (read via getattr) in order. A sort_keys string input is parsed as JSON. Without sort_keys, items are sorted by their natural order. The input list is not modified; a sorted copy is returned. **Inputs** | Input | Type | Description | | --- | --- | --- | | `state` | `any` | The graph state | | `items` | `list` | List of items to sort | | `sort_keys` | `str, list` | Attribute name(s) to sort by - list, or JSON string (optional) | **Outputs** | Output | Type | Description | | --- | --- | --- | | `state` | `any` | The state input, passed through | | `sorted_items` | `list` | Sorted list of items | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `reverse` | `bool` | `False` | Reverse sort | | `sort_keys` | `list` | `unset` | Sort keys | ## Update Object `data/UpdateObject` Updates an object (dict or attribute-based) with values collected from dynamic inputs. New item sockets appear as connections are made. For each connected item the key to update is inferred: if the value is a (key, value) tuple that key is used; otherwise the key is derived from the source socket - for sockets named `value`, the source node's `name`, `key` or `attribute` input is used, falling back to the source socket name. Dicts are updated by key, other objects via setattr. **Inputs** | Input | Type | Description | | --- | --- | --- | | `state` | `any` | The graph state | | `object` | `any` | The object to update | This node supports **dynamic inputs** - additional input sockets can be added in the editor as needed, and connected values are collected with key inference (see [Collector Nodes](../../core-concepts/collector_nodes.md)). **Outputs** | Output | Type | Description | | --- | --- | --- | | `state` | `any` | The state input, passed through | | `object` | `any` | The updated object | ## UUID `data/UUID` Generates a UUID string **Inputs** | Input | Type | Description | | --- | --- | --- | | `state` | `any` | (optional) The graph state | | `max_length` | `int` | (optional) Maximum number of characters to return | **Outputs** | Output | Type | Description | | --- | --- | --- | | `state` | `any` | The state input, passed through | | `uuid` | `str` | A UUID string (e.g., "550e8400-e29b-41d4-a716-446655440000") | **Properties** | Property | Type | Default | Description | | --- | --- | --- | --- | | `max_length` | `int` | `36` | Maximum number of characters to return |