<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[agents](../../) / [Exports](../modules) / IWorkflowValidator

# Interface: IWorkflowValidator\<TWorkflowData\>

Workflow Validator Interface

Core interface for validating workflow data structures.
All workflow validators must implement this interface.

## Type parameters

| Name            | Type                                     | Description                       |
| :-------------- | :--------------------------------------- | :-------------------------------- |
| `TWorkflowData` | extends [`IWorkflowData`](IWorkflowData) | Type of workflow data to validate |

## Table of contents

### Properties

- [name](IWorkflowValidator#name)
- [version](IWorkflowValidator#version)
- [dataFormat](IWorkflowValidator#dataformat)
- [availableRules](IWorkflowValidator#availablerules)

### Methods

- [validate](IWorkflowValidator#validate)
- [validateRule](IWorkflowValidator#validaterule)
- [canValidate](IWorkflowValidator#canvalidate)
- [getRuleDescriptions](IWorkflowValidator#getruledescriptions)
- [configureRules](IWorkflowValidator#configurerules)
- [autoRecover](IWorkflowValidator#autorecover)
- [getStats](IWorkflowValidator#getstats)
- [resetStats](IWorkflowValidator#resetstats)

## Properties

### name

• `Readonly` **name**: `string`

Validator name for identification

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:154](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L154)

---

### version

• `Readonly` **version**: `string`

Validator version

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:157](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L157)

---

### dataFormat

• `Readonly` **dataFormat**: `string`

Data format that this validator handles

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:160](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L160)

---

### availableRules

• `Readonly` **availableRules**: `string`[]

Available validation rules

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:163](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L163)

## Methods

### validate

▸ **validate**(`data`, `options?`): `Promise`\<[`IValidationResult`](IValidationResult)\>

Validate workflow data

#### Parameters

| Name       | Type                                       | Description               |
| :--------- | :----------------------------------------- | :------------------------ |
| `data`     | `TWorkflowData`                            | Workflow data to validate |
| `options?` | [`IValidationOptions`](IValidationOptions) | Validation options        |

#### Returns

`Promise`\<[`IValidationResult`](IValidationResult)\>

Promise resolving to validation result

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:172](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L172)

---

### validateRule

▸ **validateRule**(`data`, `rule`, `options?`): `Promise`\<[`IValidationResult`](IValidationResult)\>

Validate specific aspect of workflow data

#### Parameters

| Name       | Type                                       | Description               |
| :--------- | :----------------------------------------- | :------------------------ |
| `data`     | `TWorkflowData`                            | Workflow data to validate |
| `rule`     | `string`                                   | Specific rule to apply    |
| `options?` | [`IValidationOptions`](IValidationOptions) | Validation options        |

#### Returns

`Promise`\<[`IValidationResult`](IValidationResult)\>

Promise resolving to validation result for this rule

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:182](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L182)

---

### canValidate

▸ **canValidate**(`data`): data is TWorkflowData

Check if validator can handle the given data format

#### Parameters

| Name   | Type                             | Description   |
| :----- | :------------------------------- | :------------ |
| `data` | [`IWorkflowData`](IWorkflowData) | Data to check |

#### Returns

data is TWorkflowData

True if validator can handle this data

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:190](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L190)

---

### getRuleDescriptions

▸ **getRuleDescriptions**(): `Map`\<`string`, \{ `description`: `string` ; `severity`: [`ValidationSeverity`](../enums/ValidationSeverity) ; `category`: `string` ; `enabled`: `boolean` }\>

Get available validation rules with descriptions

#### Returns

`Map`\<`string`, \{ `description`: `string` ; `severity`: [`ValidationSeverity`](../enums/ValidationSeverity) ; `category`: `string` ; `enabled`: `boolean` }\>

Map of rule names to descriptions

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:197](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L197)

---

### configureRules

▸ **configureRules**(`rules`): `void`

Enable or disable specific validation rules

#### Parameters

| Name    | Type                         | Description                         |
| :------ | :--------------------------- | :---------------------------------- |
| `rules` | `Map`\<`string`, `boolean`\> | Map of rule names to enabled status |

#### Returns

`void`

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:209](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L209)

---

### autoRecover

▸ **autoRecover**(`data`, `issues`): `Promise`\<\{ `recoveredData`: `TWorkflowData` ; `recoveryResult`: \{ `success`: `boolean` ; `issuesFixed`: [`IValidationIssue`](IValidationIssue)[] ; `remainingIssues`: [`IValidationIssue`](IValidationIssue)[] ; `appliedFixes`: `string`[] } }\>

Perform automatic recovery for validation issues

#### Parameters

| Name     | Type                                     | Description                       |
| :------- | :--------------------------------------- | :-------------------------------- |
| `data`   | `TWorkflowData`                          | Original workflow data            |
| `issues` | [`IValidationIssue`](IValidationIssue)[] | Validation issues to recover from |

#### Returns

`Promise`\<\{ `recoveredData`: `TWorkflowData` ; `recoveryResult`: \{ `success`: `boolean` ; `issuesFixed`: [`IValidationIssue`](IValidationIssue)[] ; `remainingIssues`: [`IValidationIssue`](IValidationIssue)[] ; `appliedFixes`: `string`[] } }\>

Promise resolving to recovered data and recovery result

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:218](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L218)

---

### getStats

▸ **getStats**(): `Object`

Get validator statistics and metrics

#### Returns

`Object`

Validator performance metrics

| Name                    | Type                                                                                                          |
| :---------------------- | :------------------------------------------------------------------------------------------------------------ |
| `totalValidations`      | `number`                                                                                                      |
| `successfulValidations` | `number`                                                                                                      |
| `failedValidations`     | `number`                                                                                                      |
| `averageProcessingTime` | `number`                                                                                                      |
| `averageIssueCount`     | `number`                                                                                                      |
| `mostCommonIssues`      | \{ `rule`: `string` ; `count`: `number` ; `severity`: [`ValidationSeverity`](../enums/ValidationSeverity) }[] |
| `lastValidationAt?`     | `Date`                                                                                                        |

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:233](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L233)

---

### resetStats

▸ **resetStats**(): `void`

Reset validator statistics

#### Returns

`void`

#### Defined in

[packages/agents/src/interfaces/workflow-validator.ts:250](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/workflow-validator.ts#L250)
