Overview
This node interacts with Obsidian notes by reading or writing their frontmatter metadata. It is useful for automating the management of note metadata in Obsidian vaults, such as updating tags, dates, or custom fields without manually editing the markdown files.
Common scenarios include:
- Automatically updating note metadata based on external data sources.
- Batch editing frontmatter fields across multiple notes.
- Integrating Obsidian notes with other tools by programmatically modifying their metadata.
For example, you can use this node to write a JSON object of key-value pairs into the frontmatter of a specified note file, effectively updating or adding metadata fields.
Properties
Name | Meaning |
---|---|
Operation | Choose between "Read Obsidian Note" (to retrieve frontmatter and content) or "Write Obsidian Note" (to update frontmatter). |
Filename | The path or name of the Obsidian note file to read from or write to. |
Values To Save | A JSON object (as a string) representing key-value pairs to save into the note's frontmatter when performing a write operation. |
Output
The node outputs an array containing one object per input item. Each object has the following structure:
frontmatter
: An object representing the YAML frontmatter of the note, containing all metadata fields.content
: A string containing the main body content of the note (excluding frontmatter).
If the operation is "write," the output reflects the updated frontmatter and original content after saving.
No binary data output is produced by this node.
Dependencies
- This node depends on helper functions (
getNote
andwriteNote
) imported from a shared module. These functions handle reading and writing the note files, including parsing and serializing frontmatter. - Requires access to the filesystem where the Obsidian vault is stored, with appropriate permissions to read and write note files.
- No external API keys or online services are required.
Troubleshooting
- Invalid JSON in "Values To Save": If the JSON string provided in "Values To Save" is malformed, the node will throw a parsing error. Ensure the JSON is valid and properly formatted (e.g.,
"key":"value"
pairs separated by commas). - File Not Found: If the specified filename does not exist in the expected location, the node may fail to read or write. Verify the filename and path are correct relative to the vault.
- Permission Issues: Lack of read/write permissions on the note files will cause errors. Confirm that the n8n process has sufficient filesystem access.
- Incorrect Operation Selection: Using "write" operation without providing valid JSON in "Values To Save" will result in no changes or errors.