Skip to content

discovery(orchestration): WorkflowExecutor god class (1,178 LOC) — decompose into StepOrchestrator/ParallelCoordinator/CheckpointResumer #6827

Closed

Description

@mrveiss

Discovered during

Audit of issue #4048 closure (2026-05-04).

Finding

autobot-backend/orchestration/workflow_executor.py is 1,178 lines in a single class, mixing 5 distinct concerns:

Concern Notes
Step execution Linear path + DAG path side-by-side
Parallel coordination Branch fan-out, sibling deps
Error handling Delegates to `error_handler.py` but maintains its own retry state
Sub-workflow delegation Recursive nesting depth limit
Checkpoint resume Resume-from-checkpoint logic interleaved with normal execution

Per AutoBot CLAUDE.md "≤30-line functions, no god-classes" engineering standard, a 1,178-LOC class is a refactor candidate.

This issue is related to #6823 (executor fragmentation) but distinct: even within `WorkflowExecutor` alone, the responsibilities can be split.

Why now

Decomposition was started in #5058 (god-class refactor that produced `WorkflowRunner` + `PerformanceTracker` + `AgentRouter` + `CollaborationCoordinator`). `WorkflowExecutor` was deliberately left as the next target — see orchestrator.py:534 docstring noting the legacy planner/executor path.

Recommendation

Extract:

  • `StepOrchestrator` — owns step lifecycle (start, run, complete)
  • `ParallelCoordinator` — owns branch fan-out + sibling dependency resolution
  • `CheckpointResumer` — owns resume-from-checkpoint logic
  • `WorkflowExecutor` becomes a thin facade delegating to these

This mirrors the #5058 pattern (`Orchestrator` god class → 4 collaborators).

Acceptance criteria

  • No single class in `orchestration/` exceeds 500 LOC
  • `WorkflowExecutor` is ≤300 LOC, with clear delegation to extracted collaborators
  • Existing workflow_executor tests + e2e tests pass unchanged

Priority

P2 — large but stable; risky without #6823 first.

Activity

  1. mrveiss commented on May 17, 2026

    @mrveiss
    OwnerAuthor

    Closed via PR #8082 (commit cc3006b on Dev_new_gui).

    Acceptance criteria met:

    • New orchestration/checkpoint_resumer.py — CheckpointResumer owns save/apply/clear checkpoint logic (99 LOC)
    • WorkflowExecutor._save_checkpoint, _apply_checkpoints, and clear() now delegate to CheckpointResumer
    • WorkflowCheckpointManager and StepCheckpoint no longer imported directly in workflow_executor.py
    • Reduces executor concerns by one cohesive extraction; file remains ~1,100 LOC — further extractions tracked in this issue for subsequent batches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions