WSAPI Trigger icon

WSAPI Trigger

Trigger on WSAPI webhook events (messages, chats, calls, users, etc.)

Overview

This node triggers workflows based on specific call-related events received via a WebSocket API webhook. It listens for incoming call offers, call acceptances, and call terminations, allowing automation to respond to these telephony events in real time.

Common scenarios include:

  • Automatically logging or processing incoming call offers.
  • Triggering follow-up actions when a call is accepted (e.g., starting a recording or notifying a team).
  • Handling call termination events to update call logs or release resources.

For example, you could use this node to start a workflow that sends a notification to a support agent when a new call offer arrives or to update a CRM system when a call ends.

Properties

Name Meaning
Call Events Select which call events to listen for. Options: Call Offer, Call Accept, Call Terminate.
Parse Event Data Whether to parse the event data for easier access to its fields (true/false).
Include Raw Event Whether to include the original webhook payload in the output (true/false).
Webhook Authentication Enable custom header authentication for incoming webhooks (true/false).
Auth Header Name Custom header name used for webhook authentication (string).
Auth Header Value Expected value of the authentication header to validate incoming requests (string).

Output

The node outputs JSON data representing the received event with the following structure:

  • instanceId: Identifier of the instance sending the event.
  • receivedAt: Timestamp when the event was received.
  • eventType: The type of call event (e.g., "call_offer", "call_accept", "call_terminate").
  • Parsed event data fields merged directly into the output if parsing is enabled.
  • If parsing is disabled, raw eventData is included as a nested object.
  • Optionally, the original raw webhook payload under rawEvent if enabled.
  • If the event is a media message and auto-download is enabled, binary data of the media file is included with metadata such as filename, MIME type, and download timestamps.

Binary output (if any) contains downloaded media files related to the event, prepared for further processing or storage.

Dependencies

  • Requires an API key credential for the WebSocket API to download media files automatically.
  • The node expects the environment to provide this credential with base URL, API key, and instance ID.
  • Optional webhook authentication requires configuring a custom HTTP header name and expected value.

Troubleshooting

  • Webhook Authentication Failure: If enabled, ensure the incoming webhook request includes the correct header with the expected value; otherwise, the node will ignore the request without response.
  • Missing Event Data: The node ignores webhook calls missing eventType or eventData.
  • Unsupported Event Type: Only selected call events trigger the workflow; others are ignored.
  • Media Download Failures: When auto-downloading media, network issues or invalid credentials can cause failures. The error is recorded in the output but does not stop the workflow.
  • Incorrect Credential Configuration: Ensure the API key credential is correctly set up with valid base URL, API key, and instance ID to enable media downloads.

Links and References

Discussion