Actions20
- Assistant Actions
- Embedding Actions
- File Actions
- Report Actions
- Text Actions
- Thread Actions
File → Upload File
AI-generatedOverview
This node enables uploading files to the OpenAI platform for various purposes such as use with assistants, input to assistants, or fine-tuning models. It is particularly useful when you want to programmatically manage and upload binary files from previous workflow steps into OpenAI’s file storage system.
Typical scenarios include:
- Uploading training data files for fine-tuning machine learning models.
- Providing files that an assistant can access or reference during interactions.
- Supplying input files for assistant workflows.
For example, if you have a binary file output from a previous node (like a document or dataset), you can use this node to upload that file directly to OpenAI with a specified purpose, making it available for subsequent AI operations.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose which API credentials to use: either dedicated OpenAI Analytics API credentials or existing OpenAI API credentials. |
| Binary Property | The name of the binary property containing the file data from the previous node (e.g., "data"). This is required to specify where the file content is located. |
| File Purpose | The intended purpose of the uploaded file. Options are: - Assistants: Files for use with Assistant - Assistants Input: Files for input to Assistant - Fine-Tune: Files for fine-tuning models |
Output
The node outputs JSON data representing the result of the file upload operation. This typically includes metadata about the uploaded file such as its ID, filename, purpose, size, and other relevant details returned by the OpenAI API.
If the node supports binary data output, it would represent the uploaded file or related binary content; however, in this case, the output focuses on JSON metadata confirming the upload status.
Dependencies
- Requires valid OpenAI API credentials (either dedicated analytics API credentials or standard OpenAI API credentials).
- Needs access to the binary data from a previous node in the workflow.
- Uses the official OpenAI SDK internally to perform the file upload.
- No additional environment variables beyond the API credentials are necessary.
Troubleshooting
Common Issues:
- Missing or incorrect binary property name: Ensure the binary property name matches exactly the property containing the file data from the previous node.
- Invalid or expired API credentials: Verify that the provided API key is valid and has permissions to upload files.
- Unsupported file format or size limits: Check OpenAI’s documentation for allowed file types and maximum file sizes.
Error Messages:
"Unsupported resource: file": Occurs if the resource parameter is incorrectly set; ensure it is set to "file".- Credential loading errors: If credentials cannot be loaded, verify that the correct credential type is selected and configured in n8n.
- API errors from OpenAI: These may indicate network issues, permission problems, or invalid parameters. Review the error message and adjust accordingly.
Links and References
This summary is based on static analysis of the node's source code and property definitions for the File Upload operation only.