1. Opening Problem Statement
Meet Sarah, a productivity consultant who organizes her work and client notes meticulously in Obsidian. She often needs to share these notes, complete with attachments like images and PDFs, with her clients and team via email. Currently, Sarah spends significant time copying content, downloading attachments manually, and composing emails in Gmail. This tedious process leads to delays, occasional errors in including attachments, and inconsistent email formatting. For Sarah, this means lost productivity and frustrated clients waiting for important information.
This is precisely the problem solved by this unique n8n workflow: automating the entire process from Obsidian note in a markdown format directly to a formatted email via Gmail, including attachments and customizable metadata like recipients and subjects using YAML frontmatter inside the note.
2. What This Automation Does
When you run this workflow, it seamlessly sends your Obsidian note as an email with the following outcomes:
- Automatically triggers via a webhook set up through Obsidian’s Post Webhook plugin when you choose “Send to Webhook.”
- Parses the YAML frontmatter in your Obsidian note to extract the email metadata such as To, CC, BCC, Subject, Sender Name, and Reply-To addresses.
- Detects and processes all attachments embedded in your note by converting them from base64 strings to proper binary files sent via Gmail.
- Sends the email via Gmail’s OAuth2 authenticated node, ensuring secure email delivery with all specified details and attachments.
- Sends a response back to Obsidian confirming the email dispatch with a timestamp, automatically appending the confirmation at the bottom of the note.
- Bifurcates flow to handle notes with or without attachments without manual intervention.
By automating this workflow, Sarah can save hours per week by eliminating manual email composition, reduce mistakes in attachments, and ensure faster delivery of critical client information.
3. Prerequisites ⚙️
- Obsidian with the Post Webhook plugin installed and configured.
- n8n account to host and run the workflow.
- Gmail account connected via OAuth2 credentials in n8n.
- Basic knowledge of YAML frontmatter syntax to specify email metadata in your notes.
- Internet access to receive webhook calls and send emails.
4. Step-by-Step Guide
Step 1: Set Up The Webhook in n8n
Navigate to your n8n editor and create a new workflow. Add a Webhook node from the node panel.
Configure the Webhook to use HTTP POST method and give it a unique path for your webhook URL, for example e634d721-48b0-4985-8a57-62ca4c7b3cfb.
Enable Response Mode to Response Node. This makes n8n hold the connection until the workflow sends a response.
Save and activate the workflow to get the full webhook URL. You will need this URL for your Obsidian plugin setup.
Common mistake: Forgetting to set the HTTP method to POST or mixing up the webhook URL in Obsidian.
Step 2: Configure Obsidian Post Webhook Plugin
Open Obsidian and install the Post Webhook plugin (available via the community plugins marketplace or GitHub).
Go to the plugin settings, paste your n8n webhook URL, and test the connection using the built-in test function.
Ensure your notes include YAML frontmatter with email metadata fields as shown in the workflow’s sticky note and example:
---
to: "[email protected]"
cc: "[email protected]"
bcc: "[email protected]"
subject: "Your Obsidian Note"
sender-name: "Your Name"
send-replies-to: "[email protected]"
---
Note content goes here...
Use the command palette (Ctrl/Cmd + P) to run “Send to Webhook” on any open note to trigger the workflow.
Common mistake: YAML syntax errors or missing mandatory email fields like to or subject.
Step 3: Parse Incoming Webhook Data
The workflow begins at the Webhook node that receives the POST payload from Obsidian, including the note content and attachments in base64 format.
After the webhook, the Check if attachments exist (IF node) evaluates if any attachments are present.
If attachments exist, the workflow splits them out using the Separate attachment data (SplitOut node) to handle each file individually.
If no attachments are present, it checks if the message is a test or proceeds to send the email directly without attachments.
Step 4: Process Attachments
For each attachment, the workflow uses Fix Base64 string (Set node) to strip off metadata prefixes from the base64 data, preparing it for conversion.
Attachments are processed in batches using the Process Each Attachment (SplitInBatches node) ensuring scalability even with many attachments.
Each attachment is converted from base64 to a binary file in the Convert Attachment to File (ConvertToFile node), naming the files as per the original filenames.
These files are then aggregated back into a single data set in the Prepare Attachments for Email (Aggregate node) to include with the Gmail node.
Common mistake: Not removing the base64 prefix causes corrupted files.
Step 5: Send Email via Gmail
Depending on whether attachments exist, the workflow sends the email via one of two Gmail nodes:
- Email With Attachments node sends emails including the attachments and uses metadata from YAML.
- Email Without Attachments node sends plain emails when no files are attached.
The Gmail nodes use OAuth2 credentials for secure sending.
Common mistake: Make sure OAuth2 credentials are connected properly, or emails will fail.
Step 6: Respond Back To Obsidian
After sending the email, the Get date (DateTime node) captures the current timestamp.
The workflow responds to the webhook call using the Respond to Obsidian (RespondToWebhook node) sending back a confirmation message with the send date/time.
This response is appended in Obsidian as a confirmation to the bottom of your note.
5. Customizations ✏️
- Change Sender Name: Modify the
sender-namefield in your YAML frontmatter to customize the sender name shown in the email. - Add Custom Reply-To: Use the
send-replies-toYAML field to specify a different reply-to email address for responses. - Modify Email Subject: Adjust the
subjectfield in your note’s YAML to set custom email subjects per note. - Handle Additional Attachment Types: Extend the workflow by adding nodes after the Convert Attachment to File to resize images or convert formats before sending.
- Test Mode Filtering: Use the Check if it is a test IF node to filter out test runs by setting a boolean
testflag in your YAML to avoid sending real emails during testing.
6. Troubleshooting 🔧
Problem: Emails not sending, error “Invalid credentials”
Cause: OAuth2 credentials for Gmail are not connected or expired.
Solution: Go to n8n credentials manager, reauthorize your Gmail account, then reattach credentials to the Gmail nodes.
Problem: Attachments arrive corrupted or missing
Cause: Base64 data prefix not removed before conversion.
Solution: Check the Fix Base64 string node’s code which removes the prefix data:.*?,—ensure it matches your actual base64 data format.
Problem: Workflow stuck or no response returned to Obsidian
Cause: Respond to Obsidian node misconfigured or webhook node response mode not set to response node.
Solution: Set the webhook node’s response mode to “Response Node” and ensure the RespondToWebhook node is correctly connected and configured to send a timely response.
7. Pre-Production Checklist ✅
- Verify your Gmail OAuth2 credentials are valid and connected in n8n.
- Test the webhook URL independently using tools like Postman with sample payloads.
- Check your Obsidian notes syntax for correct YAML frontmatter formatting without errors.
- Perform test runs with the
test: trueflag to avoid sending actual emails. - Confirm that attachments are included in the payload and processed correctly by n8n nodes.
- Backup existing notes and workflows before deploying to production.
8. Deployment Guide
Once you finish building and testing your workflow, activate it in n8n.
Update your Obsidian Post Webhook plugin with the production webhook URL if different.
Start using the “Send to Webhook” command in Obsidian to trigger real emails.
Monitor recent executions in n8n to check for errors or delivery success.
9. FAQs
- Can I use another email provider instead of Gmail?
Yes, you can replace the Gmail nodes with SMTP or other email nodes supported by n8n but will need to adjust authentication accordingly. - Does this workflow consume Gmail API quota?
Yes, emails sent through Gmail nodes count against your API limits, so monitor usage if sending high volumes. - Is it secure to send attachments this way?
Yes, attachments are sent securely via OAuth2-authenticated Gmail and attachments are base64 encoded in transit. - Can I handle very large attachments?
There may be size limits from Gmail for attachments; consider breaking larger files into smaller parts or using linked storage instead.
10. Conclusion
Congratulations! You’ve now automated the process of sending richly formatted emails directly from Obsidian notes using n8n and Gmail. This workflow not only saves you hours every week, eliminating manual email preparation and attachment handling, but also reduces errors and speeds up your communication.
Next, you might want to extend this automation to include:
- Adding PDF export of your notes before emailing for better formatting.
- Integrating logging in Google Sheets to track emails sent from notes.
- Using Slack notifications upon successful email delivery for real-time updates.
Keep experimenting and automating your workflows — your productivity will thank you! ⚙️