Skip to main content

Text Aggregator

The Text Aggregator component allows you to combine multiple text inputs into a single output using a customizable template. It's perfect for merging different pieces of text, creating formatted strings from multiple variables, and building self-referential loops in your workflows. With support for multiple input configurations, you can create recursive patterns where the component's output feeds back into itself or other components in a loop.

Credit Cost

Free

Usage

The Text Aggregator component supports multiple input configurations, each with its own template. Each configuration can have multiple input handles that accept text data. The component has a single output handle that produces the aggregated result. You can connect any number of text variables to each input configuration's handles, and use them in your template using the {{variable}} syntax.

The component will execute when all required variables for any of the input configurations have data, making it suitable for workflows with recurrent patterns or self-referential loops.

Variable Handling

The Text Aggregator component accepts multiple variables of type 'text' as input across different input configurations. Each connected input will be assigned a label that you can reference in its corresponding template. The single output handle produces the text result from the template evaluation of the triggered configuration.

If a referenced variable in the template is not connected or contains empty data, that variable will be replaced with an empty string in the output.

Properties

Input Configurations

  • Type: array of objects
  • Description: List of input configurations, each containing:
    • Input handles: The required input variables for this configuration
    • Template: The template that defines how these input variables should be combined
  • Default: Single configuration with empty template

Template (per configuration)

  • Type: text
  • Description: The template that defines how the input variables for this configuration should be combined. Use {{variable}} syntax to reference input variables.
  • Default: Empty template

Examples

Multiple Input Configuration Example

multiple_input_config

This setup allows for a recursive loop where a Critic LLM can choose to either:

  • Mark the original LLM's output as "good" or "bad"
  • If good, return the original LLM's output
  • If bad, give feedback to the original LLM, creating a loop in which the execution flow goes back to the original LLM to improve its output

Basic Text Aggregation

For input variables:

  • a = "John Doe"
  • b = "Software Engineer"
  • c = "Tech Corp"

Template:

Hello, I'm {{a}}, a {{b}} at {{c}}.

Output:

Hello, I'm John Doe, a Software Engineer at Tech Corp.