WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The "Send File In Session" operation for the Session resource in the WTS Chat n8n node allows you to send a file to an active chat session. This can be done either by providing a direct URL to the file or by passing a file from previous nodes (as binary data). This operation is useful for automating workflows where files (such as images, documents, or other media) need to be delivered to users within a specific chat session.

Common scenarios:

  • Sending invoices, reports, or receipts to customers during a support session.
  • Sharing multimedia content with users in real-time conversations.
  • Automating document delivery in customer service or sales processes.

Practical example:
After generating a PDF report in your workflow, use this node to send the PDF directly to the user’s ongoing chat session.


Properties

Display Name Type Description
Session ID String The unique identifier of the session to which the file will be sent.
Url String (Optional) The direct URL of the file to send. If provided, the file at this URL will be sent to the session.
Input Field File Name String (Optional) The name of the input field containing the file (from previous node's binary output). Use dot-notation for nested fields if necessary.
Send Synchronous Message Boolean Whether to send the message synchronously. If enabled, the node waits for the message to be processed before continuing the workflow.

Note: Either "Url" or "Input Field File Name" must be provided.


Output

The node outputs a single item per execution, with the following structure in the json field:

{
  // Response from the WTS Chat API after sending the file.
  // Typical fields may include:
  "id": "string",             // Unique identifier of the sent message
  "status": "string",         // Status of the message (e.g., 'sent', 'queued')
  "sessionId": "string",      // The session ID to which the file was sent
  "fileUrl": "string",        // URL of the sent file (if applicable)
  "timestamp": "string",      // Time when the message was sent
  // ...other metadata returned by the API
}

If the file is sent as binary data, the node does not output the file itself but returns metadata about the sent message and file.


Dependencies

  • External Service: Requires access to the WTS Chat API.
  • API Key: You must configure valid WTS Chat API credentials (wtsApi) in n8n.
  • n8n Configuration: Ensure that any file to be sent as binary data is available in the workflow's input under the specified field name.

Troubleshooting

Common issues:

  • Missing Session ID:
    Error: "SessionID is empty! Fill in the SessionID field."
    Resolution: Make sure the "Session ID" property is set and not empty.

  • No File or URL Provided:
    Error: "Fill in any of the fields" / "Fill in the file or url"
    Resolution: Provide either a file URL or select a binary file from previous node output.

  • Binary Data Not Found:
    Error: "There is no data in the input" or "There is no file with that name that comes from input"
    Resolution: Ensure the previous node outputs binary data with the correct field name matching "Input Field File Name".

  • API Authentication Issues:
    Error: Related to invalid or missing API key.
    Resolution: Check your WTS Chat API credentials in n8n.


Links and References


Discussion