Signpost AI Logo
WorkersTools

State

📸 Screenshots

Here are visual examples of this section:

State - Worker Configuration Interface State - Worker Configuration Interface

1. Overview and Purpose

The State worker (also known as "Persist") allows you to store and retrieve data across workflow executions. When data is provided to the input, it stores that value in the agent's state using the worker's unique ID as the key. The worker then outputs the current stored value, enabling data persistence between workflow runs.

2. Configuration Parameters

This worker does not require any configuration parameters. It operates automatically based on input data and the worker's unique identifier.

3. Input/Output Handles

  • input: Input handle - accepts any type of data to be stored in the agent's state
  • output: Output handle - returns the currently stored value for this worker's state key

4. Usage Examples with Code

// The State worker automatically persists input data
// When input is provided, it stores the value
// The output always contains the current stored value

// Example workflow usage:
// 1. First execution: input receives "Hello World"
//    - Stores "Hello World" in state
//    - Output returns "Hello World"
// 2. Second execution: no input provided
//    - Output still returns "Hello World" from previous execution

5. Integration Examples

The State worker is essential for workflows that need to remember information between executions, such as maintaining conversation context, storing user preferences, or keeping track of processing results across multiple workflow runs.

6. Best Practices

  • Use State workers to maintain data that needs to persist across workflow executions
  • Each State worker maintains its own separate storage space identified by the worker's unique ID
  • Connect the output to other workers that need access to the persisted data
  • Consider using descriptive names for State workers to make their purpose clear in complex workflows

7. Troubleshooting Tips

  • If data isn't persisting, ensure the input handle is properly connected and receiving data
  • Remember that each State worker instance maintains separate storage - different workers don't share state
  • The worker will output the stored value even when no new input is provided
  • State is maintained at the agent level using the worker's unique identifier as the storage key