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
This node integrates with the SiYuan API, enabling users to perform a variety of operations on their SiYuan workspace such as managing notebooks, documents, blocks, and running queries. The "Render Sprig Template" operation specifically processes a template string using SiYuan's built-in Sprig template functions, which is useful for dynamic text generation based on templates.
Common scenarios include:
- Dynamically generating dates or formatted strings within workflows.
- Creating or updating content in SiYuan documents programmatically.
- Managing notes and notebooks by creating, renaming, moving, or deleting them.
- Querying SiYuan data directly via SQL.
- Displaying notifications inside the SiYuan interface.
Practical example for "Render Sprig Template":
- You want to generate a date string formatted as "YYYY-MM-DD" dynamically during workflow execution, e.g.,
{{now | date "2006-01-02"}}, and use it downstream in your automation.
Properties
| Name | Meaning |
|---|---|
| Sprig Template | A required template string using Sprig functions (e.g., `{{now |
Output
The node outputs JSON data representing the result of the selected operation. For the "Render Sprig Template" operation, the output JSON contains the rendered string result of processing the provided Sprig template.
Example output JSON structure for "Render Sprig Template":
[
{
"rendered": "2024-06-10"
}
]
(Note: The actual key name depends on the SiYuanClient implementation but generally includes the processed template result.)
The node does not output binary data.
Dependencies
- Requires an active connection to the SiYuan API.
- Needs credentials containing the SiYuan API URL and an API authentication token.
- The node uses an internal SiYuan client library to communicate with the API.
Troubleshooting
- Missing Credentials: If the API URL or token is missing, the node throws a "Credentials missing!" error. Ensure you have configured valid API credentials before running the node.
- Unsupported Operation: If an invalid operation is selected, the node throws an "Unsupported operation" error. Verify the operation name is correct.
- Template Errors: If the Sprig template syntax is incorrect or uses unsupported functions, the rendering may fail or return unexpected results. Validate your template syntax according to Sprig templating rules.
- API Connectivity Issues: Network problems or incorrect API URLs can cause failures. Confirm network access and correct endpoint configuration.