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 note-taking and knowledge management system via its API, enabling automation of various document and notebook operations. Specifically, the "Get Document Path by ID" operation retrieves the human-readable folder-like path (HPath) for a given document using its unique document ID.
Use cases include:
- Automating workflows that require resolving document IDs to their paths for display or further processing.
- Integrating SiYuan documents into other systems where the path is needed rather than just the ID.
- Building dashboards or reports that show document locations within notebooks.
Example: Given a document ID, this operation returns a path like /My Notes/Meeting Summary, helping users understand where the document resides in the notebook hierarchy.
Properties
| Name | Meaning |
|---|---|
| Document ID | The unique identifier of the SiYuan document whose human-readable path you want to retrieve. |
Output
The output JSON contains the human-readable path (HPath) string corresponding to the provided document ID. This path represents the folder-like location of the document within the SiYuan workspace.
Example output JSON:
{
"hpath": "/My Notes/Meeting Summary"
}
No binary data is produced by this operation.
Dependencies
- Requires an active connection to the SiYuan API via an API URL and an API token credential.
- The node depends on the
SiYuanClientlibrary to communicate with the SiYuan API. - Proper credentials must be configured in n8n to authenticate requests.
Troubleshooting
- Missing Credentials: If the API URL or token is not set, the node will throw a "Credentials missing!" error. Ensure the API key credential is properly configured.
- Invalid Document ID: Providing a non-existent or malformed document ID may result in errors or empty responses. Verify the document ID is correct.
- API Connectivity Issues: Network problems or incorrect API URLs can cause request failures. Confirm the API endpoint is reachable.
- Unsupported Operation Error: If the operation parameter is incorrectly set, the node will throw an unsupported operation error. Make sure to select "Get Document Path by ID" for this use case.
Links and References
- SiYuan Official Website
- SiYuan API Documentation
- GitHub - SiYuanClient Library (replace with actual repo if available)