Overview
This node acts as a webhook trigger designed to start workflows when messages are received from the 1ClickAi WAdmin service. It listens for incoming HTTP POST requests at a specified unique webhook path and validates these requests using a bearer token authentication mechanism. The node supports three types of messages: audio, text, and image. Upon receiving a valid message, it routes the data to one of three outputs corresponding to the message type.
Common scenarios where this node is beneficial include:
- Automating responses or processing when new audio, text, or image messages arrive from the 1ClickAi WAdmin platform.
- Integrating 1ClickAi WAdmin messaging into broader workflow automations such as notifications, data storage, or further analysis.
- Filtering and handling different media types separately within a single workflow.
Practical example:
- A workflow that triggers when a new audio message arrives, transcribes it, and sends a notification.
- A workflow that processes incoming images by saving them to cloud storage.
- A workflow that logs text messages for customer support analytics.
Properties
| Name | Meaning |
|---|---|
| Path | Webhook path (final part of the URL) that must be unique per workflow. This defines the endpoint URL segment where the webhook listens for incoming messages. Default is "oneclickai-wadmin". |
Output
The node has three separate outputs, each corresponding to a supported message type:
- Audio output: Emits data when the incoming message type is
audio. The output contains the full JSON payload of the message. - Text output: Emits data when the incoming message type is
text. The output contains the full JSON payload of the message. - Image output: Emits data when the incoming message type is
image. The output contains the full JSON payload of the message.
Each output provides an array with one item containing a json field holding the entire message object received from the webhook.
No binary data output is produced by this node.
Dependencies
- Requires configuration of an API key credential for authenticating incoming webhook requests. This credential provides a bearer token that must match the
Authorizationheader in the incoming request. - The node expects the incoming webhook request to be a JSON payload with specific fields (
user,message,type, andgroup). - No external services are called by the node itself; it only validates and routes incoming webhook data.
Troubleshooting
- Missing or invalid API key credential: If the API key credential is not configured or missing, the node responds with HTTP 500 and an error message indicating the credential is not configured.
- Authentication errors:
- If the
Authorizationheader is missing or does not start with "Bearer ", the node returns HTTP 401 Unauthorized. - If the bearer token does not match the configured token, the node returns HTTP 403 Forbidden.
- If the
- Invalid request body:
- If the request body is not valid JSON or missing, the node returns HTTP 400 Bad Request.
- If required fields (
user,message,type,group) are missing, the node returns HTTP 400 with a descriptive error.
- Unsupported message type: If the
typefield is not one ofaudio,text, orimage, the node returns HTTP 400 with an unsupported message type error. - Empty payload: If the JSON payload is empty, the node responds with HTTP 200 and a test message confirming the webhook is working.
To resolve issues:
- Ensure the API key credential is properly set up and matches the token sent in the webhook request.
- Verify the webhook URL path is unique and correctly configured.
- Confirm the incoming requests have the correct headers and JSON structure.
- Check that the message type is one of the supported types.
Links and References
- n8n Webhook Trigger Documentation
- HTTP Bearer Authentication
- 1ClickAi WAdmin Platform (if publicly available) (Replace with actual link if known)