Skip to main content

What is Pipeline State?

Pipeline state represents the current condition of your workflow at any given moment. It stores:
  • User input from conversations
  • Conversation history (messages exchanged)
  • Extracted data from external systems
  • Intermediate results from processing nodes
  • Configuration values used across multiple steps
Without state, each node would operate in isolation with no memory of previous steps. State enables your pipeline to maintain context, pass data between nodes, and build complex workflows that accumulate knowledge as they execute.

Default States

Every pipeline automatically includes two special default states that are always available:

input State

Type: str
Purpose: Holds the most recent message from the user
The input state represents short-term memory—it always contains the latest user message. When a user types something new, input is updated to reflect that new message.

messages State

Type: list[BaseMessage]
Purpose: Stores the complete conversation history
The messages state represents long-term memory—it contains the entire conversation between the user and the pipeline, including all user inputs and pipeline responses.
  • Use input when you only need the current user message
  • Use messages when you need conversation context or history
  • You can use both together: input: ["input", "messages"]

Managing States in Flow Mode

Starting with ELITEA 2.0.0 Beta, pipeline states are managed through an intuitive sidebar interface in Flow mode.

Accessing the States Sidebar

  1. Open Flow Editor: Navigate to your pipeline’s Configuration tab
  2. Click States Button: Located under the + button for adding nodes
  3. States Sidebar Opens: A resizable panel appears on the right side
Opening States Sidebar
The States button is only visible in Flow mode. In YAML mode, states are defined directly in the YAML configuration.

Default States Display

When you open the States sidebar, you’ll see the two default states:
  • input - Toggle to activate/deactivate
  • messages - Toggle to activate/deactivate
Default States
When creating a new pipeline, input and messages states are automatically added but disabled. You must explicitly enable them if your pipeline needs to access user input or conversation history.
Resizable Panel : Drag the left edge of the sidebar to resize it. The sidebar remembers your preferred width for the session. Minimum/Maximum Width : The sidebar has a minimum width (300px) and maximum width (50% of screen). Collapse Icon : Click the collapse icon in the top-right corner to close the sidebar.

Adding Custom States

Custom states allow you to store pipeline-specific data beyond the default input and messages.

Creating a New State

  1. Click + Context Button: Located in the States sidebar
  2. Fill Out State Form:
    • State Name (required): Enter a valid name
    • State Type (required): Select from dropdown (string, list, JSON, number)
    • Default Value (optional): Enter initial value in 5-row text area
  3. Auto-Save: Changes are automatically saved
Adding Custom State

State Name Validation

State names must follow these rules: ✔️ Allowed:
  • Letters (a-z, A-Z)
  • Numbers (0-9)
  • Underscores (_)
✔️ Must start with a letter Not allowed:
  • Special characters (!, @, #, $, %, etc.)
  • Spaces
  • Hyphens or dashes
  • user_story_title ✔️
  • jiraProjectId ✔️
  • epic_id_123 ✔️
  • description ✔️
  • user-story-title ✘ (contains hyphens)
  • jira project id ✘ (contains spaces)
  • 123_epic_id ✘ (starts with number)
  • epic@id ✘ (contains special character)
Real-time validation provides immediate feedback as you type.

State Variable Types

ELITEA Pipelines support multiple data types for state variables:

String (str)

Icon: 📝 (displayed in sidebar)
Purpose: Store text data
Default Value Example: "Draft user story"
Use Cases:
  • User story titles
  • Descriptions
  • Status messages
  • Extracted text content

Number (int, float)

Icon: 🔢 (displayed in sidebar)
Purpose: Store numeric data
Default Value Example: 42 or 3.14
Use Cases:
  • Counters
  • Scores or ratings
  • Identifiers
  • Calculation results

List (list)

Icon: 📋 (displayed in sidebar)
Purpose: Store ordered collections
Default Value Example: ["item1", "item2", "item3"]
Use Cases:
  • Multiple results from a search
  • Batch processing items
  • Conversation history
  • File listings
The messages state is a special list type that stores BaseMessage objects (LangChain message format), not simple strings.

JSON

Icon: (displayed in sidebar)
Purpose: Store key-value pairs and structured data
Default Value Example: {"key": "value", "status": "active"}
Use Cases:
  • Configuration objects
  • API responses
  • Structured metadata
  • Complex data structures
State types

State Initialization

Default Values

When adding a custom state, you can optionally provide a default value. This value is used when the pipeline starts executing if no other value has been set. Default Value Field:
  • 5-row text area for comfortable editing
  • Expands when sidebar is resized
  • Supports multi-line input for complex values
Default Value Input Examples:

State Modification

States can be modified in several ways during pipeline execution:

1. Node Output Variables

Nodes can write to state variables using the output parameter: When this node executes, the LLM response will be parsed and the values will be stored in the specified state variables. Output

2. State Modifier Node

The State Modifier node allows advanced state manipulation using Jinja2 templates:
State Modifier Capabilities:
  • Combine multiple state variables
  • Transform data using Jinja2 filters
  • Clean or reset state variables
  • Format output for specific purposes

3. Code Node Updates

Code nodes can update state by returning structured dictionaries:

4. Toolkit and MCP Node Results

Toolkit and MCP nodes automatically store results in output variables: Toolkit Node Example:
MCP Node Example:

Practical Examples

Example 1: User Story Creation Pipeline

Example 2: Data Processing with State

Example 3: Conversation Context with Messages

Best Practices

1. Use Descriptive State Names

✔️ Good:
Avoid:

2. Choose Appropriate Types

Match state types to the data they’ll store:
  • Strings: Single values, text content
  • Lists: Collections, multiple items
  • Dictionaries: Structured data, API responses
  • Numbers: Counters, IDs, scores

3. Initialize Critical States

Provide default values for states that nodes depend on:

4. Keep State Minimal

Only create state variables you actually need. Unnecessary states:
  • Increase complexity
  • Make debugging harder
  • Use more memory

5. Use input vs messages Appropriately

  • Use input for single-turn interactions
  • Use messages when context from previous turns matters
  • Use both when you need current input AND historical context

6. Leverage State Modifier for Complex Transformations

Instead of complex prompt formatting, use State Modifier:

7. Handle State Errors Gracefully

Always account for missing or invalid state:

8. Monitor State in Development

Use interruptions to inspect state at key points:
When the pipeline pauses, examine state variables to verify data flow.

9. Document Complex State Usage

Add comments in YAML or description fields explaining non-obvious state usage:

10. Clean Up Unused State

Use State Modifier to clear state variables when no longer needed:

Common Patterns

Pattern 1: Iterative Processing with Router

Pattern 2: Conditional State Initialization

Pattern 3: State-Based Routing

Troubleshooting

Issue: State Variable Not Found

Problem: Node fails because a state variable doesn’t exist Solutions:
  1. Verify the state is defined in the state section
  2. Check that previous nodes populate the state via output
  3. Provide default values in state initialization
  4. Use alita_state.get('var', default_value) in Code nodes

Issue: State Type Mismatch

Problem: Node expects a list but receives a string Solutions:
  1. Verify state type matches the data being stored
  2. Use State Modifier to transform types if needed
  3. Check node output configuration

Issue: Messages Not Persisting

Problem: Conversation history is lost between nodes Solutions:
  1. Ensure messages: list is in the state section
  2. Activate the messages toggle in States sidebar
  3. Include messages in node input parameters
  4. Verify nodes return messages in their output

Issue: Default Values Not Applied

Problem: State variable is empty despite setting a default value Solutions:
  1. Check that default value syntax matches the state type
  2. Verify no nodes are overwriting the state with empty values
  3. Use State Modifier to explicitly set values at pipeline start

Cross-Mode Consistency

State management works identically in:
  • Pipelines Menu: Create and manage pipelines from the main Pipelines interface
  • Canvas Mode: Create and manage pipelines directly from conversation canvas
The States sidebar behavior, validation rules, and auto-save functionality remain consistent across both modes.