npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tpmjs/tools-workflow-validate-io

v0.2.0

Published

Validates that workflow step inputs/outputs are compatible and checks type chains between steps

Downloads

84

Readme

@tpmjs/tools-workflow-validate-io

Validates that workflow step inputs/outputs are compatible and checks type chains between steps.

Features

  • Type Compatibility Checking: Validates that connected steps have compatible input/output types
  • Source Validation: Ensures input sources reference existing step outputs
  • Comprehensive Error Reporting: Provides detailed error and warning messages with step context
  • Flexible Type System: Supports basic types, arrays, objects, and 'any' type
  • Unused Output Detection: Warns about outputs that are never consumed by subsequent steps

Installation

npm install @tpmjs/tools-workflow-validate-io

Usage

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
// }

Workflow Structure

Each workflow step should have:

  • id (required): Unique identifier for the step
  • name (optional): Human-readable name
  • inputs (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 type

Type Compatibility

The validator supports:

  • Exact matches: stringstring
  • Any type: any is compatible with all types
  • Array compatibility: string[]array
  • Object compatibility: object{ ... }
  • Number/Integer: numberinteger

Validation Issues

The tool reports two severity levels:

Errors (prevent valid: true)

  • Missing step IDs
  • Missing type definitions
  • Unknown source references
  • Type mismatches between connected steps

Warnings (don't prevent valid: true)

  • Steps with no inputs or outputs
  • Outputs never used by subsequent steps (except final step)

Example with Errors

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
// }

Use Cases

  • Agent Systems: Validate tool chains before execution
  • Workflow Builders: Real-time validation in visual workflow editors
  • CI/CD: Validate workflow definitions in automated pipelines
  • Documentation: Generate workflow diagrams with validated connections

License

MIT