Memory Storage
In-memory storage adapter for development and testing
Memory Storage
The @stepflowjs/storage-memory adapter stores all workflow state, step results, and queue jobs in memory. It is ideal for local development, unit testing, and CI environments where persistence across restarts is not required.
Installation
pnpm add @stepflowjs/storage-memoryUsage
import { Stepflow } from "@stepflowjs/core";
import { MemoryStorageAdapter } from "@stepflowjs/storage-memory";
const stepflow = new Stepflow({
storage: new MemoryStorageAdapter(),
});Features
- Zero Configuration: No external database or setup required.
- Fast: Extremely low latency as all operations happen in-process.
- Testing Friendly: Easy to reset between test runs by creating a new instance.
Limitations
- Non-Persistent: All data is lost when the process restarts.
- Single Process: Cannot be shared across multiple instances of Stepflow.
- Memory Bound: Limited by the available memory of the Node.js process.