WSAPI Trigger icon

WSAPI Trigger

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

Overview

This node acts as a webhook trigger for session-related events from a WSAPI (WebSocket API) service. It listens specifically for session lifecycle events such as user logins, logouts, and login errors. When one of the selected session events occurs, the node receives the event data via a webhook and triggers the workflow.

Common scenarios where this node is useful include:

  • Automating workflows based on user authentication status changes.
  • Logging or auditing user login/logout activities.
  • Triggering notifications or alerts when login errors occur.

For example, you could use this node to start a workflow that sends a welcome email when a user logs in or to notify an admin if there is a login error.

Properties

Name Meaning
Session Events Select which session events to listen for. Options: "Logged In", "Logged Out", "Login Error".
Parse Event Data Whether to parse the eventData field 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 The name of the HTTP header used for webhook authentication (required if auth enabled).
Auth Header Value The expected value of the authentication header (required if auth enabled).

Output

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

  • instanceId: Identifier of the WSAPI instance.
  • receivedAt: Timestamp when the event was received.
  • eventType: The type of session event (e.g., logged_in).
  • Parsed event data fields merged into the output if parsing is enabled.
  • Optionally, the raw webhook payload under rawEvent if requested.

No binary data output is produced for session events.

Example output JSON snippet:

{
  "instanceId": "abc123",
  "receivedAt": "2024-06-01T12:00:00Z",
  "eventType": "logged_in",
  "userId": "user_456",
  "sessionId": "sess789",
  "rawEvent": { ... } // included only if enabled
}

Dependencies

  • Requires a WSAPI webhook endpoint configured to send session events.
  • Optional: An API key credential for downloading media files (not applicable for session events).
  • If webhook authentication is enabled, the node expects a custom HTTP header with a specific value for security.

Troubleshooting

  • Webhook not triggering: Ensure the WSAPI service is correctly configured to send session events to the node's webhook URL.
  • Authentication failures: If webhook authentication is enabled, verify that the incoming requests include the correct header name and value.
  • Missing event data: The node ignores events that do not match the selected session event types.
  • No response from webhook: The node returns no response if the event payload lacks required fields (eventType or eventData) or if authentication fails.

Links and References

Discussion