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

@netpad/netpad-ext-approval-gate

v1.0.3

Published

Human-in-the-loop approval workflow extension for NetPad

Readme

@netpad/netpad-ext-approval-gate

Human-in-the-loop approval workflow extension for NetPad.

Overview

This extension provides an Approval Gate workflow node that pauses workflow execution until a human approves, rejects, or takes other action. Perfect for:

  • 💰 Expense approvals — Route spending requests to managers
  • 🔐 Access requests — Get sign-off before granting permissions
  • 📝 Content review — Approve blog posts, marketing materials
  • 👤 HR workflows — Hiring approvals, PTO requests
  • ⚙️ Configuration changes — Approve production deployments

Features

Multiple Approver Strategies

| Strategy | Description | |----------|-------------| | Any | First approver to decide completes the request | | All | Every designated approver must approve | | Majority | More than 50% must approve | | Sequential | Approvers must act in order (Manager → Director → VP) |

Configurable Timeouts

Set automatic actions when approvers don't respond:

  • Auto-Approve — Proceed if no response
  • Auto-Reject — Decline if no response
  • Escalate — Route to a higher authority
  • Expire — Cancel the request

Notification Channels

  • ✉️ Email — Send approval request emails with direct action links
  • 🔗 Webhook — Integrate with Slack, Teams, or custom systems
  • 🔔 In-App — Dashboard shows pending approvals (coming soon)

Full Audit Trail

Every action is logged:

  • Who created the request
  • Who was notified
  • When reminders were sent
  • Who made decisions (with comments)
  • Final outcome and timing

Installation

npm install @netpad/netpad-ext-approval-gate

Or with yarn:

yarn add @netpad/netpad-ext-approval-gate

Quick Start

1. Register the Extension

// In src/lib/extensions/loader.ts
import approvalGateExtension from '@netpad/netpad-ext-approval-gate';

const extensions = [
  approvalGateExtension,
  // ... other extensions
];

export default extensions;

2. Use in a Workflow

Once registered, the Approval Gate node appears in the workflow editor palette under the Logic category.

Basic Expense Approval Workflow

[Form Trigger: Expense Report]
         ↓
[Approval Gate]
  • Title: "Expense: {{formData.description}}"
  • Category: Expense
  • Approver: {{formData.managerEmail}}
  • Timeout: 72 hours → Escalate
         ↓
    ┌────┴────┐
    ↓         ↓
[Approved] [Rejected]
    ↓         ↓
[Process]  [Notify
 Payment]   Requester]

3. Handle Decisions via API

When an approver makes a decision:

// POST /api/ext/approval-gate/requests/APR-2026-ABC123/decide
{
  "decision": "approve",
  "comments": "Looks good, approved for Q4 budget."
}

Node Configuration

Basic Settings

| Field | Type | Description | |-------|------|-------------| | title | text | Request title (supports {{variables}}) | | description | textarea | Additional context for approvers | | category | select | General, Expense, Access, Content, HR, Config | | priority | select | Low, Medium, High, Critical |

Approver Settings

| Field | Type | Description | |-------|------|-------------| | approverType | select | How to determine approvers | | staticApprovers | textarea | Email addresses (one per line) | | approverRole | text | Role name for role-based lookup | | dynamicApproverExpression | expression | Expression resolving to email(s) | | approverStrategy | select | Any, All, Majority, Sequential |

Timeout Settings

| Field | Type | Description | |-------|------|-------------| | timeoutEnabled | boolean | Enable automatic timeout | | timeoutHours | number | Hours before timeout (default: 72) | | timeoutAction | select | What to do on timeout | | escalateTo | text | Email for escalation |

Notification Settings

| Field | Type | Description | |-------|------|-------------| | sendEmailNotification | boolean | Send email to approvers | | sendWebhookNotification | boolean | Send webhook on events | | webhookUrl | text | Webhook endpoint URL |

Data Settings

| Field | Type | Description | |-------|------|-------------| | includeFormData | boolean | Show form submission to approvers | | includePreviousNodeData | boolean | Include previous node outputs | | customFieldsExpression | json | Custom fields as JSON |

Output Handles

The node has five output handles for routing based on decision:

| Handle | Description | |--------|-------------| | approved | Request was approved | | rejected | Request was rejected | | escalated | Request was escalated to another approver | | expired | Request timed out | | info-requested | Approver requested more information |

API Endpoints

The extension registers these API endpoints under /api/ext/approval-gate/:

GET /api/ext/approval-gate/pending

Get pending approvals for the current user.

// Response
{
  "success": true,
  "approvals": [...],
  "total": 5,
  "stats": {
    "pending": 5,
    "overdue": 1,
    "decidedToday": 3
  }
}

GET /api/ext/approval-gate/requests/:requestId

Get details of a specific approval request.

POST /api/ext/approval-gate/requests/:requestId/decide

Record a decision on an approval request.

// Request
{
  "decision": "approve" | "reject" | "escalate" | "request-info" | "delegate",
  "comments": "Optional comments",
  "conditions": "Optional conditions for conditional approval",
  "delegateTo": "[email protected]",
  "delegateReason": "Out of office"
}

GET /api/ext/approval-gate/stats

Get approval statistics for the organization.

Webhook Payload

When webhook notifications are enabled, this payload is sent:

{
  "event": "approval_request_created",
  "timestamp": "2026-01-23T14:30:00Z",
  "request": {
    "requestId": "APR-2026-ABC123",
    "title": "Expense Report: Q4 Marketing",
    "category": "expense",
    "priority": "high",
    "status": "pending",
    "requester": {
      "name": "Jane Smith",
      "email": "[email protected]"
    }
  },
  "links": {
    "view": "https://app.netpad.io/approve/...",
    "approve": "https://app.netpad.io/approve/.../approve",
    "reject": "https://app.netpad.io/approve/.../reject"
  }
}

Examples

Dynamic Approver from Form Data

Approver Type: Dynamic
Expression: {{formData.managerEmail}}

Multi-Level Approval Chain

Create two Approval Gate nodes in sequence:

[Approval Gate 1: Manager]
  Strategy: Any
         ↓ (approved)
[Approval Gate 2: Finance Director]
  Strategy: Any
         ↓ (approved)
[Process Payment]

Conditional Approval with Amount Threshold

[Switch Node]
  If amount > $5000: → [Senior Approval Gate]
  Otherwise: → [Standard Approval Gate]

Slack Notification Integration

Webhook URL: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX

The webhook payload can be used with Slack's Incoming Webhooks to post approval requests to a channel.

Roadmap

v1.1 (Planned)

  • [ ] Conditional approvals (approve with conditions)
  • [ ] Bulk approve/reject from dashboard
  • [ ] Mobile push notifications
  • [ ] Approval templates

v1.2 (Planned)

  • [ ] Multi-level approval chains (built-in)
  • [ ] Out-of-office auto-delegation
  • [ ] SLA reporting dashboard
  • [ ] Custom approval forms

Future

  • [ ] AI-assisted decision suggestions
  • [ ] Risk scoring
  • [ ] External approvers (non-NetPad users)
  • [ ] Blockchain audit trail

License

MIT

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.

Support