SiYuan icon

SiYuan

Interacts with the SiYuan API using selected operations

Overview

This node integrates with the SiYuan note-taking and knowledge management system via its API, enabling automation of various document and notebook operations. The "Export Document Markdown" operation specifically exports the full Markdown content of a specified document along with its human-readable path within the SiYuan workspace.

Use cases include:

  • Automating backups or exports of SiYuan documents in Markdown format.
  • Integrating SiYuan content into other systems or workflows that consume Markdown.
  • Extracting document content for processing, analysis, or publishing outside SiYuan.

For example, you could use this operation to export meeting notes stored in SiYuan as Markdown files for sharing or version control.

Properties

Name Meaning
Document ID The unique identifier of the SiYuan document to export. This specifies which document's Markdown content will be retrieved.

Output

The output JSON contains the exported Markdown content of the specified document along with its human-readable path (HPath) inside SiYuan. This typically includes:

  • The full Markdown text representing the document content.
  • Metadata such as the document's path within the notebook hierarchy.

No binary data is produced by this operation.

Dependencies

  • Requires an active connection to the SiYuan API using valid credentials including:
    • The base URL of the SiYuan API.
    • An API authentication token.
  • The node depends on the SiYuanClient library to communicate with the SiYuan API.
  • Proper configuration of these credentials in n8n is necessary before executing the node.

Troubleshooting

  • Missing Credentials: If the API URL or token is not set, the node will throw a "Credentials missing!" error. Ensure the API credentials are correctly configured in n8n.
  • Invalid Document ID: Providing an incorrect or non-existent 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 failures. Confirm the SiYuan API endpoint is reachable from the n8n environment.
  • Unsupported Operation Error: If the operation parameter is misconfigured or changed, the node may throw an unsupported operation error. Make sure the operation is set exactly to "exportDocMd" for this functionality.

Links and References

Discussion