Notion Upload

Upload a file to Notion

Overview

This node uploads a binary file to Notion using the Notion API's file upload endpoint. It is designed to take binary data from incoming items and send it as a file to Notion, returning the response from the upload process.

Common scenarios include:

  • Automating the upload of images, documents, or other files stored in n8n workflows directly into Notion pages or databases.
  • Integrating file storage workflows where files are first processed or generated in n8n and then uploaded to Notion for centralized access.
  • Enhancing content management by programmatically adding attachments to Notion without manual intervention.

Example: Uploading an image captured or generated earlier in the workflow to Notion for documentation or sharing purposes.

Properties

Name Meaning
Binary Property The name of the binary field in the input data that contains the file to be uploaded.

Output

The node outputs an array with one item per input item processed. Each output item contains:

  • json: The JSON response returned by the Notion API after uploading the file. This typically includes metadata about the uploaded file such as URLs or identifiers.
  • binary: An empty object (no binary data is output).
  • pairedItem: References the original input item index to maintain item pairing.

No binary data is output by this node; it only returns the upload response metadata.

Dependencies

  • Requires an API authentication credential for Notion to authorize requests.
  • Uses the Notion API version "2022-06-28".
  • Relies on n8n helper methods for HTTP requests with authentication and for retrieving binary data buffers.
  • Uses the form-data library to construct multipart form data for file upload.

Troubleshooting

  • Error: No binary data found in property
    This occurs if the specified binary property does not exist or contains no data in the input item. Ensure the correct binary property name is set and that the input item actually contains binary data under that property.

  • HTTP request failures
    Errors during the HTTP requests to Notion may indicate invalid credentials, network issues, or API changes. Verify the API key/credential is valid and has appropriate permissions.

  • File naming issues
    If the file name or extension is missing, the node defaults to a generic name like document_0.jpg. To avoid confusion, ensure your binary data includes proper filename and extension metadata.

  • Continue On Fail behavior
    If enabled, the node will continue processing subsequent items even if some fail, appending error details to the output. Otherwise, it will stop execution on the first error.

Links and References

Discussion