SiYuan icon

SiYuan

Manage SiYuan notebooks, documents, blocks, attributes, and more. Designed for AI agent workflows.

Document → Create

AI-generated

Overview

This node operation creates a new document within a specified notebook in the SiYuan workspace. It is useful for automating the creation of structured notes or documents based on Markdown content, organized under a specific folder-like path within a notebook. For example, it can be used to programmatically generate meeting notes, project documentation, or any Markdown-based content in a designated notebook and path.

Use Case Examples

  1. Creating a new project meeting notes document in a specific notebook and folder path with Markdown content.
  2. Automating the generation of daily logs or reports as Markdown documents in a notebook.

Properties

Name Meaning
Notebook ID The unique ID of the notebook where the document will be created.
Document Path The folder-like path for the document within the notebook, must start with '/'.
Markdown Content The Markdown content to be included in the new document.

Output

JSON

  • id - The unique identifier of the created document.
  • path - The path of the created document within the notebook.
  • notebookId - The ID of the notebook where the document was created.
  • content - The Markdown content of the created document.

Dependencies

  • Requires SiYuan API URL and API Token credentials for authentication.

Troubleshooting

  • Error if SiYuan API URL or Token is missing: Ensure both are provided in credentials.
  • Unsupported resource error if resource parameter is incorrect: Use 'document' as resource for this operation.
  • Operation failure due to invalid notebook ID or document path: Verify the notebook ID exists and the document path starts with '/'.

Discussion