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

@processengine/dataflows

v2.0.0

Published

Runtime for dataflow artifacts in ProcessEngine Flow 5

Downloads

223

Readme

@processengine/dataflows

Runtime for dataflow artifacts in ProcessEngine Flow 5.

@processengine/dataflows validates, prepares and executes linear dataflow artifacts composed of MAPPINGS, RULES and DECISIONS pipeline items. It is the runtime for PROCESS/DATA steps in Flow 5.

Role in ProcessEngine

PROCESS/DATA (flow graph step)
  → processor runtime calls executeDataflow(...)
  → @processengine/dataflows executes dataflow artifact
  → returns DataflowOutput.writes[]
  → @processengine/semantics.reduce applies writes to process state

Install

npm install @processengine/dataflows

Quick start

import { validateDataflow, prepareDataflow, executeDataflow } from '@processengine/dataflows';

// 1. Validate
const source = {
  id: 'dataflow.example',
  version: '1.0.0',
  schema: {
    '$.context.data.facts.result': {
      title: 'Result facts',
      description: 'Facts produced from the input application for the quick start example.',
      fields: {
        ok: {
          type: 'boolean',
          title: 'Input is acceptable',
          description: 'true when the application payload can continue through the example dataflow.'
        }
      }
    }
  },
  pipeline: [{
    id: 'map_input',
    type: 'MAPPINGS',
    kind: 'facts',
    artefactId: 'mappings.example',
    contract: {
      input: { refs: { '$': '$.context.input.application' } },
      output: { ref: '$.context.data.facts.result' }
    }
  }]
};

const validation = validateDataflow(source);
if (!validation.ok) throw new Error('Invalid');

// 2. Prepare (once, cache the result)
const artifact = prepareDataflow(source);

// 3. Execute
const state = { context: { input: { application: { ok: true } }, data: {} } };
const registries = {
  mappings: {
    get: (id) => ({ id }),
    executeMappings: (_artifact, input) => ({ output: { ok: input.ok } })
  }
};
const result = executeDataflow(artifact, { state, registries });
// result.writes[] — transport-safe, pass directly to semantics.reduce

Design rule

The package is designed from the public contract inward:

  • one normative source shape, not several accepted aliases;
  • one runtime result contract from neighbour libraries: { output, trace? };
  • child runtime trace, if returned, is accepted but not merged into dataflow trace;
  • no hidden compatibility branches for malformed legacy artifacts;
  • no hidden fallback behavior for malformed artifacts;
  • validation rejects unsupported fields instead of interpreting them leniently;
  • runtime failure trace is observable in DataflowRuntimeError.details.trace when trace is enabled.

Every pipeline item has exactly one input contract: input.refs.

contract: {
  input: { refs: { '$': '$.context.data.payloads.clientComparison' } },
  output: { ref: '$.context.data.facts.clientComparison' }
}

The special $ target passes the resolved state value as the whole child input. Named targets assemble a compact object for the child runtime:

contract: {
  input: {
    refs: {
      payload: '$.context.input.application',
      'context.currentDate': '$.context.input.currentDate',
      effects: '$.context.effects'
    }
  },
  output: { ref: '$.context.data.payloads.clientComparison' }
}

The $ target cannot be mixed with named targets. Read refs may point to $.context.input, $.context.effects, $.context.data, or nested paths under those buckets.

Schema nodes and fields are part of the human-readable contract. Each schema node and each declared field must have both title and description. This keeps dataflow artifacts usable as code-as-docs and makes the data contract readable in Flow UI, reviews, and business-requirement traceability.

Lifecycle

validateDataflow(source, options?)  → ValidationResult
prepareDataflow(source, options?)   → DataflowArtifact
executeDataflow(artifact, input, options?) → DataflowOutput

Non-goals

@processengine/dataflows does not know the flow graph, does not move currentStepId, does not persist state, and does not own retry/fail policy.

Examples

The examples/ directory contains normative examples:

  • happy-path.json — minimal valid dataflow artifact;
  • failing-path-missing-input.json — valid artifact that demonstrates runtime missing-input behavior;
  • interop-read-after-write.json — MAPPINGS → DECISIONS read-after-write interop.

Documentation

See SPEC_RU.md for full normative specification. See COMPATIBILITY.md for compatibility guarantees. See MIGRATION.md for migration from Flow 3.