Overview
The n8n_test_workflow tool triggers workflow execution through externally-accessible trigger types. It automatically detects the trigger type from your workflow or accepts an explicit trigger type parameter.
Important : Only workflows with webhook, form, or chat triggers can be executed externally. Other trigger types (schedule, manual, etc.) are not supported by n8n’s public API.
Supported Trigger Types
Webhook Trigger
Triggers via HTTP webhook endpoint. Supports GET, POST, PUT, and DELETE methods.
Use Cases:
REST API endpoints
Incoming webhooks from external services
Custom HTTP integrations
Submits form data via multipart/form-data POST request.
Use Cases:
Web form submissions
File uploads
Multi-field data collection
Supported Field Types:
Text, textarea, email, number, password
Date, dropdown, checkbox
File uploads (base64 encoded, max 10MB)
Hidden fields and HTML elements
Chat Trigger
Sends chat messages with session continuity support.
Use Cases:
AI chatbots
Conversational interfaces
Multi-turn dialogues
Parameters
Required
The ID of the workflow to execute. Must contain a webhook, form, or chat trigger node.
Trigger Selection
triggerType
enum
default: "auto-detect"
Explicit trigger type. Auto-detected from workflow if omitted.
webhook - HTTP webhook trigger
form - Form submission trigger
chat - Chat message trigger
Webhook Options
HTTP method for webhook triggers.
GET - Query parameters
POST - Request body (default)
PUT - Update operations
DELETE - Delete operations
Override the webhook path. By default, uses the path configured in the workflow’s webhook node.
Payload data for the request:
Webhook : Request body (POST/PUT/DELETE) or query params (GET)
Form : Form field values (use field-0, field-1, etc. as keys)
Chat : Additional context data
{
"data" : {
"userId" : "123" ,
"action" : "process" ,
"items" : [ "item1" , "item2" ]
}
}
Custom HTTP headers to include in the request. {
"headers" : {
"X-Custom-Header" : "value" ,
"Authorization" : "Bearer token123"
}
}
Chat Options
The message to send to the chat trigger. Required when triggerType is chat.
Session identifier for conversation continuity. If omitted, a new session ID is auto-generated. session_1234567890_abc123def
Execution Options
Request timeout in milliseconds. Default is 2 minutes (120000ms).
Whether to wait for the workflow to complete execution:
true (default): Wait for complete execution and return results
false: Fire-and-forget mode, returns immediately
Response Fields
Indicates if the workflow was triggered successfully.
Execution result data returned by the workflow (when waitForResponse is true).
Unique identifier for the execution. Use with n8n_executions to retrieve execution details.
The ID of the workflow that was executed.
Human-readable status message describing the execution result.
Additional execution metadata: The trigger type that was used (webhook, form, or chat).
Trigger-specific metadata:
Webhook : webhookPath, httpMethod, duration
Form : fieldsSubmitted, warnings, duration
Chat : sessionId, webhookPath, duration
Examples
Webhook Trigger - Auto-detect
Webhook Trigger - Explicit
Form Trigger
Chat Trigger
Fire-and-Forget Mode
{
"workflowId" : "abc123" ,
"data" : {
"name" : "John Doe" ,
"email" : "[email protected] " ,
"action" : "subscribe"
},
"headers" : {
"X-Source" : "mobile-app"
}
}
Response Examples
Success - Webhook
Success - Chat
Error - No Trigger
Error - Wrong Trigger Type
Error - Inactive Workflow
{
"success" : true ,
"data" : {
"result" : "processed" ,
"recordsCreated" : 3
},
"executionId" : "exec_789xyz" ,
"workflowId" : "abc123" ,
"message" : "Workflow triggered successfully via webhook" ,
"details" : {
"triggerType" : "webhook" ,
"metadata" : {
"duration" : 1543 ,
"webhookPath" : "custom-endpoint" ,
"httpMethod" : "POST"
}
}
}
Security Features
SSRF Protection
All webhook URLs are validated before execution to prevent Server-Side Request Forgery attacks:
Blocks private IP ranges (10.x.x.x, 192.168.x.x, 127.x.x.x)
Blocks localhost and link-local addresses
Validates URL format and scheme
Workflow Activation
Webhook, form, and chat triggers require the workflow to be active in n8n. Inactive workflows cannot be triggered externally.
Best Practices
Let the system auto-detect trigger types when possible
Only specify triggerType explicitly when working with multi-trigger workflows
Check the workflow structure first if unsure about trigger configuration
Always provide sessionId for multi-turn conversations
Session IDs should be unique per user/conversation
Include relevant context in the data parameter for better responses
Check success field before processing response data
Use executionId to retrieve detailed execution logs via n8n_executions
Handle timeout errors gracefully - long-running workflows may exceed default timeout
For async workflows, use waitForResponse: false and poll execution status