Actions25
- Append Block
- Create Document
- Create Notebook
- Delete Block
- Execute SQL Query
- Export Document Markdown
- Get Block Attributes
- Get Block Kramdown
- Get Child Blocks
- Get Document ID by Path
- Get Document Path by ID
- Insert Block
- List Documents in Notebook
- List Files in Directory
- Move Document
- Prepend Block
- Push Error Message
- Push Message
- Remove Document
- Remove Notebook
- Rename Document
- Rename Notebook
- Render Sprig Template
- Set Block Attributes
- Update Block
Overview
The node interacts with the SiYuan note-taking and knowledge management system via its API, enabling various document and block-level operations. Specifically, the "Update Block" operation replaces the entire content of an existing block (such as a paragraph, list item, image, or even a whole document block) with new Markdown or HTML content.
This operation is useful when you want to programmatically modify the content of a specific block within your SiYuan workspace without altering other parts of the document or notebook. For example, you might update meeting notes, correct typos, or refresh dynamic content in a block based on external data.
Practical examples:
- Updating a paragraph block with revised text.
- Replacing an image block's caption or description.
- Modifying a list block's items by providing new Markdown content.
Properties
| Name | Meaning |
|---|---|
| Block ID | The unique identifier of the block you want to update (e.g., paragraph, list, image block). |
| Content (Markdown/HTML) | The new content for the block, written in Markdown or HTML format, which will replace the existing content entirely. |
Output
The output is a JSON array where each item corresponds to the result of the executed operation for each input item. For the "Update Block" operation, the output typically contains confirmation details or the updated block information returned from the SiYuan API.
If the operation succeeds, the output JSON object may include success indicators or the updated block's metadata. If it fails, the output will contain an error message describing the issue.
The node does not output binary data for this operation.
Dependencies
- Requires an active connection to the SiYuan API.
- Needs credentials containing the SiYuan API URL and an API authentication token.
- The node depends on the
SiYuanClientlibrary bundled with the node to communicate with the SiYuan API.
Troubleshooting
- Missing Credentials: If the API URL or token is not provided, the node will throw a "Credentials missing!" error. Ensure that valid credentials are configured.
- Invalid Block ID: Providing a non-existent or incorrect block ID will cause the API call to fail. Verify the block ID before running the node.
- Malformed Content: Supplying invalid Markdown or HTML content might lead to unexpected rendering or errors. Validate the content format.
- API Errors: Network issues or permission problems with the SiYuan API can cause failures. Check connectivity and API permissions.
- Unsupported Operation: If the operation parameter is set incorrectly, the node throws an "Unsupported operation" error.
To resolve these issues:
- Double-check all required parameters.
- Confirm API credentials and access rights.
- Validate block IDs and content formats.
- Enable "Continue On Fail" if you want the workflow to proceed despite individual errors.