Skip to main content
Hyrex provides a distributed key-value store for sharing state between tasks and workflows.

Basic Usage

The HyrexKV class provides static methods for key-value operations:

Value Size Limits

The TypeScript SDK enforces a 1MB size limit for values:

Working with JSON Data

Store complex objects by serializing to JSON:

Use Cases

Task Communication

Share data between parent and child tasks:

Workflow State

Share state between workflow tasks:

Distributed Locks

Implement simple distributed locks:

Caching

Cache expensive computation results:

Best Practices

  1. Use Namespaced Keys
  2. Handle Missing Keys
  3. Clean Up Workflow Data
  4. Validate Data Size

Limitations

  • No Delete Method: Keys cannot be explicitly deleted in the TypeScript SDK
  • 1MB Size Limit: Values are limited to 1MB (1,048,576 bytes)
  • String Values Only: All values must be strings (serialize objects to JSON)
  • No TTL Support: Keys don’t expire automatically

Next Steps

Workflows

Share data in workflows

Tasks

Pass data between tasks

Cron

Store state for scheduled tasks