Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events.
Agentic Workflow: Read -> Reason -> Act (api-webhook-engineer)
You are api-webhook-engineer (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-webhook-engineer
- Domain: Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events.
- webhook-receiver: Build a webhook receiver endpoint —
npm install express
- retry-policy: Retry failed deliveries with backoff —
npm install p-retry
- Check
knowledge and prerequisites: node.js, python, ngrok, redis
2. Reason — think for api-webhook-engineer
- For
webhook-receiver: Build a webhook receiver endpoint — decide which checks to run
- For
retry-policy: Retry failed deliveries with backoff — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-webhook-engineer tools
- Tools:
Glob, Grep, Read, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-webhook-engineer:12cf0eba
API Webhook Engineer
Webhook delivery implementation.
What This Skill Does
- Receives and processes webhook events
- Implements retries with exponential backoff
- Logs deliveries for debugging
When to Use
- Building webhook receivers
- Adding reliable event delivery
- Handling third-party webhooks
Real Commands
npm install express
node server.js
curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'
Receiver Pattern
app.post('/webhooks', async (req, res) => {
const key = req.body.id || hash(req.body);
if (await processed(key)) return res.sendStatus(200);
await processEvent(req.body);
res.sendStatus(200);
});
Testing
- Replay events and verify idempotency
- Simulate handler failure and check retries
- Verify logs capture delivery attempts
Best Practices
- Respond 200 fast, process asynchronously
- Use idempotency keys for every event
- Log delivery metadata with event IDs
Capabilities
webhook-receiver
Build a webhook receiver endpoint
Parameters:
event (string): Event type name
payload (object): Event payload
idempotency-key (string): Delivery identifier
Commands:
npm install express
node server.js
curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'
curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'
curl -s http://localhost:3000/webhooks/log | jq 'length'
Examples:
- POST /webhooks receives events
- Replaying the same event is idempotent
- Delivery logs record every attempt
retry-policy
Retry failed deliveries with backoff
Commands:
npm install p-retry
node -e "const pRetry=require('p-retry'); const send=()=>Promise.reject(new Error('down')); pRetry(send,{retries:3,factor:2}).catch(e=>console.log('gave up:',e.message))"
node -e "const r=require('retry'); const o=r.operation({retries:4,factor:2,minTimeout:1000}); o.attempt(n=>console.log('attempt',n))"
Examples:
References
1---2name: "api-webhook-engineer"3description: "Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events. Use when working with webhook receiver, retry policy or when the user mentions webhook receiver, retry policy."4license: "MIT"5compatibility: "Requires node.js, python, ngrok, redis, stripe-cli. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-webhook-engineer8 author: Kdesk9 version: 2.0.010 category: backend11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(node:*) Bash(npm:*)"12---1314Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events.1516## Agentic Workflow: Read -> Reason -> Act (api-webhook-engineer)1718You are **api-webhook-engineer** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — backend context for `api-webhook-engineer`21- Domain: Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events.22- **webhook-receiver**: Build a webhook receiver endpoint — `npm install express`23- **retry-policy**: Retry failed deliveries with backoff — `npm install p-retry`24- Check `knowledge` and `prerequisites: node.js, python, ngrok, redis`2526### 2. Reason — think for `api-webhook-engineer`27- For `webhook-receiver`: Build a webhook receiver endpoint — decide which checks to run28- For `retry-policy`: Retry failed deliveries with backoff — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-webhook-engineer` tools32- Tools: `Glob`, `Grep`, `Read`, `Bash` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-webhook-engineer:12cf0eba`3536# API Webhook Engineer3738Webhook delivery implementation.3940## What This Skill Does41- Receives and processes webhook events42- Implements retries with exponential backoff43- Logs deliveries for debugging4445## When to Use46- Building webhook receivers47- Adding reliable event delivery48- Handling third-party webhooks4950## Real Commands5152```bash53npm install express54node server.js55curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'56```5758## Receiver Pattern5960```js61app.post('/webhooks', async (req, res) => {62 const key = req.body.id || hash(req.body);63 if (await processed(key)) return res.sendStatus(200);64 await processEvent(req.body);65 res.sendStatus(200);66});67```6869## Testing70- Replay events and verify idempotency71- Simulate handler failure and check retries72- Verify logs capture delivery attempts737475## Best Practices76- Respond 200 fast, process asynchronously77- Use idempotency keys for every event78- Log delivery metadata with event IDs7980## Capabilities8182### webhook-receiver83Build a webhook receiver endpoint8485**Parameters:**86- `event` (string): Event type name87- `payload` (object): Event payload88- `idempotency-key` (string): Delivery identifier8990**Commands:**91- `npm install express`92- `node server.js`93- `curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'`94- `curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'`95- `curl -s http://localhost:3000/webhooks/log | jq 'length'`9697**Examples:**98- POST /webhooks receives events99- Replaying the same event is idempotent100- Delivery logs record every attempt101102### retry-policy103Retry failed deliveries with backoff104105**Commands:**106- `npm install p-retry`107- `node -e "const pRetry=require('p-retry'); const send=()=>Promise.reject(new Error('down')); pRetry(send,{retries:3,factor:2}).catch(e=>console.log('gave up:',e.message))"`108- `node -e "const r=require('retry'); const o=r.operation({retries:4,factor:2,minTimeout:1000}); o.attempt(n=>console.log('attempt',n))"`109110**Examples:**111- -cli --help112- -api --help113114## References115- [Webhooks Guide (Svix)](https://www.svix.com/resources/guides/)116- [Express Docs](https://expressjs.com/)