Obsidian Trigger
AI-generatedOverview
This node triggers workflow executions based on changes detected in an ObsidianMD vault. It can watch either a specific file or a folder within the vault for various file system events such as file additions, changes, deletions, and folder changes. It supports filtering events based on frontmatter content in the notes, allowing users to trigger workflows only when certain conditions in the note metadata are met. This node is useful for automating tasks related to note updates, such as syncing, notifications, or further processing of notes in an Obsidian vault.
Use Case Examples
- Trigger a workflow whenever a specific note file is updated to automatically sync changes to a cloud service.
- Watch a folder in the Obsidian vault for new notes added and trigger a workflow to index them in a database.
- Monitor changes in note frontmatter to trigger workflows only when specific tags or metadata values are updated.
Properties
| Name | Meaning |
|---|---|
| Obsidian Vault Path | The path to the user's Obsidian vault, which is the root directory being monitored. |
| Trigger On | Determines whether to watch a specific file or a folder for changes. |
| File to Watch | The path to the specific file to watch when 'Trigger On' is set to file. |
| Frontmatter Filters | Filters applied to the frontmatter of the file to conditionally trigger events based on note metadata. |
| Folder to Watch | The path to the folder to watch when 'Trigger On' is set to folder. |
| Watch for | The types of file system events to listen for when watching a folder, such as file added, changed, deleted, folder added, or deleted. |
| Options | Additional options to customize the watcher behavior, including waiting for write finish, ignoring files, ignoring initial files/folders, following symlinks, and max folder depth. |
Output
JSON
event- The type of file system event that triggered the workflow (e.g., add, change, unlink).vaultPath- The resolved absolute path to the Obsidian vault being watched.path- The resolved absolute path to the file or folder that triggered the event.extras- Additional data such as the frontmatter filter string applied to the note.
Dependencies
- chokidar (file watching library)
- Node.js fs module for file system operations
- path module for path resolution
Troubleshooting
- Ensure the watched path is inside the configured Obsidian vault to avoid errors.
- Verify that the specified file or folder path exists and is accessible.
- Check that frontmatter filters are correctly formatted to avoid filtering out all events.
- If no events trigger, confirm that the selected event types match the actual file system changes.
- Use the 'Ignore' option carefully to avoid unintentionally ignoring important files or folders.
Links
- ObsidianMD Official Website - Official site for Obsidian note-taking software.
- Chokidar GitHub Repository - The file watching library used by this node to monitor file system changes.