n8n Cloud Integration
Use xpay Pay-to-Run with n8n Cloud using standard webhook nodes - no custom installation required.
Why This Approach?
n8n Cloud doesn’t allow unverified community nodes. Instead of the custom xpay node, you’ll use:
- Webhook node as a trigger
- HTTP Request node for optional signature verification
- Standard n8n nodes for your workflow logic
This approach works identically to the custom node - you just configure it manually.
Setup Guide
Step 1: Create Your Webhook in n8n Cloud
-
Open n8n Cloud and create a new workflow
-
Add a Webhook node as the trigger
-
Configure it:
- HTTP Method: POST
- Path: Choose a unique path (e.g.,
/xpay-payment) - Response Mode: Respond immediately
-
Activate the workflow to get your webhook URL
Step 2: Create a Checkout in xpay
-
Go to xpay Dashboard
-
Create a new checkout:
- Product Name: Your workflow name
- Price: Amount in USDC
- Callback URL: Your n8n webhook URL from Step 1
- Network: Base Sepolia (testnet) or Base (mainnet)
- Recipient Wallet: Your Ethereum wallet address
-
Add any custom fields to collect customer information
-
Save and copy your checkout URL
Step 3: Connect Your Workflow
After the Webhook node, add your workflow logic. The incoming data includes:
{
"body": {
"payment": {
"tx_hash": "0x...",
"payer_address": "0x...",
"amount": 5.00,
"currency": "USDC"
},
"customer_input": {
"email": "customer@example.com"
}
}
}Access payment data: {{ $json.body.payment.amount }}
Access customer input: {{ $json.body.customer_input.email }}
Complete Workflow Example
Here’s a typical Pay-to-Run workflow:
[Webhook] → [IF: Verify Payment] → [Your Logic] → [Respond]Example: AI Content Generator
- Webhook - Receives payment confirmation
- OpenAI - Generates content based on customer input
- Send Email - Delivers result to customer
- Respond to Webhook - Returns success
Import Ready-to-Use Template
Copy this JSON into n8n Cloud (Ctrl/Cmd + V in the canvas):
{
"name": "xpay Pay-to-Run Template",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "xpay-payment",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [250, 300]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={\"success\": true, \"message\": \"Payment processed\"}",
"options": {}
},
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [650, 300]
}
],
"connections": {
"Webhook": {
"main": [[{"node": "Respond to Webhook", "type": "main", "index": 0}]]
}
}
}Optional: Signature Verification
For production workflows, verify the webhook signature:
- Add a Code node after Webhook
- Use this code:
const crypto = require('crypto');
// Get headers and body
const signature = $input.first().headers['x-xpay-signature'];
const timestamp = $input.first().headers['x-xpay-timestamp'];
const body = $input.first().json.body;
// Your webhook secret from xpay dashboard
const secret = 'YOUR_WEBHOOK_SECRET';
// Verify signature
const data = `${timestamp}.${JSON.stringify(body)}`;
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(data)
.digest('hex');
if (signature !== expected) {
throw new Error('Invalid webhook signature');
}
return $input.all();- Store your webhook secret in n8n credentials for security
Test Your Integration
- In xpay dashboard, go to your checkout details
- Click Test Webhook
- Check your n8n workflow execution history
- Verify the data flows correctly
Comparison: Custom Node vs Webhook
| Feature | Custom Node (Self-hosted) | Webhook (Cloud) |
|---|---|---|
| Setup time | ~2 min | ~5 min |
| Signature verification | Automatic | Manual (optional) |
| Checkout URL display | In node | In dashboard |
| Test mode | Built-in | Dashboard button |
| Works on n8n Cloud | No | Yes |
Troubleshooting
Workflow not triggering
- Ensure workflow is active (toggle in top-right)
- Check webhook URL is correct in xpay dashboard
- Verify webhook path matches exactly
Missing data
- Check Response Mode is set correctly
- Verify you’re accessing
$json.bodynot just$json - Look at execution log for full payload
Timeout errors
n8n Cloud webhooks have a 30-second timeout. For long-running workflows:
- Return response immediately with Respond to Webhook node
- Continue processing after response
Next Steps
- Create your checkout
- Universal Webhook Guide - Deep dive on webhook format
- n8n Self-hosted Guide - Using the custom node