xFlow Workflows
Interactive diagram showing the complete flow from request to result. Click nodes to explore details and see code examples.
Click nodes to explore • Interactive flow diagram
How it works
Detailed breakdown of each step in the xFlow workflow execution process
Your application sends a POST request to any xFlow workflow endpoint
Key Features:
- Standard HTTP POST request
- JSON payload with input data
- No authentication required initially
Code Example:
fetch('/api/run/summarize', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: 'https://example.com' })
})xFlow Gateway checks if payment is required and verified
Key Features:
- Validates payment token if provided
- Checks workflow pricing configuration
- Determines if execution can proceed
Code Example:
if (!paymentVerified) {
return res.status(402).json({
status: 402,
code: 'PAYMENT_REQUIRED',
price: '0.25',
currency: 'USDC',
payment_url: '/api/payment/webhook?token=...'
})
}x402 Verifier validates the micropayment on-chain
Key Features:
- On-chain transaction verification
- Multi-chain support (Base, Ethereum, Polygon)
- Instant settlement confirmation
Code Example:
const isValid = await verifyPayment({
token: paymentToken,
amount: '0.25',
currency: 'USDC',
chain: 'Base'
})n8n webhook is triggered with the verified request
Key Features:
- Secure webhook call to n8n
- Input data processing
- Workflow automation execution
Code Example:
await fetch(n8nWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
workflowId: 'summarize',
input: payload,
paid: true,
tx_ref: transactionId
})
})Processed result is returned to the client
Key Features:
- Structured JSON response
- Error handling and logging
- Performance metrics included
Code Example:
{
"ok": true,
"workflowId": "summarize",
"output": {
"summary": "Article summary...",
"wordCount": 1500,
"processingTime": "2.3s"
},
"timestamp": "2024-01-15T10:30:00Z"
}Built for scale
Enterprise-grade performance and reliability for production workloads
99.9% Uptime
Enterprise-grade reliability with automatic failover and monitoring
< 5s Response
Average response time including payment processing and workflow execution
100% Secure
End-to-end encryption and on-chain payment verification