Sequencer
Description
The Sequencer node splits a single block of text into multiple items and delivers them one at a time, advancing to the next item on each workflow restart. It is the primary tool for iterative processing: instead of sending a huge list to a single Agent (which might truncate or lose focus), you slice it into manageable pieces and process them one by one across multiple loop iterations.
Unlike the Dispatch node (which splits content across multiple outputs in a single pass), the Sequencer has only two outputs:
- Output 0: delivers the current item.
- Output 1: delivers a "Cycle complete" signal once all items have been processed.
This makes it ideal for driving loops: Output 0 feeds the processing pipeline, and Output 1 triggers the stop condition.
Configuration Properties
✂️ Cut Mode Section
Radio Buttons
Selects the strategy used to split the input text into items:
Blank Line Blocks
Splits the text into blocks separated by one or more blank lines (consecutive \n\n or \r\n\r\n). Each block becomes one item. Empty blocks are automatically discarded.
Best for: AI-generated lists where each concept is separated by a blank line (the standard output format of most LLMs when asked to produce multiple items).
Fixed Line Count (default)
Splits the text into fixed-size groups of N lines. Each group becomes one item.
Best for: structured data like CSV files, log files, or any text where each record occupies a known number of lines.
🔢 Lines per Item Section
NumericUpDown (default: 1)
Defines how many lines belong to each item when Cut Mode is set to Fixed Line Count.
1= one line per item (each line is processed independently).2= pairs of lines grouped together.3= triplets, etc.
This option is ignored when Cut Mode is Blank Line Blocks.
⚙️ Options Section
Reset On New Input (default: checked)
When checked, the Sequencer resets to the first item whenever it receives a different input text than the previous execution. The comparison is exact (text <> mLastInputText), so identical inputs (e.g., from a MemoryRead node in a loop) do NOT trigger a reset — the Sequencer simply advances to the next item.
When unchecked, the Sequencer never resets automatically, even if the input changes. It keeps cycling through the original items until manually reset.
💡 Tip: This is the key mechanism that makes loops work. When a
MemoryReadnode re-sends the same text on each iteration, the Sequencer recognizes it as unchanged and advances. When a new text arrives (e.g., a new user query), it resets and starts fresh.
🔁 Reset Sequence Button
Button
Manually resets the Sequencer to its initial state: clears all items, resets the position to 0, and forgets the last input text. Useful during development to force a fresh start without reloading the workflow.
Node Outputs
The Sequencer has two output anchors:
Output 0 (top)
Delivers the current item from the sequence. On each workflow restart, it advances to the next item.
Output 1 (bottom)
Delivers a completion signal ("Cycle complete (N items).") once all items have been processed and the cycle wraps back to the beginning. This is typically connected to an AutomateNode with AutoRestart: Disable to stop the loop cleanly.
Usage Example
"Process AI-generated concepts one by one":
- An Agent node generates 3 concepts separated by blank lines.
- A Sequencer node with:
- Cut Mode:
Blank Line Blocks - Reset On New Input: checked
- Cut Mode:
- Output 0 → Agent 2 (details each concept).
- Output 1 → Automate (stops the loop).
- The workflow runs 3 times, processing one concept per iteration, then stops.
"Translate a CSV file line by line":
- A File Read node loads a CSV file.
- A Sequencer node with:
- Cut Mode:
Fixed Line Count - Lines per Item:
1
- Cut Mode:
- Output 0 → Agent (translates each line).
- Output 1 → Automate (stops the loop).
⚠️ Pitfalls to Avoid
Don't send Output 0 and Output 1 in the same Process call: The Sequencer intentionally separates the "last item" and the "cycle complete" signal into two distinct executions. If both were sent simultaneously, downstream nodes could race (e.g., a stop signal arriving before the last item is fully processed). Trust the built-in two-cycle behavior.
HasSideEffect = True: The Sequencer is marked as having a side effect because it maintains internal state (current position, last input text). This ensures it is included in the active node set even if it doesn't produce "visible" output like a file write.
Reset On New Input + identical text: If you want the Sequencer to reset even when the text is identical (e.g., forcing a fresh start on every loop iteration), uncheck Reset On New Input and use the Reset Sequence button or an AutomateNode with Reset Sequencers enabled.
Empty input: If the input text is empty or contains only blank lines, the Sequencer produces no items. Output 1 will immediately fire with "Sequence empty." on the first execution.
Not a source node: The Sequencer has one input anchor and cannot start a workflow on its own. It must be downstream of a source node (Input, Memory Read in FixedKey mode, etc.).
State is not persisted: The current position and item list are held in memory and reset when the workflow is reloaded from disk. If you save and reload a .tzuflow file, the Sequencer always starts at position 0.
Blank Line Blocks regex: The splitting uses Regex.Split(text, "(?:\r?\n){2,}"), which means two or more consecutive newlines. A single newline does NOT create a block boundary. If your AI outputs items separated by a single newline, use Fixed Line Count instead.