Actions7
Overview
This node acts as a trigger for session-related events from a WSAPI webhook source. It listens specifically for user session events such as login, logout, and login errors. When one of the selected session events occurs, the node activates and outputs relevant event data.
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 security checks when login errors occur.
For example, you could use this node to start a workflow that sends an alert email whenever a user fails to log in, or to update a dashboard when users log in or out.
Properties
| Name | Meaning |
|---|---|
| Session Events | Select which session events to listen for: "Logged In", "Logged Out", "Login Error". |
| Parse Event Data | Whether to parse the event data for easier access to specific 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 session event received. The structure includes:
instanceId: Identifier of the instance sending the event.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
rawEventif requested.
No binary data output is produced by this operation.
Example output JSON (simplified):
{
"instanceId": "abc123",
"receivedAt": "2024-06-01T12:00:00Z",
"eventType": "logged_in",
"userId": "user_456",
"sessionId": "sess789",
"rawEvent": { /* full webhook payload, if included */ }
}
Dependencies
- Requires a WSAPI webhook endpoint configured to send session events.
- Optional: An API key credential for authenticating media downloads (not applicable here since session events do not download media).
- If webhook authentication is enabled, requires configuration of a custom HTTP header name and expected value.
Troubleshooting
- Webhook Authentication Failure: If enabled, the node expects a specific header with a matching value. Missing or incorrect headers cause the webhook to be ignored without response. Ensure the sender includes the correct header and value.
- Event Filtering: The node only processes events matching the selected session event types. Other events are ignored silently. Verify that the webhook sends the expected event types.
- Missing Event Data: If the webhook payload lacks
eventTypeoreventData, the node will ignore the event. Confirm the webhook payload structure matches expectations. - Parsing Disabled: If parsing is disabled, event data remains nested under
eventData. This may require additional handling downstream.
Links and References
- n8n Webhook Trigger Documentation
- WSAPI documentation (refer to your WSAPI provider for webhook event details)