Actions10
- Audio Actions
- Document Actions
- File Actions
- Image Actions
- Text Actions
- Video Actions
Overview
This node facilitates uploading files to the Google Gemini API. It supports two input methods for file upload: providing a direct URL to the file or supplying binary file data from previous nodes. This functionality is useful when you want to integrate file processing or analysis capabilities of Google Gemini into your n8n workflows, such as uploading documents, images, or other file types for further AI-driven processing.
Practical examples include:
- Uploading a PDF document from a public URL to analyze its content.
- Uploading an image file received from another node in binary form for AI-based image recognition or classification.
Properties
| Name | Meaning |
|---|---|
| Server URL | The base URL of the Google Gemini API endpoint (default: https://generativelanguage.googleapis.com). |
| API Key | The API key credential required to authenticate requests to the Google Gemini API. |
| Input Type | Method of providing the file to upload. Options: File URL (upload via a public URL), Binary File (upload binary data from previous node). |
| URL | The public URL of the file to upload. Required if Input Type is set to File URL. |
| Input Data Field Name | The name of the binary property containing the file data. Required if Input Type is set to Binary File. |
Output
The node outputs JSON data representing the response from the Google Gemini API after the file upload operation. This typically includes metadata about the uploaded file or confirmation of successful upload.
If binary data is involved, it is used as input only; the output does not contain binary data but rather the API's JSON response.
Dependencies
- Requires access to the Google Gemini API endpoint.
- An API key credential with appropriate permissions to upload files to Google Gemini.
- Network connectivity to the specified Server URL.
Troubleshooting
- Invalid API Key or Authentication Errors: Ensure that the provided API key is valid and has the necessary permissions.
- File Not Found or Invalid URL: When using the File URL input type, verify that the URL is publicly accessible and points directly to the file.
- Incorrect Binary Property Name: When using binary input, ensure the binary property name matches exactly the field containing the file data.
- Network Issues: Confirm that the server URL is reachable from the n8n instance.
Links and References
- Google Gemini API Documentation (for detailed API usage and authentication)
- n8n Documentation on Binary Data Handling