AutomationFlowsAI & RAG › Production AI Playbook: Human Oversight (exercise 2)

Production AI Playbook: Human Oversight (exercise 2)

ByElvis Sarvia @elvissaravia on n8n.io

Gate high-risk AI actions behind human approval. This template shows how to prevent an AI agent from executing sensitive operations (like sending contracts) without a human signing off first.

Chat trigger trigger★★☆☆☆ complexityAI-powered6 nodesChat TriggerAgentOpenRouter ChatChat Hitl ToolTool Code
AI & RAG Trigger: Chat trigger Nodes: 6 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13848 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger 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 →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "43844688-ff29-481f-a544-f8dc3d3fd602",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {
          "responseMode": "responseNodes",
          "allowFileUploads": false
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "4b5965d9-3fdf-4ca6-81e6-21225f457798",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        288,
        0
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a sales pipeline assistant. You help manage deals by looking up CRM records, updating deal stages, and sending contracts to prospects. When the user provides deal details (deal ID, email, prospect name), use the Send Contract tool to send the contract. Use the Update CRM tool to update deal stages. Always use the available tools to take action."
        }
      },
      "typeVersion": 3.1
    },
    {
      "id": "b944a6ca-38ba-4bbf-9903-03c2ff9e799b",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        224,
        224
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1def7515-5f42-451d-a207-f4c7a18a92f6",
      "name": "Review: Send Contract",
      "type": "@n8n/n8n-nodes-langchain.chatHitlTool",
      "position": [
        480,
        224
      ],
      "parameters": {
        "options": {},
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0248f52c-1bbf-4de0-b2c8-55ddc1d67df5",
      "name": "Send Contract",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        480,
        432
      ],
      "parameters": {
        "jsCode": "// Simulate sending a contract to a prospect\nconst data = JSON.parse(query);\nreturn `Contract sent to ${data.prospectEmail} for deal ${data.dealId}`;",
        "description": "Sends a contract to a prospect. Input should be a JSON string with dealId and prospectEmail fields."
      },
      "typeVersion": 1.3
    },
    {
      "id": "542612dc-099f-4a2c-b627-fd9bbb12a444",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -224
      ],
      "parameters": {
        "width": 512,
        "height": 816,
        "content": "## Sales Pipeline Agent with Tool Call Approval Gates\n\n### How it works\n1. **Chat Trigger** receives a request to send a contract (e.g., \"Send the Enterprise contract to john@acmecorp.com for deal 4521\").\n2. **AI Agent** processes the request and decides to call the Send Contract tool.\n3. **Human Review gate** intercepts the tool call before execution. The chat displays the intended action with Approve/Decline buttons.\n4. If approved, the **Send Contract** tool executes. If declined, the agent is notified and responds accordingly.\n\n### Setup\n- Connect your **LLM credentials** (e.g., OpenRouter, OpenAI) to the Chat Model node\n- Review the **Send Contract** code node to customize the contract-sending logic for your system\n- The Human Review step is configured via the \"+\" connector between the AI Agent and the Send Contract tool\n\n### Customization\n- Add more tools to the agent -- only gate high-risk tools (contract sends, payments) while leaving low-risk tools (data lookups) autonomous\n- Swap the Chat-based review for Slack or Email by changing the HITL integration\n\nThis template is a learning companion to the Production AI Playbook, a  series that explores strategies, shares best practices, and provides practical examples for building reliable AI systems in n8n.  \n\n[Link to blog](https://go.n8n.io/PAP-HO-Blog)\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Send Contract": {
      "ai_tool": [
        [
          {
            "node": "Review: Send Contract",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Review: Send Contract": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Gate high-risk AI actions behind human approval. This template shows how to prevent an AI agent from executing sensitive operations (like sending contracts) without a human signing off first.

Source: https://n8n.io/workflows/13848/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Power BI Data Analyst Agent. Uses stickyNote, chatTrigger, agent, lmChatOpenRouter. Chat trigger; 12 nodes.

Chat Trigger, Agent, OpenRouter Chat +4
AI & RAG

Supabase Data Analyst Agent. Uses stickyNote, chatTrigger, agent, lmChatOpenRouter. Chat trigger; 17 nodes.

Chat Trigger, Agent, OpenRouter Chat +5
AI & RAG

This template uses Firecrawl’s API to perform AI-powered web scraping and screenshots — no code required. Just type natural language prompts, and an AI Agent will convert them into precise Firecrawl q

HTTP Request, Chat Trigger, OpenRouter Chat +2
AI & RAG

API Calls in n8n. Uses chatTrigger, agent, lmChatOpenRouter, openWeatherMap. Chat trigger; 12 nodes.

Chat Trigger, Agent, OpenRouter Chat +3
AI & RAG

This workflow is designed to intelligently route user queries to the most suitable large language model (LLM) based on the type of request received in a chat environment. It uses structured classifica

Chat Trigger, Agent, Model Selector +7