Understanding Types in Gumloop

Each input and output in a node has a specific type that defines the kind of data it can handle. Understanding types is crucial for building flows that work correctly, as type mismatches are one of the most common causes of flow errors.

The most common type you’ll encounter is Text, as most flows involve working with text data.

Types You’ll Encounter

Gumloop primarily works with these data types:

  • Text: A single piece of text (such as a message, document, or value)
    • Example: “Hello, world” or “The quarterly report shows a 15% increase in sales”
  • List of text: A collection of multiple text items
    • Example: [“Email 1”, “Email 2”, “Email 3”] or [“Product A”, “Product B”, “Product C”]
  • List of List of text: A nested collection of text lists (like a table or matrix)
    • Example:
      [
        ["Apple", "Red", "$1.50"],     // First row: Item, Color, Price
        ["Banana", "Yellow", "$0.75"], // Second row: Item, Color, Price
        ["Orange", "Orange", "$1.25"]  // Third row: Item, Color, Price
      ]
      
    • This is often the output of nodes that read tables or produce grouped data

How Types Are Displayed

Types are visually indicated in the node’s side-menu.

Type Matching Rules

For a flow to work correctly, the output type of one node must match the input type of the next node. If the types don’t match, the flow will fail due to a type mismatch error.

Type Compatibility Matrix

Source TypeTarget TypeCompatible?Solution if Incompatible
TextText✅ YesN/A
TextList of text❌ NoUse Duplicate node
List of textText❌ NoUse Join List Items or Loop Mode
List of textList of text✅ YesN/A
List of List of textList of text❌ NoUse Flatten List of Lists
List of List of textText❌ NoUse Flatten + Join List Items

Common Type Mismatch Scenarios

Scenario 1: List → Text Connection

Problem: You have a list of items (such as emails from Gmail Reader) but need to process them as a single text input.

Example:

  • Gmail Reader outputs a List of text (multiple emails)
  • You want to send a single message to Slack containing all emails

Solutions:

  1. Join List Items node: Combines all items in the list into one text string

    • Input: List of emails
    • Output: One text string containing all emails (with separators)
    • Use case: When you need to process all items together as one unit
  2. Loop Mode: Process each list item one at a time

    • Each email is processed individually through the flow
    • Results in multiple outputs (one per email)
    • Use case: When you need to process each item independently

Scenario 2: Text → List Connection

Problem: You have a single text item but need to use it with each item in a list.

Example:

  • You have a style guide (text) that needs to be applied to multiple blog posts (list)
  • An API key (text) that needs to be used with multiple API calls (list)

Solution: Use the Duplicate node

  • Input: Single text
  • “List size to match” input: Connect your list
  • Output: List containing copies of your text, matching the size of your other list

Scenario 3: Nested Lists (List of Lists → List)

Problem: You have a nested list (lists within a list) but need a flat list.

Example:

  • Website Crawler outputs URLs for each site (creating a list of lists)
  • You need a simple list of all URLs for processing

Solutions:

  1. Flatten List of Lists node: Combines all nested lists into one flat list

    • Input: Nested list structure
    • Output: Single-level list with all items
    • Use case: When you need all items in one flat structure
  2. Subflow with Loop Mode: Process each inner list separately

    • Create a subflow to handle each inner list
    • Run the subflow in Loop Mode to process each list
    • Use case: When you need to maintain the grouping of items

Loop Mode: A Powerful Tool for Type Handling

Loop Mode is one of the most powerful features for handling type mismatches in Gumloop. When enabled on a node, it allows that node to process a list input one item at a time.

How Loop Mode Works

  1. Without Loop Mode:

    • Input: List of text [“Item 1”, “Item 2”, “Item 3”]
    • Node expecting Text input: ❌ Error: Type mismatch
  2. With Loop Mode Enabled:

    • Input: List of text [“Item 1”, “Item 2”, “Item 3”]
    • Node processes “Item 1”, then “Item 2”, then “Item 3” separately
    • Output: List of results, one for each input item
    • Result: ✅ Success

When to Use Loop Mode

  • When you need to process each item in a list individually
  • When you want to apply the same operation to multiple items
  • When connecting List outputs to nodes that expect Text inputs

Loop Mode vs. Join List Items

FeatureLoop ModeJoin List Items
Processing StyleIndividual processingCombined processing
InputList of itemsList of items
OutputList of resultsSingle text item
Use CaseWhen each item needs individual attentionWhen all items should be processed together
ExampleSummarize each document separatelyCombine all documents and summarize once

List Operation Nodes for Type Conversion

Gumloop provides several specialized nodes designed specifically for handling type conversions:

Join List Items

  • Purpose: Combine all items in a list into a single text string
  • Input: List of text
  • Output: Text
  • Options: Choose separator (newline, comma, space, etc.)
  • Example use: Combining search results into one report

Duplicate

  • Purpose: Create multiple copies of a single text item
  • Input: Text
  • Output: List of text (with repeated items)
  • Options: Specify how many copies or match another list’s size
  • Example use: Using the same prompt for multiple documents

Flatten List of Lists

  • Purpose: Convert a nested list into a simple, flat list
  • Input: List of List of text
  • Output: List of text
  • Example use: Processing crawled web pages

Get List Item

  • Purpose: Extract a specific item from a list
  • Input: List of text
  • Output: Text (single item)
  • Options: Specify index (position) to extract
  • Example use: Getting only the first search result

Combine Lists

  • Purpose: Merge multiple lists into one
  • Input: Multiple List of text inputs
  • Output: Single List of text with all items
  • Example use: Combining results from multiple sources

Best Practices for Managing Types

  1. Plan your data flow before building

    • Consider what type of data each step will produce and consume
    • Identify where type conversions will be needed
  2. Watch for list size mismatches

    • Use Error Shield around sections processing lists
    • Use Duplicate node to match list sizes when needed
  3. Use node names and descriptions that include type information

    • Example: “Join Customer Names (List → Text)”
    • Makes it easier to understand data flow at a glance
  4. Consider using subflows for complex type transformations

    • Creates cleaner, more maintainable flows
    • Helps isolate and solve type-related issues

Common Questions About Types

”Why can’t I connect these nodes?”

If you can’t connect two nodes, check their input/output types. Hover over the connection points to see the expected type. Use appropriate type conversion nodes or Loop Mode to resolve mismatches.

”When should I use Loop Mode vs. type conversion nodes?”

  • Use Loop Mode when you want to process each item in a list individually
  • Use type conversion nodes (like Join List Items) when you want to transform the data structure itself

”How do I handle a node that outputs multiple different lists?”

When a node outputs multiple lists (like a Google Sheets Reader with multiple columns), you have several options:

  1. Process each list separately with different nodes
  2. Combine the lists first if they need to be processed together
  3. Use Loop Mode to process corresponding items across multiple lists

”How do I work with nodes that have a None type output?”

When working with nodes that produce a None type output (like JSON Reader or Run Code):

  1. First, understand what the actual output will be at runtime based on your input data
  2. Set up your subsequent nodes expecting that type
  3. Use type conversion nodes if needed to ensure compatibility