N8N Integration
N8N is a powerful workflow automation platform that enables you to connect HITL.sh with hundreds of other services and applications. This integration allows you to create sophisticated automated workflows that include human decision-making at critical points.What is N8N?
N8N is an open-source workflow automation tool that provides:N8N Features
- Visual Workflow Builder: Drag-and-drop interface for creating automation workflows
- 700+ Integrations: Connect with popular services and APIs
- Custom Nodes: Build your own integration nodes
- Self-Hosted: Deploy on your own infrastructure for full control
- Webhook Support: Trigger workflows via HTTP requests
Why Integrate HITL.sh with N8N?
Automated Workflows
Trigger HITL.sh requests automatically based on events from other systems.
Human Decision Points
Insert human oversight at critical junctures in automated processes.
Multi-Service Integration
Connect HITL.sh with your entire tech stack through a single platform.
Visual Process Design
Design complex workflows visually without writing code.
Integration Overview
Workflow Components
A typical N8N + HITL.sh workflow includes:1
Trigger Node
An event that starts the workflow (e.g., new email, form submission).
2
Processing Nodes
Transform data and prepare it for human review.
3
HITL.sh Node
Submit content for human review and wait for decision.
4
Decision Handling
Process the human decision and take appropriate action.
5
Action Nodes
Execute actions based on human decisions (e.g., send notifications, update databases).
Setting Up the Integration
1. Install N8N
1
Choose Installation Method
- Docker: Quick setup with containerization
- npm: Direct installation via Node.js
- Self-hosted: Full control over deployment
2
Install N8N
3
Access N8N
Open your browser and navigate to
http://localhost:5678
2. Configure HITL.sh Credentials
1
Get API Key
Generate an API key from your HITL.sh dashboard.
2
Add Credentials
In N8N, go to Settings ā Credentials ā Add Credential
3
Configure HITL.sh
- Name: HITL.sh API
- Type: Generic API
- Base URL: https://api.hitl.sh/v1
- API Key: Your HITL.sh API key
3. Install HITL.sh Nodes
Custom Nodes
HITL.sh provides custom N8N nodes for seamless integration:
- HITL.sh Request Node: Submit content for review
- HITL.sh Response Node: Retrieve human decisions
- HITL.sh Webhook Node: Receive real-time notifications
Building Your First Workflow
Content Moderation Workflow
Create a workflow that automatically moderates social media posts:
Workflow Steps
1
Twitter Trigger
Monitor for new tweets containing specific keywords.
2
Content Analysis
Use AI service to analyze tweet content and flag potential issues.
3
HITL.sh Request
Submit flagged content for human review if AI confidence is low.
4
Wait for Decision
Pause workflow until human decision is received.
5
Process Decision
Take action based on human decision (approve, reject, or flag).
Node Configuration
Twitter Trigger Node:Customer Support Escalation Workflow
Automatically escalate support tickets that require human intervention:1
Zendesk Trigger
Monitor for new support tickets with specific tags.
2
AI Classification
Use AI to classify ticket complexity and urgency.
3
HITL.sh Review
Route complex tickets to human agents for review.
4
Agent Assignment
Assign tickets to appropriate support agents based on human decision.
5
Notification System
Notify relevant stakeholders about escalated tickets.
Advanced Workflow Patterns
Conditional Routing
Route requests based on content characteristics:Batch Processing
Process multiple requests together for efficiency:Error Handling
Implement robust error handling for your workflows:Retry Logic
- Configure automatic retries for failed API calls
- Set exponential backoff for rate limiting
- Handle temporary network issues gracefully
Fallback Actions
- Define alternative actions when HITL.sh is unavailable
- Implement manual review processes as backup
- Log errors for monitoring and debugging
Webhook Integration
Real-Time Notifications
Receive instant updates when human decisions are made:1
Configure Webhook
Set up webhook endpoint in HITL.sh pointing to your N8N instance.
2
Webhook Trigger Node
Create a webhook trigger node in N8N to receive notifications.
3
Process Notifications
Handle webhook payloads and trigger appropriate workflow actions.
Webhook Payload Example
Best Practices
Workflow Design
Modular Design
- Break complex workflows into smaller, reusable components
- Use sub-workflows for common operations
- Maintain clear separation of concerns
Error Handling
- Implement comprehensive error handling
- Add logging and monitoring nodes
- Create fallback paths for critical operations
Performance Optimization
- Use batch processing when possible
- Implement appropriate delays and rate limiting
- Monitor workflow execution times
Documentation
- Document workflow purpose and logic
- Add comments to complex nodes
- Maintain workflow version history
Security Considerations
API Key Management
API Key Management
- Store API keys securely in N8N credentials
- Rotate keys regularly
- Use environment variables for sensitive data
Webhook Security
Webhook Security
- Verify webhook signatures
- Use HTTPS endpoints
- Implement rate limiting on webhook triggers
Data Privacy
Data Privacy
- Minimize data exposure in workflow logs
- Implement data retention policies
- Ensure compliance with privacy regulations
Monitoring and Analytics
Workflow Performance
Track the performance of your N8N workflows:Execution Metrics
- Success/failure rates
- Execution times
- Resource usage
- Error frequency
Business Metrics
- Requests processed per day
- Human review response times
- Decision accuracy rates
- Workflow efficiency improvements
Alerting and Notifications
Set up alerts for workflow issues:1
Error Monitoring
Monitor for workflow failures and errors.
2
Performance Alerts
Alert when workflows exceed expected execution times.
3
Business Alerts
Notify stakeholders about important business events.
Troubleshooting
Common Issues
API Rate Limiting
API Rate Limiting
- Implement exponential backoff
- Use batch processing to reduce API calls
- Monitor API usage and adjust accordingly
Webhook Failures
Webhook Failures
- Verify webhook endpoint accessibility
- Check webhook signature verification
- Monitor webhook delivery logs
Workflow Timeouts
Workflow Timeouts
- Adjust timeout settings for long-running operations
- Implement progress tracking for human review processes
- Use appropriate delay nodes for waiting periods
Debugging Tips
Logging
- Add logging nodes throughout your workflow
- Use console.log in Code nodes for debugging
- Monitor N8N execution logs
Testing
- Test workflows with sample data
- Use N8Nās test mode for validation
- Create separate test workflows for development
Next Steps
Ready to build your first N8N + HITL.sh workflow?Explore Other Integrations
Learn about Zapier integration for simpler automation.
Set Up Webhooks
Configure webhooks for real-time notifications.
API Reference
Detailed API documentation for custom integrations.
Community Support
Join the HITL.sh community for help and inspiration.