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:
- Reading frontmatter from a specified note to use its metadata in workflows.
- Writing or updating frontmatter values in a note based on dynamic input data.
- Automating batch updates of multiple notes' metadata.
For example, you could read the frontmatter of a note to extract project status and then update it later with new progress information.
Properties
Name | Meaning |
---|---|
Filename | The path or name of the Obsidian note file to read from or write to. |
Operation | Choose between "Read Obsidian Note" (to retrieve frontmatter) or "Write Obsidian Note". |
Values To Save | JSON object string representing key-value pairs to add or update in the note's frontmatter. Only shown when operation is "write". |
Output
The node outputs an array of JSON objects representing the note(s) processed. Each object contains the full content of the note including its frontmatter and body content, structured as returned by the internal helper function. The output is accessible via the json
property of the output items.
No binary data output is produced by this node.
Dependencies
- This node depends on helper functions (
getNote
andwriteNote
) imported from a shared module, which handle reading and writing the actual note files. - Requires access to the filesystem where the Obsidian notes are stored.
- No external API keys or online services are required.
Troubleshooting
- Invalid JSON in "Values To Save": When writing, the node expects a valid JSON object string inside the "Values To Save" property. Missing braces or incorrect syntax will cause JSON parsing errors. Ensure the input is a properly formatted JSON object string (e.g.,
"key": "value"
pairs enclosed in{}
). - File Not Found: If the specified filename does not exist or is inaccessible, the node may fail to read or write. Verify the filename path is correct and accessible by n8n.
- Permission Issues: Writing to note files requires appropriate filesystem permissions. Ensure n8n has write access to the target directory.
- Operation Mismatch: Using "Values To Save" when the operation is set to "read" has no effect; ensure the operation matches your intended action.
Links and References
- Obsidian Official Site
- Markdown Frontmatter Specification
- n8n Documentation on Creating Custom Nodes