n8n-nodes-chat-confirmation
v0.1.5
Published
n8n community node for requesting user confirmation in AI agent workflows via webhook
Maintainers
Keywords
Readme
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
- AI Agent calls the tool with variables (filled using
$fromAI()) - Node creates a webhook URL and waits for confirmation
- Your custom UI displays the confirmation request to the user
- User approves/rejects → Your UI calls the webhook
- If approved: Node executes the HTTP request automatically
- Returns result to the AI Agent
Configuration
Option 1: Import from cURL (Recommended)
- Enable "Import from cURL"
- Paste your cURL command in the "cURL Command" field
- The node will automatically extract:
- HTTP method (or defaults to POST if data is present)
- URL
- Headers (from
-Hor--headerflags) - Request body (from
-d,--data,--data-raw, or--data-binaryflags)
Example cURL:
curl -X POST https://api.example.com/send-email \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token123" \
-d '{"to": "[email protected]", "subject": "Hello"}'Option 2: Manual Configuration
- Confirmation Message: Message to show the user (e.g., "Do you want to send this email?")
- Variables: Variables the AI fills using
$fromAI() - HTTP Method: GET, POST, PUT, PATCH, or DELETE
- Action URL: The URL to call when confirmed
- Request Body: Body for POST/PUT/PATCH (use
{{ $json.variables }}to pass variables) - Headers: Optional HTTP headers
- 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):trueto approve and execute,falseto reject. Defaults totrueif 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 confirmedmessage: The confirmation messagevariables: Object containing all the variables with their resolved valuesvariablesMetadata: Metadata about each variablewebhookUrl: 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 executedactionResult: The full HTTP response from the executed request (if executed successfully)actionError: Error message (if execution failed)actionUrl: The URL that was calledactionMethod: The HTTP method that was usedtimestamp: 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:
- AI Agent Node → Uses Chat Confirmation as a tool
- Chat Confirmation Node →
- Outputs
webhookUrlandwebhookKey - Waits for confirmation
- Executes HTTP request if confirmed
- Returns result to AI Agent
- Outputs
Your Custom UI Flow:
- Receive confirmation request with
webhookUrlandwebhookKey - Display confirmation dialog to user
- User clicks Approve/Reject
- Call webhook:
POST webhookUrlwith{ "confirmed": true/false, "webhookKey": "..." } - 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 [email protected] or later
Publishing
To publish this package to npm, use:
npm run releaseThis will handle versioning, building, and publishing automatically. Do not use npm publish directly as it will be blocked by the prepublishOnly hook.
Resources
- Complete Implementation Guide - Full guide for custom chat UI integration
- n8n community nodes documentation
- n8n AI Agent documentation
- n8n expressions documentation
