Troubleshooting
This guide helps recover from common issues when working with MCP Moira workflows.
Context Recovery After Session Archive
Section titled “Context Recovery After Session Archive”When a conversation is archived or compacted, the agent loses:
- Current execution ID (processId)
- Workflow step context
- Progress information
The workflow state persists on the MCP server - only the agent’s memory is lost.
Recovery Steps
Section titled “Recovery Steps”- Find active executions:
session({ action: "executions" })Returns list of executions with status, workflow ID, and notes:
[ { "executionId": "abc-123", "workflowId": "development-flow", "status": "waiting", "note": "Feature: auth system", "currentNodeId": "implement-step" }]- Get current step without advancing:
session({ action: "current_step", executionId: "abc-123" })Returns the current directive and context:
{ "directive": "Implement the feature...", "completionCondition": "Feature working and tested", "inputSchema": { ... }}- Continue workflow:
step({ processId: "abc-123", input: { ... } })Process ID Preservation
Section titled “Process ID Preservation”To help future recovery, save the process ID in your workspace:
# Create process-id.txt in feature directoryecho "abc-123" > ./feature-name/process-id.txtInclude in session archives:
- Feature name
- Process ID
- Current step description
Navigation Tools Reference
Section titled “Navigation Tools Reference”session - executions
Section titled “session - executions”Lists all active workflow executions for current user.
Call: session({ action: "executions" })
Filters:
status: Array of statuses -["waiting", "running", "completed", "failed"]workflowId: Filter by specific workflowsearch: Search in execution notes
Example with filters:
session({ action: "executions", status: ["waiting", "running"], search: "auth"})session - current_step
Section titled “session - current_step”Retrieves current step directive without advancing the workflow.
Call: session({ action: "current_step", executionId: "..." })
Parameters:
executionId(required): Execution ID to check
Returns:
directive: What to docompletionCondition: Success criteriainputSchema: Response structure
session - execution_context
Section titled “session - execution_context”Gets full execution state including context variables.
Call: session({ action: "execution_context", executionId: "..." })
Parameters:
executionId(required): Execution ID to inspect
Returns:
executionId: Execution UUIDworkflowId: Workflow being executedstatus: Execution status (running, waiting, completed, failed)currentNodeId: Current node IDwaitingForInputNodeId: Node waiting for input (if any)note: Execution notecontext.variables: Context variablescontext.nodeStates: Node execution statescreatedAt,updatedAt,completedAt: Timestampserror: Error message (if failed)
Common Issues
Section titled “Common Issues””Process not found or expired”
Section titled “”Process not found or expired””Cause: Invalid or expired processId
Solution:
- Use
session({ action: "executions" })to find active executions - Use the correct executionId from the list
- Process IDs are UUIDs like
abc123-def456-...
”Execution is not waiting for input”
Section titled “”Execution is not waiting for input””Cause: Trying to advance a completed or failed execution
Solution:
- Check execution status with
session({ action: "execution_context", executionId: "..." }) - Status must be
waitingto accept input - If
completedorfailed, start a new execution
Validation Errors on step()
Section titled “Validation Errors on step()”Cause: Input doesn’t match inputSchema
Solution:
- Check
inputSchemafrom current step - Verify field names match exactly (case sensitive)
- Verify data types match (string vs number)
- Include all required fields
Agent Forgets Workflow Context
Section titled “Agent Forgets Workflow Context”Cause: Session was archived/compacted
Solution:
- Check for process-id.txt in workspace
- Use
session({ action: "current_step" })to get context - Remind agent: “Continue workflow {processId}“
Recovery Scenarios
Section titled “Recovery Scenarios”Scenario: Resume After Interruption
Section titled “Scenario: Resume After Interruption”User: Continue working on the auth feature
Agent:1. session({ action: "executions", search: "auth" }) → Found: executionId: "abc-123", status: "waiting"
2. session({ action: "current_step", executionId: "abc-123" }) → directive: "Implement login endpoint"
3. [Does the work]
4. step({ processId: "abc-123", input: { result: "done" } })Scenario: Find Lost Process ID
Section titled “Scenario: Find Lost Process ID”User: What workflows am I running?
Agent:1. session({ action: "executions" }) → Lists all active executions with notes
2. session({ action: "execution_context", executionId: "abc-123" }) → Shows full context including variablesScenario: Check Why Workflow Stuck
Section titled “Scenario: Check Why Workflow Stuck”Agent:1. session({ action: "execution_context", executionId: "abc-123" }) → status: "waiting", currentNodeId: "validation-step"
2. session({ action: "current_step", executionId: "abc-123" }) → Shows what the workflow is waiting forRelated Documentation
Section titled “Related Documentation”- MCP Agent Guide - Tool usage basics
- MCP Tools Reference - Full tool documentation