Split Text
split_text · Nodes · Transform
Divides text into ordered, bounded chunks.
Split Text#
Divides one text input into an ordered array of bounded, non-empty text chunks. It is a reusable transform; it has no provider-specific behavior.
Configuration#
modeline(default): preserves source order and packs complete newline-terminated lines together while they fit. A line longer than the limit is split at a fitting whitespace boundary when possible, otherwise at a Unicode-scalar boundary.character: splits at the largest Unicode-scalar boundary that fits the limit.
max_chars: maximum UTF-16 code units in each chunk. Defaults to1850, a conservative margin below Discord's 2,000-unit message-content limit. Must be at least1.
The node never truncates, removes, or reorders input text. It does not split a Unicode scalar value. If max_chars is too small for one scalar (for example, an emoji with max_chars = 1), it fails instead of emitting malformed text.
Inputs and Output#
input: one text value. Objects, arrays, and other JSON values fail rather than being stringified.output: one ordered array of text chunks. An empty input produces[].
The array is one workflow value, not an item stream. It does not invoke downstream nodes once per chunk by itself.
Discord Message Pattern#
Use this for unbounded text sent through a Discord operation that creates a message (send_message or reply):
Upstream text → Split Text.input
Split Text.output → Loop.input
Loop.loop → Discord Action.input
Configure the Discord Action body with content: {{ input }}. Loop.loop runs each chunk sequentially, preserving order, and Discord Action sends one message per iteration.
Do not loop edit_message, edit_original_response, update_message, or an initial respond_to_interaction: each is limited to one 2,000-unit message, and repeated iterations overwrite the same message or fail after the initial response. Shorten the content, attach a file when the operation supports attachments, or use a deferred/follow-up workflow appropriate to the interaction.
Inputs
inputRequired
Outputs
output
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
mode | enum(character, line) | No | character splits exactly at the limit; line keeps complete lines together when possible |
max_chars | integer | No | Maximum UTF-16 code units per chunk. Defaults to 1850 as a conservative Discord-safe message-content limit. |
base_config | record | No | Shared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow). |