WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The WTS Chat - Session: Complete Session operation allows users to conclude (close) a chat session in the WTS Chat platform via n8n. This is useful for automating customer support workflows, marking conversations as finished, and optionally configuring whether sessions should be reactivated if the contact sends a new message after closure.

Common scenarios:

  • Automatically closing support or sales chat sessions when certain criteria are met.
  • Ensuring that closed sessions can be reopened if the customer replies, based on business rules.
  • Integrating session lifecycle management into broader automation flows.

Example use case:
After a customer issue is resolved, an n8n workflow can automatically trigger this node to mark the session as concluded, ensuring accurate reporting and freeing up agents for new chats.


Properties

Display Name Type Description
Session ID String The unique identifier of the session to be concluded.
Reactivate On New Message Boolean Whether the conversation should be reactivated if a new message is received from the contact. Default is false.

Output

The output will be a JSON object containing the result of the session conclusion request. The structure typically includes:

{
  "success": true,
  "sessionId": "string",
  // ...other fields depending on API response
}
  • success: Indicates if the operation was successful.
  • sessionId: The ID of the session that was concluded.
  • Additional fields may be present depending on the WTS Chat API's response.

Dependencies

  • External Service: Requires access to the WTS Chat API.
  • API Key: You must configure valid WTS Chat API credentials (wtsApi) in your n8n instance.
  • n8n Configuration: No special environment variables required beyond standard credential setup.

Troubleshooting

Common Issues:

  • Missing Session ID: If the "Session ID" field is empty, the node will throw an error:
    "SessionID is empty! Fill in the SessionID field"

    • Resolution: Ensure you provide a valid session ID.
  • API Authentication Errors: Invalid or missing API key will cause authentication failures.

    • Resolution: Check your WTS Chat API credentials in n8n.
  • Unexpected API Errors: Any issues returned by the WTS Chat API (e.g., network errors, invalid session state) will be surfaced as node errors.

    • Resolution: Review the error message for details; check session status and API availability.

Links and References


Discussion