Skip to content

agents / Exports / WorkflowValidatorInterface

Interface: WorkflowValidatorInterface<TWorkflowData>

Workflow Validator Interface

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

Type parameters

NameTypeDescription
TWorkflowDataextends WorkflowDataType of workflow data to validate

Implemented by

Table of contents

Properties

Methods

Properties

name

Readonly name: string

Validator name for identification

Defined in

packages/agents/src/interfaces/workflow-validator.ts:154


version

Readonly version: string

Validator version

Defined in

packages/agents/src/interfaces/workflow-validator.ts:157


dataFormat

Readonly dataFormat: string

Data format that this validator handles

Defined in

packages/agents/src/interfaces/workflow-validator.ts:160


availableRules

Readonly availableRules: string[]

Available validation rules

Defined in

packages/agents/src/interfaces/workflow-validator.ts:163

Methods

validate

validate(data, options?): Promise<ValidationResult>

Validate workflow data

Parameters

NameTypeDescription
dataTWorkflowDataWorkflow data to validate
options?ValidationOptionsValidation options

Returns

Promise<ValidationResult>

Promise resolving to validation result

Defined in

packages/agents/src/interfaces/workflow-validator.ts:172


validateRule

validateRule(data, rule, options?): Promise<ValidationResult>

Validate specific aspect of workflow data

Parameters

NameTypeDescription
dataTWorkflowDataWorkflow data to validate
rulestringSpecific rule to apply
options?ValidationOptionsValidation options

Returns

Promise<ValidationResult>

Promise resolving to validation result for this rule

Defined in

packages/agents/src/interfaces/workflow-validator.ts:182


canValidate

canValidate(data): data is TWorkflowData

Check if validator can handle the given data format

Parameters

NameTypeDescription
dataWorkflowDataData to check

Returns

data is TWorkflowData

True if validator can handle this data

Defined in

packages/agents/src/interfaces/workflow-validator.ts:190


getRuleDescriptions

getRuleDescriptions(): Map<string, { description: string ; severity: ValidationSeverity ; category: string ; enabled: boolean }>

Get available validation rules with descriptions

Returns

Map<string, { description: string ; severity: ValidationSeverity ; category: string ; enabled: boolean }>

Map of rule names to descriptions

Defined in

packages/agents/src/interfaces/workflow-validator.ts:197


configureRules

configureRules(rules): void

Enable or disable specific validation rules

Parameters

NameTypeDescription
rulesMap<string, boolean>Map of rule names to enabled status

Returns

void

Defined in

packages/agents/src/interfaces/workflow-validator.ts:209


autoRecover

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

Perform automatic recovery for validation issues

Parameters

NameTypeDescription
dataTWorkflowDataOriginal workflow data
issuesValidationIssue[]Validation issues to recover from

Returns

Promise<{ recoveredData: TWorkflowData ; recoveryResult: { success: boolean ; issuesFixed: ValidationIssue[] ; remainingIssues: ValidationIssue[] ; appliedFixes: string[] } }>

Promise resolving to recovered data and recovery result

Defined in

packages/agents/src/interfaces/workflow-validator.ts:218


getStats

getStats(): Object

Get validator statistics and metrics

Returns

Object

Validator performance metrics

NameType
totalValidationsnumber
successfulValidationsnumber
failedValidationsnumber
averageProcessingTimenumber
averageIssueCountnumber
mostCommonIssues{ rule: string ; count: number ; severity: ValidationSeverity }[]
lastValidationAt?Date

Defined in

packages/agents/src/interfaces/workflow-validator.ts:233


resetStats

resetStats(): void

Reset validator statistics

Returns

void

Defined in

packages/agents/src/interfaces/workflow-validator.ts:250

Released under the MIT License.