Overview
The "Notion Set Icon" node allows users to set a custom icon for a Notion page. This is useful when you want to personalize or visually distinguish pages in your Notion workspace by assigning specific icons, either from an external image URL or by uploading a local image file.
Common scenarios include:
- Automatically updating page icons based on content type or status.
- Branding pages with company logos or project-specific icons.
- Enhancing visual navigation within Notion by setting meaningful icons programmatically.
For example, you could use this node to set a project page's icon to a logo hosted online or upload a custom icon stored locally on your machine.
Properties
| Name | Meaning |
|---|---|
| Page ID | The unique identifier of the Notion page where the icon will be set. Extractable from the page URL. |
| Icon Source | Choose whether to use an external image URL or upload a local image file as the icon. Options: URL, Upload File. |
| Icon URL | (Required if Icon Source is URL) The direct URL of the image to use as the page icon. |
| Input Binary Field | (Required if Icon Source is Upload File) The name of the binary property containing the image file to upload. |
Output
The node outputs JSON data with the following structure:
success: Boolean indicating if the icon was successfully updated.pageId: The normalized ID of the Notion page that was updated.iconUrl: The URL of the icon that was set on the page.message: A success message confirming the update.
Example output JSON:
{
"success": true,
"pageId": "214c413b-2a68-800f-9f9a-d234e37d1380",
"iconUrl": "https://example.com/icon.png",
"message": "Page icon updated successfully"
}
If the operation fails and "Continue On Fail" is enabled, the output will contain:
success: falseerror: Error message describing the failure.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the Notion service.
- Makes HTTP requests to Notion's private API endpoints to upload files and update page metadata.
- Uses multipart form-data for uploading local image files.
- Requires proper configuration of credentials including tokens and user identifiers for authorization.
Troubleshooting
- Invalid Page ID: If the provided page ID is malformed or cannot be normalized, the node throws an error "Invalid page ID". Ensure the page ID is correctly extracted from the Notion page URL and formatted properly.
- Failed to get upload URL: When uploading a local file, if the node cannot retrieve a valid upload URL from Notion, it will throw "Failed to get upload URL from Notion". This may indicate expired or invalid credentials or changes in Notion's API.
- HTTP Request Failures: Network issues or incorrect credentials can cause HTTP request failures. Verify API keys and network connectivity.
- Binary Data Issues: When uploading a file, ensure the binary property name matches the input data and contains valid image data.
To resolve errors:
- Double-check all input parameters, especially page ID and icon source fields.
- Confirm that the API authentication token is valid and has necessary permissions.
- For file uploads, verify the binary data exists and is correctly referenced.