ToneClone icon

ToneClone

Write with AI in your voice and style - Generate writing that sounds like you, not a robot

Actions3

Overview

The "Upload File" operation under the "Training" resource allows users to upload binary files to train a specific persona in the ToneClone AI platform. This node is useful when you want to enhance or customize an AI persona's writing style by providing it with additional training data in the form of files (e.g., documents, text files, or other relevant content). The uploaded file is sent to the ToneClone API and associated with the selected persona for training purposes.

Practical examples:

  • Uploading a PDF or DOCX file containing your writing samples to help the AI better mimic your style.
  • Providing audio transcripts or other textual data as training material for a custom persona.
  • Automating the process of updating a persona’s training data by uploading new files regularly via n8n workflows.

Properties

Name Meaning
Persona Name or ID Select the persona to train with this content. Built-in personas cannot be trained. Choose from the list or specify an ID using an expression.
Input Binary Field The name of the input binary field that contains the file to upload. Default is data.

Output

The output JSON object includes details about the uploaded file and its association with the specified persona. Key fields include:

  • fileId (or equivalent): The unique identifier of the uploaded file returned by the ToneClone API.
  • personaId: The ID of the persona to which the file was uploaded.
  • operation: The string "uploadFile" indicating the performed operation.
  • associated: A boolean flag (true) indicating the file has been successfully associated with the persona.
  • Other metadata returned by the API about the uploaded file (excluding internal keys like PK, SK, userId, s3Key).

If the node encounters an error during upload or association, it throws an error unless "Continue On Fail" is enabled, in which case the error message is included in the output JSON.

Binary Data:
The node expects binary data as input but does not output binary data itself. It uploads the binary content to the external service and outputs JSON metadata about the upload.

Dependencies

  • Requires an active connection to the ToneClone API via an API key credential.
  • The API URL can be customized but defaults to https://api.toneclone.ai.
  • The node uses HTTP requests authenticated with the provided API key to upload files and associate them with personas.
  • The input binary data must be available on the specified binary property in the incoming workflow item.

Troubleshooting

  • No binary data found in property "X": This error occurs if the specified binary property does not exist or contains no data. Ensure the binary field name matches exactly and that the previous node provides binary data.
  • ToneClone API did not return a fileId for uploaded binary data: Indicates the upload request succeeded but the response did not contain the expected file identifier. Check API credentials, network connectivity, and ensure the file format is supported.
  • Unsupported operation: If the node is configured with an unsupported resource-operation combination, it will throw this error. Verify the resource is set to "training" and operation to "uploadFile".
  • API authentication errors: If the API key is missing, invalid, or expired, the node will fail to authenticate. Confirm the API key credential is correctly configured.
  • Network or timeout issues: Network failures or slow responses from the ToneClone API may cause errors. Retry or check network connectivity.

Links and References

Discussion