Actions16
Overview
The node provides advanced integration with Notion, focusing on comprehensive block management within Notion pages. Specifically, the Block - Update operation allows users to update a single block's content and properties in Notion by specifying the block ID and new block data.
This operation is useful when you want to programmatically modify existing blocks in a Notion page, such as changing text content, updating formatting, or adjusting block-specific properties (like checked status for to-do items or language for code blocks).
Practical examples:
- Updating the text of a paragraph block.
- Changing the heading level or content of a heading block.
- Modifying properties like color or checked state on list or to-do blocks.
- Editing rich text formatting inside a block.
Properties
| Name | Meaning |
|---|---|
| Block ID | The unique identifier of the block to update. |
| Additional Fields | Collection of optional fields that can be updated on the block. |
Note: For the Update operation on blocks, the main input is a collection named "Blocks" (not shown in the provided JSON but present in the source code), which contains one block object with these sub-properties:
- Type: The type of the block (e.g., paragraph, heading_1, to_do).
- Content: The textual or relevant content of the block.
- Rich Text (JSON): Rich text content as a JSON array supporting formatting.
- Properties (JSON): Block-specific properties encoded as JSON (e.g., color, checked, language).
- Children (JSON): Child blocks as a JSON array (if applicable).
These inputs allow detailed customization of the block's content and appearance.
Output
The output is the JSON response from the Notion API representing the updated block object. It includes all standard Notion block fields such as:
id: The block ID.type: The block type.created_time,last_edited_time: Timestamps.propertiesorrich_text: Updated content and formatting.- Any other metadata returned by Notion for the block.
No binary data output is involved in this operation.
Dependencies
- Requires a valid Notion API authentication token configured in n8n credentials.
- Uses Notion REST API endpoints for blocks (
PATCH /blocks/{block_id}). - Relies on utility functions for parsing and validating block input data and converting it into the format expected by Notion.
Troubleshooting
Error: No block data provided for update
Occurs if the "Blocks" input collection is empty or missing. Ensure at least one block object with valid data is provided.Invalid JSON in Properties or Rich Text
If JSON strings for properties or rich text are malformed, the node will throw an error. Validate JSON syntax before input.Invalid Block Type or Structure
The node validates block structure before sending. Unsupported types or invalid combinations may cause errors.Authentication Errors
If the Notion API credentials are invalid or expired, the node will fail with an authentication error. Reconfigure credentials.
Links and References
This summary covers the logic and usage of the Block - Update operation in the Notion Advanced node based on static analysis of the source code and provided property definitions.