n8n-nodes-obsidian-rest-local
v0.3.0
Published
n8n community node to interact with Obsidian via Local REST API
Readme
n8n-nodes-obsidian-rest-local
This is an n8n community node that enables you to interact with Obsidian via the Local REST API plugin. Automate your note-taking workflows by creating, reading, updating, and managing your Obsidian vault from n8n.
n8n is a fair-code licensed workflow automation platform.
Table of Contents
Installation
Follow the installation guide in the n8n community nodes documentation.
npm install n8n-nodes-obsidian-rest-localCredentials
To use this node, you need to install and configure the Local REST API plugin in Obsidian.
Setup Steps
Install the plugin:
- Open Obsidian Settings → Community Plugins
- Search for "Local REST API" by Adam Coddington
- Install and enable the plugin
Configure the API:
- Go to Settings → Local REST API
- Enable the HTTP server (or HTTPS if you have certificates)
- Copy the API Key displayed in the settings
- Note the port number (default: 27123 for HTTP, 27124 for HTTPS)
Create n8n credentials:
- In n8n, go to Settings → Credentials
- Click "Add Credential" and search for "Obsidian API"
- Fill in the fields:
- API Key: The key from step 2
- Base URL:
http://localhost:27123(HTTP) orhttps://localhost:27124(HTTPS) - Ignore SSL Issues: Enable if using the default self-signed certificate
SSL Certificate Handling
The Local REST API plugin uses a self-signed certificate by default. You have two options:
- Ignore SSL issues (recommended for local use): Enable the "Ignore SSL Issues" option in credentials
- Install the certificate: Download the certificate from the plugin settings and add it to your system trust store
Operations
This node organizes functionality into Resources and Operations. First select a resource type, then choose the specific operation:
| Resource | Operations | Description | |----------|-----------|-------------| | Note | Get, Create, Update, Delete, Copy, Append | Work with individual notes | | Vault | List Notes | Vault-wide operations | | Periodic | Get, Create | Work with periodic notes (daily, weekly, monthly, quarterly, yearly) | | Command | List Commands, Execute | Control Obsidian application |
Note Operations
| Operation | Description |
|-----------|-------------|
| Get | Retrieve the content of a note by path |
| Create | Create a new note. Supports overwrite option to replace existing notes |
| Update | Replace the entire content of an existing note |
| Delete | Delete a note from the vault |
| Copy | Copy a note from one location to another |
| Append | Append content to the end of an existing note (creates if not exists) |
Vault Operations
| Operation | Description | |-----------|-------------| | List Notes | List all notes in the vault, optionally filtered by folder |
Periodic Operations
| Operation | Description | |-----------|-------------| | Get | Retrieve a daily, weekly, monthly, quarterly, or yearly note | | Create | Create or update a periodic note |
Command Operations
| Operation | Description | |-----------|-------------| | List Commands | Get all available Obsidian commands with their IDs | | Execute | Execute an Obsidian command by ID |
Compatibility
- Minimum n8n version: Not specified (uses n8n-workflow peer dependency)
- Obsidian: Compatible with Obsidian v1.0+
- Local REST API plugin: v1.0+
- Node.js: v22+ (for development)
Usage
Basic Example: Create a Note
- Add the Obsidian node to your workflow
- Select Resource:
Note - Select Operation:
Create - Set the path:
Projects/My Project.md - Set the content:
# My Project - Task 1: Setup environment - Task 2: Configure API
Working with Periodic Notes
Periodic notes are automatically organized by date:
- Daily:
2024-01-15format - Weekly:
2024-W03format - Monthly:
2024-01format - Quarterly:
2024-Q1format - Yearly:
2024format
Leave the date field empty to use the current date.
Executing Commands
To execute an Obsidian command:
- Add an Obsidian node and select Resource:
Command - Select Operation:
List Commandsto get available commands - Find the command ID you need
- Add another Obsidian node with Resource:
Command, Operation:Execute - Paste the command ID
Example command IDs:
app:reload: Reload the appworkspace:close: Close current tabeditor:save-file: Save current file
Testing
Unit Tests
npm testIntegration Tests
Integration tests require a running Obsidian instance with the Local REST API plugin configured.
Prerequisites:
- Install Obsidian and the Local REST API plugin
- Enable HTTP server on port 27123
- Create a vault named "test" (all test operations use
test/prefix) - Set the API key as an environment variable:
Optional: Set a custom base URL (defaults toexport OBSIDIAN_TEST_API_KEY="your-api-key-here"http://127.0.0.1:27123):export OBSIDIAN_TEST_BASE_URL="http://localhost:27123"
Run integration tests:
# With environment variable
OBSIDIAN_TEST_API_KEY=your-api-key npm run test:integration
# Or if already exported
npm run test:integrationNote: Integration tests will create, modify, and delete files in the test vault. Ensure the test vault doesn't contain important data.
Resources
- n8n community nodes documentation
- Obsidian Local REST API Documentation
- Obsidian Local REST API GitHub
- Obsidian
Version History
0.3.0
- Breaking Change: Standardized output format across all operations
- All operations now return unified response envelope with
data,meta, and optionalerrorfields - Query operations return data in
datafield with metadata - Mutation operations return
data: nullwith confirmation metadata - Error responses include structured
errorobject withmessage,code, andstatusCode - Metadata includes
resource,operation,timestamp,statusCode,success
- All operations now return unified response envelope with
0.2.0
- Breaking Change: Reorganized UI with Resource-Operation pattern
- Resources: Note, Vault, Periodic, Command
- Operations grouped under each resource
- Backward compatibility maintained for existing workflows
0.1.0
- Initial release
- Support for note CRUD operations
- Vault listing operations
- Periodic notes support
- Command execution
