Overview
This node integrates with Twake Drive, a cloud file storage service, to perform various file management operations. Specifically for the Copy File operation, it copies a selected file within the Twake instance, optionally placing the copy in a specified destination directory and renaming it.
Common scenarios where this node is useful include:
- Creating backups or duplicates of important files within Twake.
- Organizing files by copying them into different folders without moving the original.
- Automating workflows that require file versioning or templating by duplicating existing files.
Example: Copy a report file to a "Monthly Reports" folder and rename it to indicate the current month.
Properties
| Name | Meaning |
|---|---|
| File ID | ID of the targeted file to be copied. |
| Choose Destination Folder | Boolean option to specify whether to copy the file into a custom directory (folder). |
| Directory ID | ID of the destination directory where the copied file will be placed (required if above is true). |
| Name of the New File | Boolean option to specify whether to rename the copied file. |
| New Name | New name for the copied file. If not set, the file keeps its original name with a suffix. |
Output
The node outputs an array of items corresponding to each input item processed. Each item's json property contains the result of the copy operation, typically including metadata about the newly created file such as its ID, name, path, and other relevant attributes returned by the Twake API.
If an error occurs during processing, the output JSON includes:
errorMessage: The error message describing what went wrong.errorResponse: The detailed error response from the API, if available.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for authenticating with the Twake Drive API.
- The node depends on internal helper functions (
FilesHelpers) to interact with the Twake API endpoints. - Proper configuration of the API credentials in n8n is necessary for successful operation.
Troubleshooting
Common issues:
- Invalid or missing File ID: Ensure the File ID corresponds to an existing file in Twake.
- Incorrect Directory ID when specifying a destination folder: Verify the target directory exists and the ID is correct.
- Insufficient permissions: The API key used must have rights to read the source file and write to the destination folder.
Error messages:
"File not found": The provided File ID does not exist or is inaccessible."Unauthorized"or"Authentication failed": Check the API key credential validity."Invalid directory": The destination Directory ID is invalid or not accessible.
To resolve errors, verify all IDs, ensure proper API credentials, and confirm user permissions in Twake.
Links and References
- Twake Drive API Documentation (for detailed API capabilities)
- n8n Documentation (for general node usage and credential setup)