Using Skooh with Node-RED Behind the Firewall (HTTP In Node)
Receive webhooks in Node-RED flows, acknowledge fast, process in background, and replay for debugging.
Use Case
Node-RED is perfect for webhook-driven automation:
- Visual flow design
- Easy integrations
- Low-code transformations
But Node-RED typically runs internally. Skooh brings external webhooks to it.
Setup
1. Create Skooh Endpoint
Create "Node-RED Webhooks" in Skooh.
2. Run the Skooh Proxy
Using the Desktop App:
- Download the Skooh Desktop App
- Enter your API key and hook token
- Set forwarding URL to your Node-RED (e.g., `http://localhost:1880/webhook\`)
- Click Connect
Using Docker:
docker run -d \\
--name skooh-nodered \\
-e SKOOH_TOKEN=nodered-webhooks \\
-e SKOOH_API_KEY=your_api_key \\
-e FORWARD_URL=http://nodered:1880/webhook \\
--network nodered-network \\
--restart unless-stopped \\
skooh/proxy
3. Node-RED HTTP In Node
Note: See Node-RED's HTTP nodes documentation for details on handling HTTP requests.
Create a flow with HTTP In node:
- Method: POST
- URL: /webhook
The Fast-ACK Pattern
Webhook providers expect quick responses. Use this Node-RED pattern:
[HTTP In] → [Function: ACK] → [HTTP Response]
↓
[Function: Process]
↓
[Your Logic...]
ACK Function
// Immediately prepare response
msg.statusCode = 200;
msg.payload = { received: true };
// Clone for async processing
node.send([null, msg]); // Second output for processing
return msg; // First output for response
HTTP Response
Connect to first ACK output for immediate response.
Process Function
Connect to second ACK output:
// Process the webhook asynchronously
const webhook = msg.req.body;
msg.payload = {
source: 'webhook',
event: webhook.event,
data: webhook.data,
timestamp: new Date().toISOString()
};
return msg;
Example: Stripe → Node-RED → Slack
Flow:
[HTTP In] → [ACK] → [HTTP Response]
↓
[Switch: event]
↓
┌────────────────────┐
↓ ↓
[payment.success] [payment.failed]
↓ ↓
[Slack: Success] [Slack: Alert]
Switch Node
Route by webhook type:
- Property: `payload.type`
- Rules:
- == "payment_intent.succeeded" → Output 1
- == "payment_intent.payment_failed" → Output 2
Slack Node
Use the Slack node to post messages.
Signature Verification
Add a function node before processing:
const crypto = require('crypto');
const sig = msg.req.headers['stripe-signature'];
const payload = JSON.stringify(msg.req.body);
const secret = env.get('STRIPE_WEBHOOK_SECRET');
// Parse signature
const parts = sig.split(',').reduce((acc, part) => {
const [key, value] = part.split('=');
acc[key] = value;
return acc;
}, {});
// Verify
const expectedSig = crypto
.createHmac('sha256', secret)
.update(\`\${parts.t}.\${payload}\`)
.digest('hex');
if (parts.v1 !== expectedSig) {
node.error('Invalid signature');
return null;
}
return msg;
Debugging with Replay
Node-RED debugging is visual, but triggering webhooks repeatedly is tedious.
Use Skooh Replay:
- Trigger a real webhook
- Find it in Skooh dashboard
- Click Replay
- Watch the flow execute in Node-RED
- Check debug panel
- Fix issues, replay again
No need to trigger real events!
Docker Compose
version: '3.8'
services:
nodered:
image: nodered/node-red
ports:
- "1880:1880"
volumes:
- nodered-data:/data
skooh-proxy:
image: skooh/proxy
environment:
SKOOH_TOKEN: nodered-webhooks
SKOOH_API_KEY: \${SKOOH_API_KEY}
FORWARD_URL: http://nodered:1880/webhook
depends_on:
- nodered
restart: unless-stopped
volumes:
nodered-data:
Production Tips
- Use flows for ACK: Always respond quickly
- Error handling: Add Catch nodes for failures
- Logging: Use Debug nodes liberally
- Replay testing: Test edge cases without real events
- Multiple endpoints: Create separate Skooh endpoints for different webhook sources
Written by Skooh Team