chat-confirmation

n8n community node for requesting user confirmation in AI agent workflows via webhook

Package Information

Released: 8 mo ago
Downloads: 12 weekly / 27 monthly
Latest Version: 0.1.5
Author: dbenito2000

Documentation

n8n-nodes-chat-confirmation

This is an n8n community node that requests user confirmation before executing HTTP requests. Perfect for AI agent workflows where you need explicit user approval before performing write operations.

n8n is a fair-code licensed workflow automation platform.

Installation | Operations | Usage | Custom Chat UI Integration | Compatibility | Resources

Installation

Follow the installation guide in the n8n community nodes documentation.

Operations

  • Request Confirmation: Request user confirmation via webhook, then execute an HTTP request if confirmed. The node waits for user authorization before proceeding.

Usage

How It Works

  1. AI Agent calls the tool with variables (filled using $fromAI())
  2. Node creates a webhook URL and waits for confirmation
  3. Your custom UI displays the confirmation request to the user
  4. User approves/rejects → Your UI calls the webhook
  5. If approved: Node executes the HTTP request automatically
  6. Returns result to the AI Agent

Configuration

Option 1: Import from cURL (Recommended)

  1. Enable "Import from cURL"
  2. Paste your cURL command in the "cURL Command" field
  3. The node will automatically extract:
    • HTTP method (or defaults to POST if data is present)
    • URL
    • Headers (from -H or --header flags)
    • Request body (from -d, --data, --data-raw, or --data-binary flags)

Example cURL:

curl -X POST https://api.example.com/send-email \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer token123" \
  -d '{"to": "user@example.com", "subject": "Hello"}'

Option 2: Manual Configuration

  1. Confirmation Message: Message to show the user (e.g., "Do you want to send this email?")
  2. Variables: Variables the AI fills using $fromAI()
  3. HTTP Method: GET, POST, PUT, PATCH, or DELETE
  4. Action URL: The URL to call when confirmed
  5. Request Body: Body for POST/PUT/PATCH (use {{ $json.variables }} to pass variables)
  6. Headers: Optional HTTP headers
  7. Timeout: How long to wait for confirmation (default: 300 seconds)

Variables Setup

Add variables that the AI will fill:

Name Value Description
recipient $fromAI() Email recipient
subject $fromAI() Email subject
body $fromAI() Email body

Example Configurations

Using cURL Import:

Import from cURL: ✓ Enabled
cURL Command: 
curl -X POST https://api.example.com/send-email \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {{ $json.variables.apiKey }}" \
  -d '{"to": "{{ $json.variables.recipient }}", "subject": "{{ $json.variables.subject }}"}'

Manual Configuration:

Confirmation Message: "Do you want to send an email?"
HTTP Method: POST
Action URL: https://api.example.com/send-email
Request Body: {{ JSON.stringify($json.variables) }}
Variables:
  - Name: "recipient", Value: $fromAI()
  - Name: "subject", Value: $fromAI()
  - Name: "body", Value: $fromAI()

Webhook Response

Simple Usage: Just POST to the webhook URL with a JSON body containing confirmed:

POST to webhookUrl with:

{
  "confirmed": true
}

Or to reject:

{
  "confirmed": false
}

Optional Fields:

  • confirmed (boolean): true to approve and execute, false to reject. Defaults to true if not provided.
  • responseData (object, optional): Additional data to pass back to the workflow

Flexible Formats:
The webhook accepts various formats:

  • {"confirmed": true} - Standard format
  • {"confirmed": false} - Reject
  • {"action": "reject"} - Alternative reject format
  • {} - Empty body defaults to confirmed
  • Any POST request - Defaults to confirmed

The node automatically identifies the correct confirmation request from the webhook URL path, so you don't need to include any special keys or headers.

Output

The node outputs:

  • confirmed: Boolean indicating if the action was confirmed
  • message: The confirmation message
  • variables: Object containing all the variables with their resolved values
  • variablesMetadata: Metadata about each variable
  • webhookUrl: The webhook URL to call for confirmation (just POST to this URL)
  • webhookKey: Internal key (optional - the webhook identifies requests automatically)
  • actionExecuted: Boolean indicating if the HTTP request was executed
  • actionResult: The full HTTP response from the executed request (if executed successfully)
  • actionError: Error message (if execution failed)
  • actionUrl: The URL that was called
  • actionMethod: The HTTP method that was used
  • timestamp: ISO timestamp

Note: If the HTTP response is a JSON object, its properties are also merged directly into the output for easier access. The full response is always available in actionResult.

Example Workflow

As a Tool in AI Agent:

  1. AI Agent Node → Uses Chat Confirmation as a tool
  2. Chat Confirmation Node →
    • Outputs webhookUrl and webhookKey
    • Waits for confirmation
    • Executes HTTP request if confirmed
    • Returns result to AI Agent

Your Custom UI Flow:

  1. Receive confirmation request with webhookUrl and webhookKey
  2. Display confirmation dialog to user
  3. User clicks Approve/Reject
  4. Call webhook: POST webhookUrl with { "confirmed": true/false, "webhookKey": "..." }
  5. Node executes HTTP request (if approved) and returns result

Use Cases

  • Send Emails: Confirm before sending emails via API
  • Create Records: Confirm before creating database records
  • Update Data: Confirm before updating user data
  • API Calls: Confirm before executing any write operation
  • Financial Transactions: Get approval before processing payments

Custom Chat UI Integration

For detailed implementation instructions, see the Complete Implementation Guide.

Quick Integration

// When you receive a confirmation request from n8n:
const confirmation = {
  webhookUrl: "...",
  webhookKey: "exec_12345_1234567890", // REQUIRED!
  message: "Do you want to send this email?",
  variables: { recipient: "...", subject: "..." }
};

// User approves:
await fetch(confirmation.webhookUrl, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    confirmed: true,
    webhookKey: confirmation.webhookKey // REQUIRED!
  })
});

Compatibility

Compatible with n8n@1.60.0 or later

Publishing

To publish this package to npm, use:

npm run release

This will handle versioning, building, and publishing automatically. Do not use npm publish directly as it will be blocked by the prepublishOnly hook.

Resources

Discussion