SiYuan icon

SiYuan

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

Asset → Put File

AI-generated

Overview

The node allows users to upload or create a file or directory within the SiYuan workspace. It is useful for managing files programmatically in SiYuan, such as saving text content to a specific file path or creating directories. For example, users can automate the process of updating notes or assets by writing content directly to files in their workspace.

Use Case Examples

  1. Uploading a markdown note to a specific path in the SiYuan workspace.
  2. Creating a directory structure within the workspace for organizing assets.

Properties

Name Meaning
File Path The path of the file within the SiYuan workspace where the content will be written.
File Content The content to write to the specified file path.
Is Directory A boolean option to specify whether to create a directory instead of a file.

Output

JSON

  • success - Indicates whether the file or directory was successfully created or updated.

Dependencies

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

Troubleshooting

  • Ensure that the SiYuan API URL and token credentials are correctly set; missing or invalid credentials will cause authentication errors.
  • Verify that the file path is valid and accessible within the SiYuan workspace; invalid paths may cause operation failures.
  • If creating a directory, ensure the 'Is Directory' option is set to true; otherwise, the node will attempt to write file content, which may cause errors if the path is intended as a directory.

Discussion