Actions71
- Asset Actions
- Attribute Actions
- Block Actions
- Database Actions
- Document Actions
- Markdown Table Actions
- Notebook Actions
- Search Actions
- System Actions
- Tag Actions
Block → Insert
AI-generatedOverview
This node operation inserts a new content block into a parent block (which can be a document or container block) within the SiYuan note-taking system. It allows users to specify the Markdown content of the new block and precisely position it relative to existing blocks by providing either the previous or next block ID. This operation is useful for dynamically adding content to structured documents or notes, such as inserting new paragraphs, sections, or other content elements in a controlled order.
Use Case Examples
- Inserting a new paragraph block after a specific block in a document.
- Adding a new content block before another block to reorganize document structure.
Properties
| Name | Meaning |
|---|---|
| Parent Block ID | The ID of the parent block (document or container block) to add content into. This is required to specify where the new block will be inserted. |
| Content (Markdown) | The Markdown content for the new block to be inserted. This defines the textual content and formatting of the block. |
| Previous Block ID | The ID of the block after which the new block should be inserted. If left empty, the Next Block ID is used instead to determine the insertion point. |
| Next Block ID | The ID of the block before which the new block should be inserted. This is used when the Previous Block ID is not provided to determine the insertion point. |
| Additional Options | Optional settings for the block insertion, including the data type of the content (Markdown or DOM/HTML). Defaults to Markdown. |
Output
JSON
id- The unique identifier of the newly inserted block.parentBlockId- The ID of the parent block where the new block was inserted.content- The content of the inserted block, typically in Markdown or specified data type format.position- The position of the new block relative to other blocks, based on Previous Block ID or Next Block ID.
Dependencies
- Requires SiYuan API URL and API Token credentials for authentication.
Troubleshooting
- Ensure that the SiYuan API URL and Token credentials are correctly set; missing or invalid credentials will cause authentication errors.
- Verify that the Parent Block ID is valid and exists in the SiYuan workspace; invalid IDs will cause insertion failures.
- When specifying Previous Block ID or Next Block ID, ensure these IDs exist and are correctly referenced to avoid positioning errors.
- If the content format is set incorrectly (e.g., DOM content provided but data type set to Markdown), the block content may not render as expected.