---
title: Message Splitter
slug: litmusedge/message-splitter
docTags: 
createdAt: 2026-08-25T21:26:18.536Z
---

The Message Splitter breaks a single incoming message into multiple outgoing messages, one per element. Use it to fan out a batch, an array, or a delimited string into individual messages that downstream processors handle one at a time.

## How it works

The processor reads a value, splits it into parts, and emits one message per part. The **Source Field** parameter names the field to split. When you leave it empty, the processor splits the raw message value directly. When you set it, the processor copies all other fields from the input map into every emitted message and replaces only the source field value with the individual element.

## Modes

The **Mode** parameter sets how the value is split:

- `string` splits a string by the delimiter, emitting one message per substring.
- `array` splits an array into its elements, emitting one message per element.
- `object` splits a map into one message per key-value pair. The key is stored in the field named by **Split Key Field**.

## Fixed length chunks

When you set **Fixed Length** greater than `0`, the processor splits an array into sub-arrays of that size and a string into character chunks of that size, instead of using the delimiter or one element per message. Object mode ignores this setting.

## Output

Each output message carries the parent map with the source field replaced by the individual part, or the bare value when **Source Field** is empty. In `object` mode, the processor also sets the split key field to the entry key.

## Pairing with the Split Message Joiner

Enable **Inject Parts** to add a `_parts` field to each emitted message, holding the group id, index, count, and type. The Split Message Joiner reads this metadata in its auto mode to reassemble the original structure.

## Parameters

| **Parameters**     | **Details**                                                                                                                                                                                                                    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Mode               | The split mode: `string` splits by the delimiter, `array` splits array elements, and `object` splits map key-value pairs.                                                                                                      |
| Source Field       | The field in the input map whose value is split. Leave empty to split the raw message value directly.                                                                                                                          |
| Delimiter          | The separator used in `string` mode to split the value. Default is a comma.                                                                                                                                                    |
| Fixed Length       | The chunk size for `array` and `string` modes. When set, the processor splits an array into sub-arrays of this length and a string into character chunks of this length instead of using the delimiter. Set to `0` to disable. |
| Split Key Field    | The field added to each output message to carry the map key in `object` mode. Default is `split_key`.                                                                                                                          |
| Inject Parts       | Adds a `_parts` field with group id, index, count, and type to each emitted message. Required for the Split Message Joiner auto mode.                                                                                          |
| Pass Through Value | Joins the input with the output of the processor.                                                                                                                                                                              |

