Skip to main content
Skip table of contents

Notion - Upload File from Workflows to Notion Database

Overview

Quickly upload a file to a Notion Database. Unsupported Notion datatypes for upload are: - Files - People - Rollup - Relation - Formula When uploading a file to a database in Notion, you have two options from Workflows: to replace an existing database or to append to an existing database. #### Replace When the `Replace` insert method is selected, this will do one of two things: 1) create a new database or 2) overwrite an existing database. The inputs provided will determine the behaviour. For instance, if the `Database ID` is provided, the blueprint will attempt to overwrite that existing database. If the `Database ID` is not provided, the blueprint will attempt to create a new database, but in order to do so the `Page ID` of where the new database will live is required. Additionally, when creating a new database, you can optionally provide the `Database Name`, not providing the `Database Name` will result in the created database being named "Untitled." #### Append When the `Append` insert method is selected, the blueprint will attempt to add new rows to an existing database. In order to do so, the `Database ID` is required, failing to provide it will result in an error. **NOTE** - existing schemas and datatypes are strictly enforced. If there is a mismatch in datatypes for data being loaded, it will fail.

Variables

NameReferenceTypeRequiredDefaultOptionsDescription
Access TokenNOTION_ACCESS_TOKENPassword--The access token assigned to the integration created
Database IDNOTION_DATABASE_IDAlphanumeric--The ID of the notion database found in the URL. Is necessary if `Append` is selected
Page IDNOTION_PAGE_IDAlphanumeric--The parent page ID where the Database will reside. Is only necessary if `Replace` is selected and the database doesn't exist.
Database NameNOTION_DATABASE_NAMEAlphanumeric--The optional name of the database to be created. If `Replace` is selected and the database doesn't exist, this will provide a name for the one that is created
Source File NameNOTION_FILE_NAMEAlphanumeric--The name of the file to load to Notion
Source Folder NameNOTION_FOLDER_NAMEAlphanumeric--The optional name of the folder containing the file to load to Notion
Insert MethodNOTION_INSERT_METHODSelectappendAppend: append

Replace: replace
The option to overwrite an existing database, or append additional rows

YAML

Below is the YAML template

YAML

source:
  template: Notion - Upload File from Workflows to Notion Database
  inputs:
    NOTION_ACCESS_TOKEN:
    NOTION_DATABASE_ID:
    NOTION_PAGE_ID:
    NOTION_DATABASE_NAME:
    NOTION_FILE_NAME:
    NOTION_FOLDER_NAME:
    NOTION_INSERT_METHOD: append
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 200
    - 201
    - 202
    - 203
    - 204
    - 205
    - 206
    - 249

      
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.