# Interface ExecutionPlan

Execution plan output structure.

The ExecutionPlan represents the Orchestrator's analysis and decomposition of a task. It can optionally be converted to a WorkflowDefinition for replayable, static execution via the WorkflowEngine.

ExecutionPlan extends ExecutionPlanData (the pure data) with the asWorkflowDefinition conversion method.

#### See

ARCHITECTURE.md for the separation of concerns between Orchestrator and WorkflowEngine

interface ExecutionPlan {
taskId: string;
analysis: TaskAnalysis;
subtasks: SubTask[];
assignments: ExpertAssignment[];
parallelGroups: string[][];
estimatedDuration: number;
asWorkflowDefinition(options?: PlanConversionOptions): WorkflowDefinition;
}

#### Hierarchy

- ExecutionPlanData
  - ExecutionPlan

- Defined in packages/nexus-agents/src/agents/tech-lead.ts:130

##### Index

### Properties

taskId
analysis
subtasks
assignments
parallelGroups
estimatedDuration

### Methods

asWorkflowDefinition

## Properties

### taskId

taskId: string

The original task ID this plan was created for

Inherited from ExecutionPlanData.taskId

- Defined in packages/nexus-agents/src/agents/plan-converter.ts:25

### analysis

analysis: TaskAnalysis

Analysis of the task complexity and requirements

Inherited from ExecutionPlanData.analysis

- Defined in packages/nexus-agents/src/agents/plan-converter.ts:27

### subtasks

subtasks: SubTask[]

Decomposed subtasks (empty if task didn't need decomposition)

Inherited from ExecutionPlanData.subtasks

- Defined in packages/nexus-agents/src/agents/plan-converter.ts:29

### assignments

assignments: ExpertAssignment[]

Expert role assignments for each subtask

Inherited from ExecutionPlanData.assignments

- Defined in packages/nexus-agents/src/agents/plan-converter.ts:31

### parallelGroups

parallelGroups: string[][]

Groups of subtask IDs that can execute in parallel

Inherited from ExecutionPlanData.parallelGroups

- Defined in packages/nexus-agents/src/agents/plan-converter.ts:33

### estimatedDuration

estimatedDuration: number

Estimated total duration in milliseconds

Inherited from ExecutionPlanData.estimatedDuration

- Defined in packages/nexus-agents/src/agents/plan-converter.ts:35

## Methods

### asWorkflowDefinition

- asWorkflowDefinition(options?: PlanConversionOptions): WorkflowDefinition

  Convert this execution plan to a reusable WorkflowDefinition.

  This "crystallizes" the dynamic plan into a static, replayable workflow that can be executed by WorkflowEngine.

  #### Parameters

  - `Optional` options: PlanConversionOptions

    Optional conversion configuration

  #### Returns WorkflowDefinition

  A valid WorkflowDefinition

  #### Example

      const result = await techLead.execute(task);
      const plan = result.value.output as ExecutionPlan;
      const workflow = plan.asWorkflowDefinition({
        name: 'my-workflow',
        version: '1.0.0',
      });
      await workflowEngine.execute(workflow, inputs);

  - Defined in packages/nexus-agents/src/agents/tech-lead.ts:151