# Interface IWorkflowRouter

Public interface for the workflow router.

interface IWorkflowRouter {
route(
signals: TaskSignals,
options?: WorkflowRouterOptions,
): WorkflowRoutingDecision;
recordOutcome(outcome: PatternOutcome): void;
getMetrics(pattern?: WorkflowPattern): readonly PatternMetrics[];
}

- Defined in packages/nexus-agents/src/orchestration/workflow-router.ts:76

##### Index

### Methods

route
recordOutcome
getMetrics

## Methods

### route

- route(
  signals: TaskSignals,
  options?: WorkflowRouterOptions,
  ): WorkflowRoutingDecision

  Routes a task to the optimal workflow pattern.

  #### Parameters

  - signals: TaskSignals
  - `Optional` options: WorkflowRouterOptions

  #### Returns WorkflowRoutingDecision

  - Defined in packages/nexus-agents/src/orchestration/workflow-router.ts:78

### recordOutcome

- recordOutcome(outcome: PatternOutcome): void

  Records an execution outcome for performance tracking.

  #### Parameters

  - outcome: PatternOutcome

  #### Returns void

  - Defined in packages/nexus-agents/src/orchestration/workflow-router.ts:80

### getMetrics

- getMetrics(pattern?: WorkflowPattern): readonly PatternMetrics[]

  Gets aggregated metrics, optionally filtered by pattern.

  #### Parameters

  - `Optional` pattern: WorkflowPattern

  #### Returns readonly PatternMetrics[]

  - Defined in packages/nexus-agents/src/orchestration/workflow-router.ts:82