# Interface IWorkflowEngine

Workflow engine interface.

interface IWorkflowEngine {
loadTemplate(
path: string,
): Promise<Result<WorkflowDefinition, ParseError>>;
execute(
workflow: WorkflowDefinition,
inputs: Record<string, unknown>,
): Promise<Result<WorkflowResult, WorkflowError>>;
getStatus(executionId: string): ExecutionStatus;
cancel(executionId: string): Promise<Result<void, WorkflowError>>;
listTemplates(): Promise<WorkflowTemplate[]>;
getTemplateByName(name: string): Promise<WorkflowDefinition | undefined>;
}

- Defined in packages/nexus-agents/src/core/types/workflow.ts:168

##### Index

### Methods

loadTemplate
execute
getStatus
cancel
listTemplates
getTemplateByName

## Methods

### loadTemplate

- loadTemplate(path: string): Promise<Result<WorkflowDefinition, ParseError>>

  Load workflow template from file.

  #### Parameters

  - path: string

    Path to template file

  #### Returns Promise<Result<WorkflowDefinition, ParseError>>

  Result with WorkflowDefinition or ParseError

  - Defined in packages/nexus-agents/src/core/types/workflow.ts:174

### execute

- execute(
  workflow: WorkflowDefinition,
  inputs: Record<string, unknown>,
  ): Promise<Result<WorkflowResult, WorkflowError>>

  Execute a workflow with inputs.

  #### Parameters

  - workflow: WorkflowDefinition

    Workflow definition

  - inputs: Record<string, unknown>

    Input values

  #### Returns Promise<Result<WorkflowResult, WorkflowError>>

  Result with WorkflowResult or WorkflowError

  - Defined in packages/nexus-agents/src/core/types/workflow.ts:182

### getStatus

- getStatus(executionId: string): ExecutionStatus

  Get execution status.

  #### Parameters

  - executionId: string

    Execution ID to check

  #### Returns ExecutionStatus

  Current execution status

  - Defined in packages/nexus-agents/src/core/types/workflow.ts:192

### cancel

- cancel(executionId: string): Promise<Result<void, WorkflowError>>

  Cancel a running workflow.

  #### Parameters

  - executionId: string

    Execution ID to cancel

  #### Returns Promise<Result<void, WorkflowError>>

  Result with void or WorkflowError

  - Defined in packages/nexus-agents/src/core/types/workflow.ts:199

### listTemplates

- listTemplates(): Promise<WorkflowTemplate[]>

  List available workflow templates.

  #### Returns Promise<WorkflowTemplate[]>

  Array of available templates

  - Defined in packages/nexus-agents/src/core/types/workflow.ts:205

### getTemplateByName

- getTemplateByName(name: string): Promise<WorkflowDefinition | undefined>

  Get a built-in or registered template definition by name.

  #### Parameters

  - name: string

    Template name (e.g., 'code-review')

  #### Returns Promise<WorkflowDefinition | undefined>

  The workflow definition, or undefined if not found

  - Defined in packages/nexus-agents/src/core/types/workflow.ts:212