Skip to content

PsycoStea/SiYuan-n8n-nodes

Repository files navigation

✨ n8n-nodes-siyuan ✨

NPM Version NPM Downloads License: MIT GitHub issues

This is an n8n community node package that empowers you to seamlessly integrate with SiYuan, your personal knowledge management powerhouse, directly within your automation workflows. 🧠

SiYuan is a privacy-first, self-hosted personal knowledge base that supports Markdown, block-based editing, and bidirectional linking. This n8n node package provides a comprehensive set of operations to interact with the SiYuan API.


Navigation


Installation

  1. Go to Settings > Community Nodes in your n8n instance.
  2. Select Install.
  3. Enter n8n-nodes-siyuan in the search box.
  4. Click the Install button.

Alternatively, follow the generic installation guide in the n8n community nodes documentation.

The SiYuan Node

This package provides a single, comprehensive SiYuan node. You can select the desired action using the Operation dropdown within the node.

SiYuan Node Example

Supported Operations:

  • Notebook Management:
    • Create Notebook
    • Rename Notebook
    • Remove Notebook
    • List Notebooks
  • Document Management:
    • Create Document
    • Rename Document
    • Remove Document
    • Move Document
    • Get Document ID by Path
    • Get Document Path by ID
    • List Documents in Notebook (includes titles)
    • Export Document Markdown
  • Block Manipulation:
    • Append Block
    • Prepend Block
    • Insert Block
    • Update Block
    • Delete Block
    • Get Block Kramdown
    • Get Child Blocks
  • File System (Workspace):
    • List Files in Directory
  • Attributes:
    • Set Block Attributes
    • Get Block Attributes
  • Database & Templating:
    • Execute SQL Query
    • Render Sprig Template
  • Notifications:
    • Push Message
    • Push Error Message
  • System:
    • Get Version

Credentials

To interact with your SiYuan instance, you'll need to configure the SiYuan API credentials in n8n:

  1. Prerequisites:
    • Ensure SiYuan is running and accessible from your n8n instance.
    • In SiYuan, go to Settings -> About -> API Token.
    • Enable the API and copy your API Token.
    • Note down your SiYuan API Server address (e.g., http://127.0.0.1:6806 for a local instance).
  2. Setup in n8n:
    • Navigate to the Credentials section in your n8n instance.
    • Click Add credential.
    • Search for SiYuan API and select it.
    • Provide a Credential Name (e.g., "My Local SiYuan").
    • Enter your SiYuan API URL (e.g., http://127.0.0.1:6806).
    • Paste your SiYuan API Token.
    • Click Save.

Usage Examples

The SiYuan node is designed for direct interaction with the API via clearly defined parameters for each operation. This makes it highly versatile for various automation tasks.

Using with AI Agents in n8n:

While this node itself doesn't perform AI functions, it can be a powerful downstream component for AI-driven workflows in n8n:

  • AI-Generated Content: Use an LLM node (like OpenAI, Anthropic, or a local model via Ollama) to generate meeting summaries, blog post drafts, or research notes. Then, pass this generated Markdown content to the SiYuan node's "Create Document" or "Append Block" operation to automatically save it into your knowledge base.
  • AI-Powered Task Management: An AI agent could parse incoming emails or messages, extract tasks, and then use the SiYuan node to create new task blocks or documents in a specific project notebook.
  • Dynamic Querying: Use an AI node to formulate SQL queries based on natural language questions about your notes, then pass the SQL to the SiYuan node's "Execute SQL Query" operation to retrieve information.

The possibilities are broad when combining n8n's AI capabilities with direct SiYuan integration!

Compatibility

  • Minimum n8n Version: Recommended v1.22.0+ (due to stable Node API v1 usage).
  • Tested n8n Versions: Actively tested with n8n v1.40.0 and newer.
  • SiYuan API: Developed against the SiYuan API as documented here. Compatibility is expected with recent SiYuan versions that support this API.

Resources

Version History

  • 0.4.0 (2025-05-11)
    • Added Notebook Management: Create Notebook, Rename Notebook, Remove Notebook.
    • Added Get Child Blocks operation.
    • Added Export Document Markdown operation.
    • Added List Files in Directory operation.
  • 0.3.1 (2025-05-11)
    • Improved clarity of operation and parameter descriptions in the node UI.
    • Includes minor lint fixes for descriptions.
  • 0.3.0 (2025-05-10)
    • Added "List Documents in Notebook" operation (fetches document titles).
    • Added "List Notebooks" operation.
  • 0.2.0 (2025-05-10)
    • Major refactor: Consolidated all functionality into a single SiYuan node with an operation selector.
    • Removed "AI" branding from node name for clarity.
    • Updated dependencies and resolved various build/lint issues.
    • This version supersedes any previous individual "Tool" nodes.
  • 0.1.x
    • Previous experimental versions with individual tool nodes (now deprecated).

Contributing

Contributions, issues, and feature requests are welcome! Please feel free to check the issues page.


Star History Chart

This project was vibe coded. This is my first big project ❤️

About

n8n nodes for SiYuan

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published