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 block operations. Specifically, the "Get Block Kramdown" operation fetches the raw Markdown content (in Kramdown format) of a specified block within SiYuan, which can be a paragraph, list, image, or even an entire document.

Use cases include:

  • Extracting the original Markdown source of a block for processing or backup.
  • Integrating SiYuan content into other workflows that require raw Markdown.
  • Analyzing or transforming block content programmatically outside SiYuan.

For example, you might use this operation to retrieve the Markdown of a meeting notes block to send it via email or to convert it into another format.

Properties

Name Meaning
Block ID The unique identifier of the specific block (paragraph, list, image, or whole document) whose raw Kramdown Markdown content you want to retrieve.

Output

The output JSON contains the raw Markdown content of the requested block in Kramdown format. This is typically a string representing the block's source text with formatting syntax.

Example output structure:

{
  "kramdown": "Raw markdown content of the block here..."
}

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the SiYuan API, authenticated via an API URL and an API token credential.
  • The node depends on the SiYuanClient library to communicate with the SiYuan backend.
  • Proper credentials must be configured in n8n to allow API access.

Troubleshooting

  • Missing Credentials: If the API URL or token is not set, the node will throw a "Credentials missing!" error. Ensure your SiYuan API credentials are correctly configured.
  • Invalid Block ID: Providing a non-existent or incorrect block ID may result in errors or empty responses. Verify the block ID before running the node.
  • Unsupported Operation: If the operation parameter is incorrectly set, the node will throw an "Unsupported operation" error.
  • API Connectivity Issues: Network problems or incorrect API endpoint URLs can cause failures. Confirm network access and correct API URL configuration.

Links and References

Discussion