Go to Studio

Pick List Item

Pick an item from a list by position

What does this node do?

The Pick List Item node selects a single item from a list based on its position. You can pick the first, last, random, or a specific item by index.

Common uses:

  • Get the first result from an API response
  • Pick a random item for A/B testing
  • Select a specific item by index from a known list

Quick setup

Add the Pick List Item node

Drag it onto the canvas from the Tools panel.

Connect a list input

Connect the output of any node that produces a list (e.g., Create List, Filter List) to the list input.

Choose a pick mode

Select how you want to pick the item: first, last, random, or custom_index.

Use the output

Connect the selected_item output to the next node in your workflow.

Configuration

Input

list json required

The list to pick an item from. Accepts any valid JSON array.

Parameters

pick_mode select default: first

How to select the item from the list.

  • first — Pick the first item
  • last — Pick the last item
  • random — Pick a random item
  • custom_index — Pick an item at a specific index
index number

The zero-based index of the item to pick. Only used when pick_mode is set to custom_index.

Output

A single selected_item value containing the picked item.

{
  "selected_item": "banana"
}

Examples

Get the first result from an API

graph LR
    A[API Connector] --> B[Pick List Item]
    B --> C[LLM: Process result]

Configuration:

  • pick_mode: first

The API returns a list of results. Pick List Item extracts the top result so the LLM can process it directly without dealing with the full array.

Random selection for A/B testing

graph LR
    A[Create List] --> B[Pick List Item]
    B --> C[LLM: Generate content]

Configuration:

  • pick_mode: random

Create a list of prompt variations, then randomly pick one for each workflow execution to test different approaches.

Best practices

  • Use first for deterministic results. When you always want the same item from the same list, use first or last mode to keep your workflow predictable.
  • Combine with Filter List. Filter your list first, then pick the first item from the filtered results to get the best match.

Common issues

Index out of range

When using custom_index, the index must be within the bounds of the list (0 to length - 1). If the index exceeds the list size, the node will fail. Use Count List Items first to validate the list length.

Input is not recognized as a list

The list input must be a valid JSON array (e.g., ["a", "b", "c"]). If you pass a plain string or an object, the node will not work correctly. Make sure the upstream node outputs a proper list format.