Skip to content

Chunk

Chunk (chunk)

Segment large payloads into smaller chunks for downstream processing.

Transform json

Minimal example

actions:
- chunk: {}
JSON
{
"actions": [
{
"chunk": {}
}
]
}

Contents

Fields

FieldTypeRequiredDescription
descriptionstringDescribe this step.
conditionlua-expression (string)Only run this action if the condition is met.
Examples: 2 * count()
input-fieldfield (string)Field containing the text or array to chunk.
Examples: data_field
output-fieldfield (string)Field to write chunk output to when using array mode.
Examples: data_field
modeModeChunking mode (characters, tokens, or sentences).
Allowed values: characters, tokens, sentences
sizenumber (integer)Target size of each chunk.
Examples: 42, 1.2e-10
overlapnumber (integer)Overlap (same unit as size) between consecutive chunks.
Examples: 42, 1.2e-10
localestringLocale hint used for sentence detection.
outputOutputOutput behaviour (array writes chunks to a field, events emits new events).
Allowed values: array, events
metadata-fieldfield (string)Field used to capture chunk metadata (offsets, identifiers, etc.).
Examples: data_field

Schema

Mode Options

ValueDescription
charactersCharacters
tokensTokens
sentencesSentences

Output Options

ValueDescription
arrayArray
eventsEvents