This workflow follows the Agent → Emailsend recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "AI Agent with Human Approval (Gatewerk)",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "ai-agent-with-approval",
"responseMode": "responseNode",
"options": {}
},
"id": "trigger",
"name": "Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
240,
300
]
},
{
"parameters": {
"model": "gpt-4o-mini",
"options": {
"systemMessage": "You are a customer-service drafting agent. Given an incoming request, draft a polite reply. Output JSON: {\"subject\":\"...\",\"body\":\"...\"}"
}
},
"id": "agent",
"name": "AI Agent (Draft Reply)",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.6,
"position": [
460,
300
]
},
{
"parameters": {
"template": "email-review",
"payload": "={{ $json.output }}",
"priority": "normal",
"actions": [
"approve",
"reject",
"edit"
],
"timeoutAction": "expire",
"timeoutSeconds": 86400,
"additionalOptions": {
"waitTimeoutMinutes": 1440
},
"resource": "review",
"operation": "sendAndWait"
},
"id": "gatewerk-review",
"name": "Gatewerk: Request Review",
"type": "n8n-nodes-gatewerk.gatewerk",
"typeVersion": 1,
"position": [
680,
300
],
"credentials": {
"gatewerkApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"typeValidation": "strict"
},
"conditions": [
{
"leftValue": "={{ $json.outcome }}",
"rightValue": "approved",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
"id": "branch",
"name": "Approved?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
900,
300
]
},
{
"parameters": {
"fromEmail": "agent@example.com",
"toEmail": "={{ $('Webhook Trigger').item.json.body.recipient }}",
"subject": "={{ $('Gatewerk: Request Review').item.json.editedPayload?.subject ?? $('AI Agent (Draft Reply)').item.json.output.subject }}",
"text": "={{ $('Gatewerk: Request Review').item.json.editedPayload?.body ?? $('AI Agent (Draft Reply)').item.json.output.body }}",
"options": {}
},
"id": "send-email",
"name": "Send Email (Approved)",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2.1,
"position": [
1120,
220
]
},
{
"parameters": {
"respondWith": "text",
"responseBody": "Reply rejected by reviewer; no email sent.\nFeedback: {{ $json.feedback || 'no feedback provided' }}"
},
"id": "respond-rejected",
"name": "Respond (Rejected)",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1120,
380
]
}
],
"connections": {
"Webhook Trigger": {
"main": [
[
{
"node": "AI Agent (Draft Reply)",
"type": "main",
"index": 0
}
]
]
},
"AI Agent (Draft Reply)": {
"main": [
[
{
"node": "Gatewerk: Request Review",
"type": "main",
"index": 0
}
]
]
},
"Gatewerk: Request Review": {
"main": [
[
{
"node": "Approved?",
"type": "main",
"index": 0
}
]
]
},
"Approved?": {
"main": [
[
{
"node": "Send Email (Approved)",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond (Rejected)",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"meta": {
"description": "AI agent drafts a customer reply, a human reviews it via Gatewerk's webhook-wait, and the workflow either sends the (possibly edited) email or returns the rejection feedback. Replace the gatewerkApi credential id with your Gatewerk API credential and create an `email-review` template in your Gatewerk project before running.",
"templateCredsSetupCompleted": false
},
"tags": [
{
"name": "ai-agents"
},
{
"name": "human-in-the-loop"
},
{
"name": "gatewerk"
}
]
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gatewerkApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
AI Agent with Human Approval (Gatewerk). Uses agent, n8n-nodes-gatewerk, emailSend. Webhook trigger; 6 nodes.
Source: https://github.com/gatewerk/gatewerk/blob/master/packages/n8n-nodes-gatewerk/templates/ai-agent-with-approval.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Remi 1.1. Uses lmChatOpenAi, memoryPostgresChat, openAi, postgres. Webhook trigger; 89 nodes.
This n8n workflow orchestrates a powerful suite of AI Agents and automations to manage and optimize various aspects of an e-commerce operation, particularly for platforms like Shopify. It leverages La
This workflow automates the entire process of receiving a product/service order, checking or creating a customer in QuickBooks Online (QBO), generating an invoice, emailing it — all triggered by a for
This workflow transforms natural language queries into research reports through a five-stage AI pipeline. When triggered via webhook (typically from Google Sheets using the companion [](https://gist.g
This workflow automates the entire process of receiving a product/service order, checking or creating a customer in Xero, generating an invoice, emailing it — all triggered by a form submission (via J