A production-ready human-in-the-loop approval system for n8n workflows. This service acts as a bridge between your n8n content generation workflow and your posting workflow, allowing manual approval via Discord before content gets published.
- Modern Dashboard UI: Clean, intuitive interface with real-time post statistics (Pending, Approved, Rejected, Posted)
- Post Management: View and manage all posts with filtering by status (All, Pending, Approved, Rejected, Posted)
- Quick Actions: One-click approve, reject, view, and delete actions directly from the dashboard
- Post Submission API: Receive posts from n8n with automatic Discord notifications
- Discord Integration: Rich embed notifications with clickable Approve/Reject buttons
- Two-Workflow Model: Separates content generation from posting for clean workflow design
- Configuration Page: Easy setup for Discord webhooks and n8n integration
- PostgreSQL Storage: Reliable persistence for all posts and settings
- Docker Ready: Full containerization with docker-compose
- Social Media Integration: Quick links to GitHub, Ko-fi, and GitHub Sponsors
βββββββββββββββββββ βββββββββββββββββββββββββ βββββββββββββββββββ
β n8n Workflow 1 ββββββΆβ N8N Approval Service ββββββΆβ Discord β
β (Content Gen) β β β β (Approval) β
βββββββββββββββββββ βββββββββββββββββββββββββ ββββββββββ¬βββββββββ
β β
ββββββββββββββββββββββββββββ
β (Approve/Reject)
β
βΌ
βββββββββββββββββββββββββ
β n8n Workflow 2 β
β (Post to LinkedIn) β
βββββββββββββββββββββββββ
- Docker and Docker Compose
- Discord server with webhook access
- n8n instance (self-hosted or cloud)
# Clone the repository
git clone <your-repo-url>
cd N8N-Approval-Service
# Copy environment file
cp .env.example .env
# Edit .env with your settings
nano .env# Build and start containers
docker-compose up -d
# View logs
docker-compose logs -f appOpen your browser and navigate to http://localhost:3001
- Go to the Setup page (
/setup) - Enter your Discord Webhook URL
- Click Save Settings
POST /api/v1/posts/submit
Content-Type: application/json
{
"content": "Your post content here...",
"source": "LinkedIn AI Generator",
"n8n_callback_url": "https://your-n8n.com/webhook/abc123"
}Response:
{
"success": true,
"message": "Post submitted successfully and pending approval",
"data": {
"id": 1,
"status": "PENDING",
"created_at": "2024-01-01T00:00:00.000Z"
}
}GET /api/v1/posts/{post_id}/approveReturns HTML confirmation page and triggers callback to n8n Workflow 2.
GET /api/v1/posts/{post_id}/rejectReturns HTML confirmation page. No callback is sent.
PUT /api/v1/posts/{post_id}/postedResponse:
{
"success": true,
"message": "Post marked as posted successfully",
"data": {
"id": 1,
"status": "POSTED",
"posted_at": "2024-01-01T00:00:00.000Z"
}
}GET /api/v1/posts?status=PENDING&limit=50&offset=0GET /api/v1/posts/stats/summary- Content Generation Node: Create your content (AI, manual, etc.)
- HTTP Request Node:
- Method:
POST - URL:
http://your-approval-service:3001/api/v1/posts/submit - Body:
{ "content": "{{ $json.generated_content }}", "source": "My Content Workflow", "n8n_callback_url": "https://your-n8n.com/webhook/posting-workflow" }
- Method:
- Webhook Trigger: Create a webhook (use this URL as
n8n_callback_url) - LinkedIn Node: Post the content from
{{ $json.post_content }} - HTTP Request Node (after successful post):
- Method:
PUT - URL:
http://your-approval-service:3001/api/v1/posts/{{ $json.post_id }}/posted
- Method:
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3001 |
APP_URL |
Public URL of the service | http://localhost:3001 |
DATABASE_URL |
PostgreSQL connection string | (see docker-compose) |
DB_PASSWORD |
Database password | approval_pass |
DISCORD_WEBHOOK_URL |
Discord webhook URL | (optional) |
N8N_BASE_URL |
n8n base URL (reference only) | (optional) |
The service uses PostgreSQL with the following schema:
Posts Table:
id- Primary keycontent- Post content (TEXT)source- Source/workflow name (VARCHAR)status- PENDING, APPROVED, REJECTED, POSTEDn8n_callback_url- Callback URL for Workflow 2created_at- Creation timestampapproved_at- Approval timestampposted_at- Posted timestamp
Settings Table:
key- Setting key (unique)value- Setting value
# Start services
docker-compose up -d
# Stop services
docker-compose down
# View logs
docker-compose logs -f
# Rebuild after changes
docker-compose up -d --build
# Reset database
docker-compose down -v
docker-compose up -d# Install backend dependencies
npm install
# Install frontend dependencies
cd frontend && npm install && cd ..
# Generate Prisma client
npm run prisma:generate
# Start PostgreSQL (or use docker-compose)
docker-compose up -d db
# Run database migrations
DATABASE_URL="postgresql://approval_user:approval_pass@localhost:5432/approval_db" npm run prisma:migrate:dev
# Start backend in dev mode
npm run dev
# In another terminal, start frontend
cd frontend && npm run devN8N-Approval-Service/
βββ src/
β βββ index.ts # Express server entry
β βββ db/
β β βββ prisma.ts # Prisma client
β βββ routes/
β β βββ posts.routes.ts # Posts API endpoints
β β βββ settings.routes.ts # Settings API endpoints
β βββ services/
β βββ discord.service.ts # Discord webhook integration
βββ frontend/
β βββ src/
β β βββ App.tsx # Main app component
β β βββ main.tsx # React entry point
β β βββ api/ # API client
β β βββ components/ # Shared components
β β βββ pages/ # Page components
β β βββ types/ # TypeScript types
β βββ ...
βββ prisma/
β βββ schema.prisma # Database schema
βββ Dockerfile
βββ docker-compose.yml
βββ package.json
MIT License - see LICENSE file for details.
If you find this project useful, consider supporting:
- β Star on GitHub
- β Buy Me a Coffee
- β€οΈ Support on Ko-fi
- π GitHub Sponsors
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
