Skip to main content

Notion - Upload File from Shipyard 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 Shipyard: 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_METHODSelectβž–appendAppend: append

Replace: replace

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

YAML​

Below is the YAML template for this Blueprint and can be used in the Fleet YAML Editor.

source:
blueprint: Notion - Upload File from Shipyard to Notion Database
inputs:
NOTION_ACCESS_TOKEN: null ## REQUIRED
NOTION_DATABASE_ID: null
NOTION_PAGE_ID: null
NOTION_DATABASE_NAME: null
NOTION_FILE_NAME: null
NOTION_FOLDER_NAME: null
NOTION_INSERT_METHOD: append
type: BLUEPRINT
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- '200'
- '201'
- '202'
- '203'
- '204'
- '205'
- '206'
- '249'