ruvnet/ruflo · error · Error

Workflow state not found for ${workflowId}

Error message

Workflow state not found for ${workflowId}

What it means

restoreWorkflow() retrieved key 'workflow-state-<id>' from the memory backend and got nothing, and the fallback 'workflow-state' key also missed. The workflow's persisted state was never written or has expired/been evicted, so there is nothing to restore.

Source

Thrown at v3/src/task-execution/application/WorkflowEngine.ts:339

    };
  }

  /**
   * Restore a workflow from persisted state
   */
  async restoreWorkflow(workflowId: string): Promise<WorkflowState> {
    if (!this.memoryBackend) {
      throw new Error('Memory backend not available');
    }

    const stateMemory = await this.memoryBackend.retrieve(`workflow-state-${workflowId}`);
    if (!stateMemory) {
      // Try alternate key
      const result = await this.memoryBackend.retrieve('workflow-state');
      if (result) {
        return JSON.parse(result.content);
      }
      throw new Error(`Workflow state not found for ${workflowId}`);
    }

    return JSON.parse(stateMemory.content);
  }

  // ============================================================================
  // Private Helper Methods
  // ============================================================================

  private createExecution(workflow: WorkflowDefinition): WorkflowExecution {
    return {
      id: workflow.id,
      state: {
        id: workflow.id,
        name: workflow.name,
        tasks: workflow.tasks,
        status: 'in-progress',
        completedTasks: [],

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Verify the referenced identifier exists before use (list available items and match against user input).
  2. Return a clear 404-style error listing valid identifiers, and have the caller retry with an existing id.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/src/task-execution/application/WorkflowEngine.ts:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/b71d8f89cc499f07. Report an issue: GitHub.