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

@consensus-tools/workflows

v0.7.0

Published

Workflow execution engine and cron scheduler for consensus-tools

Readme

@consensus-tools/workflows

Define multi-step workflows with node-graph execution, checkpoint persistence, human-in-the-loop pauses, and cron scheduling.

Install

pnpm add @consensus-tools/workflows

Quick Start -- WorkflowRunner

import { WorkflowRunner } from "@consensus-tools/workflows";
import { createStorage } from "@consensus-tools/core";

const storage = await createStorage(config);
const runner = new WorkflowRunner(storage);

// Create and run a workflow
const workflow = await runner.createWorkflow("My Review", {
  nodes: [
    { id: "trigger", type: "trigger", label: "Start", config: { source: "manual" } },
    { id: "guard", type: "guard", label: "Code Guard", config: { guardType: "code_merge" } },
    { id: "approve", type: "hitl", label: "Human Approval", config: { channel: "slack" } },
    { id: "merge", type: "action", label: "Merge", config: { action: "github.merge_pr" } },
  ],
});

const run = await runner.run(workflow.id);
// run.status => "completed" | "waiting" | "failed"

// Resume after human approval
const resumed = await runner.resume(workflow.id, run.runId, "approved", "alice");

Templates -- Pre-built Workflows

import { WorkflowRunner, prMergeGuardTemplate, listTemplates, getTemplateById } from "@consensus-tools/workflows";

// Register a built-in template
const runner = new WorkflowRunner(storage);
runner.registerTemplate(prMergeGuardTemplate);

// List all template definitions
const templates = listTemplates();
// => [{ id: "template-github-pr", name: "Template 1 - GitHub PR Merge Guard", ... }, ...]

const tmpl = getTemplateById("template-linear-tasks");

Three built-in templates:

| Template | ID | Description | |---|---|---| | PR Merge Guard | template-github-pr | GitHub PR -> parallel agent review -> guard -> human approval -> merge | | Linear Task Decomposition | template-linear-tasks | Linear task -> agent decomposition -> guard -> human approval -> create subtasks | | Cron Auto-Assign | template-linear-assign | Cron -> fetch unassigned subtasks -> parallel review -> guard -> assign |

NodeExecutor -- Graph-based Execution

import { NodeExecutor, validateWorkflowDefinition } from "@consensus-tools/workflows";

const validation = validateWorkflowDefinition(definition);
if (!validation.valid) console.error(validation.errors);

const executor = new NodeExecutor(deps); // deps: { engine, guardEngine, storage, ... }
const output = await executor.execute(node, context, { boardId, runId, workflowId });

Node types: trigger, agent, group (parallel), guard, hitl, action.

CronScheduler

import { CronScheduler, shouldRunNow } from "@consensus-tools/workflows";

const cron = new CronScheduler(storage, async (workflowId) => {
  await runner.run(workflowId);
});

await cron.register(workflow.id, "*/30 * * * *"); // every 30 minutes
cron.start();

// Check manually
shouldRunNow("0 9 * * 1"); // true if it's 9:00 on Monday

await cron.list();
await cron.unregister(workflow.id);
cron.stop();

Exports

| Export | Kind | Description | |---|---|---| | WorkflowRunner | Class | Create, run, resume workflows with checkpoint persistence | | NodeExecutor | Class | Execute individual nodes in a workflow graph | | validateWorkflowDefinition | Function | Validate a workflow definition before execution | | CronScheduler | Class | IStorage-backed cron scheduling with dedup | | shouldRunNow(expr) | Function | Check if a 5-field cron expression matches now | | prMergeGuardTemplate | Const | Template: GitHub PR merge guard | | linearTaskDecompTemplate | Const | Template: Linear task decomposition | | cronAutoAssignTemplate | Const | Template: Cron auto-assign subtasks | | listTemplates() / getTemplateById(id) | Function | Discover built-in templates | | WorkflowTemplate | Type | Template definition with id, name, steps, and handler | | WorkflowStepHandler | Type | Handler function for template-based workflow steps | | WorkflowContext | Type | Context passed to step handlers (workflowId, runId, storage, cursor) | | WorkflowStepResult | Type | Step result with status (completed / failed / waiting) | | NodeExecutorDeps | Type | Dependencies for NodeExecutor constructor | | CredentialProvider | Type | Credential provider interface for node execution | | WorkflowNode | Type | Single node in a workflow graph definition | | WorkflowDefinition | Type | Full workflow definition with nodes array | | NodeExecIds | Type | IDs context passed to node execution (boardId, runId, workflowId) | | NodeOutput | Type | Output from a single node execution | | TemplateDefinition | Type | Metadata for a built-in template |

Links

consensus-tools on GitHub