Production-Ready · Self-Hosted · MIT License

Turn any webhook into a
protected, monetizable API

Drop-in gateway for n8n, Zapier, or any workflow. Add API key auth, per-key rate limits, and Stripe billing — without touching your workflow code.

terminal
# Protect your n8n workflow in 30 seconds
$ pip install -r requirements.txt
$ python3 cli.py n8n --url http://your-n8n/webhook/abc --name my-api

# Start accepting authenticated requests
$ python3 cli.py start
✅ Storage: SQLite (workflow-api.db)
✅ Workflow API running at http://0.0.0.0:8000

# Call your protected API
$ curl -X POST http://localhost:8000/run/my-api \
    -H "Authorization: Bearer wfapi-abc123..." \
    -d '{"prompt": "hello"}'

From webhook to secure API in one command

Workflow API is a transparent proxy. Your workflows don't change — you just point them through us.

🧑‍💻

Customer Request

Your user calls /run/my-api with a Bearer API key

🔐

Auth + Rate Limit

SHA-256 key validation, per-key token bucket, scope check

Your Workflow

Request proxied to n8n, Zapier, or any webhook URL

📤

Response Returned

Workflow response passed back to your customer unchanged

Everything you need to ship
a production API

No external databases. No infrastructure to manage. Everything runs in a single process.

🔑

API Key Authentication

SHA-256 hashed keys with automatic prefix generation. Keys are shown once at creation and can never be recovered — just like Stripe or OpenAI.

⏱️

Per-Key Rate Limiting

In-memory token bucket rate limiter with per-key granularity. Set 20 req/min for free-tier users, 1000 for enterprise — per key, not per IP.

💳

Stripe Auto-Provisioning

Share a Stripe Payment Link. Customer pays → key is created, scoped, and emailed automatically. Cancel subscription → key is revoked. Zero manual work.

🛡️

HMAC Webhook Verification

Every incoming Stripe webhook is verified via Stripe-Signature HMAC before touching business logic. Forged payloads are rejected with 401.

Security Hardened

48h Cancellation Grace Period

When a customer cancels, their key stays active for 48 hours. If they resubscribe within the window, the key is never revoked. Reduces churn disputes.

New
📊

Real-Time Dashboard

Built-in admin dashboard with live traffic charts, per-key analytics, and a JSON stats API for building your own custom portal.

🎯

Gateway Scoping

Restrict API keys to specific workflows. A "Basic" key can access only one endpoint while "Pro" gets access to all — enforced at the gateway level.

📧

Automatic Key Delivery

Stripe checkout triggers an HTML email with the API key, usage examples, and rate limit info — sent directly to the customer's inbox via SMTP.

🗄️

SQLite + WAL Mode

Embedded SQLite database with WAL journaling for safe multi-worker reads. No Postgres, no Redis, no Docker Compose dependencies to manage.

Built for production from day one

Not a hobby project with bolted-on auth. Every layer is hardened.

SHA-256 Key Hashing

Raw keys never stored. Irreversible hashing, same as Stripe and GitHub.

HMAC Signature Verification

Every Stripe webhook verified before business logic runs. 401 on mismatch.

SSRF Protection

Target URLs validated at startup. Localhost, private IPs, and cloud metadata blocked.

Env-Only Secrets

Webhook signing secret loaded from env vars only — never from config files in git.

Constant-Time Auth

Admin key comparison uses secrets.compare_digest to prevent timing attacks.

Scrubbed Error Responses

500 errors return generic messages. No stack traces, file paths, or class names exposed.

Persistent Grace Period

Pending cancellations stored in DB, not memory. Survives restarts and multi-worker.

Nginx Hardening

Drop-in config with HTTPS redirect, 1MB body limit, rate limiting, and security headers.

Deploy in under 5 minutes

No build step. No framework. Clone, configure, run. Works on any VPS, PaaS, or Docker host.

1

Clone & install

Python 3.11+ and pip. No extra databases.

2

Point to your workflow

One CLI command connects your n8n/Zapier webhook.

3

Start accepting requests

API keys, rate limits, and billing — all handled.

setup.sh
# 1. Clone and install
$ git clone https://github.com/00Harshh/Workflow-API.git
$ cd workflow-api
$ python3 -m venv .venv && source .venv/bin/activate
$ pip install -r requirements.txt

# 2. Connect your n8n workflow
$ python3 cli.py n8n \
  --url https://n8n.example.com/webhook/abc \
  --name lead-gen

# 3. Set secrets and start
$ export STRIPE_WEBHOOK_SECRET="whsec_..."
$ export WORKFLOW_API_ADMIN_KEY="your-secret"
$ python3 cli.py start --workers 4

✅ Storage: SQLite (workflow-api.db)
✅ Cancellation poller started (48h grace)
✅ Workflow API running at http://0.0.0.0:8000

Start monetizing your workflows

Open source, self-hosted, and free. Deploy on your own infrastructure in under 5 minutes.

View on GitHub
$ git clone https://github.com/00Harshh/Workflow-API.git