@tpmjs/tools-workflow-validate-io
Validates that workflow step inputs/outputs are compatible and checks type chains between steps
Export "workflowValidateIO" not found in module
Last checked: 1/1/2026, 8:18:10 AM
Test @tpmjs/tools-workflow-validate-io (workflowValidateIO) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-workflow-validate-iopnpm add @tpmjs/tools-workflow-validate-ioyarn add @tpmjs/tools-workflow-validate-iobun add @tpmjs/tools-workflow-validate-iodeno add npm:@tpmjs/tools-workflow-validate-ioimport { workflowValidateIO } from '@tpmjs/tools-workflow-validate-io';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { workflowValidateIO } from '@tpmjs/tools-workflow-validate-io';
const result = await generateText({
model: openai('gpt-4o'),
tools: { workflowValidateIO },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
workflowobjectWorkflow object with steps array, each step has inputs and outputs
Try to auto-extract schema from the package
Validates that workflow step inputs/outputs are compatible and checks type chains between steps.
npm install @tpmjs/tools-workflow-validate-io
import { workflowValidateIOTool } from '@tpmjs/tools-workflow-validate-io'; const workflow = { steps: [ { id: 'fetch-data', outputs: { data: { type: 'object' }, count: { type: 'number' } } }, { id: 'process-data', inputs: { rawData: { type: 'object', source: 'fetch-data.data' }, threshold: { type: 'number', source: 'fetch-data.count' } }, outputs: { result: { type: 'string' } } }, { id: 'send-result', inputs: { message: { type: 'string', source: 'process-data.result' } } } ] }; const result = await workflowValidateIOTool.execute({ workflow }); console.log(result); // { // valid: true, // issues: [], // stepCount: 3 // }
Each workflow step should have:
id (required): Unique identifier for the stepname (optional): Human-readable nameinputs (optional): Object where keys are input names and values contain:
type (required): Expected type (string, number, object, array, any, etc.)source (optional): Reference to output in format "stepId.outputName"outputs (optional): Object where keys are output names and values contain:
type (required): Output typeThe validator supports:
string → stringany is compatible with all typesstring[] ↔ arrayobject ↔ { ... }number ↔ integerThe tool reports two severity levels:
const invalidWorkflow = { steps: [ { id: 'step1', outputs: { result: { type: 'string' } } }, { id: 'step2', inputs: { data: { type: 'number', source: 'step1.result' } // Type mismatch! } } ] }; const result = await workflowValidateIOTool.execute({ workflow: invalidWorkflow }); console.log(result); // { // valid: false, // issues: [ // { // stepId: 'step2', // stepIndex: 1, // severity: 'error', // message: "Type mismatch: Input 'data' expects type 'number' but source 'step1.result' from step 'step1' (index 0) outputs type 'string'", // field: 'data' // } // ], // stepCount: 2 // }
MIT
Downloads/month
61
Quality Score