# Post Webhook plugin for Obsidian An [[Obsidian]] plugin that enables sending notes, metadata and attachments to any Webhook endpoint. This is especially powerful when combined with automation platforms such as [[n8n]], where a Webhook call can trigger automated workflows. This enables making things happen anywhere right from Obsidian. For instance, you could make coffee with this, or send e-mails with your notes attached, etc. The possibilities are endless. This goes in both directions: - Call webhooks to make things happen elsewhere - Include the responses in your notes, and use those to make things happen Some use cases: - AI integration: send your notes to AI workflows that return improved versions - Email integration: send emails directly from your Obsidian notes using [[n8n]] workflows - Write email content in Obsidian - Include recipients and subject in the frontmatter - Template: https://n8n.io/workflows/2591-send-emails-via-gmail-from-obsidian/ - Query Airtable databases using natural language. Write a question in your Obsidian note, send it to an n8n workflow that uses a [[Large Language Models (LLMs)]] to interpret your query, and get formatted Airtable data inserted directly into your note - Template: https://n8n.io/workflows/2615-get-airtable-data-via-ai-and-obsidian-notes/ - Transform your Obsidian notes into an audio podcast feed. Select the text you want to turn into a podcast, send it to an n8n workflow that converts it to speech, and automatically publish it to a podcast feed (e.g., Apple Podcasts, Spotify, Substack, etc) - Template: https://n8n.io/workflows/2699-obsidian-notes-read-aloud-using-ai-available-as-a-podcast-feed/ ## Main features - Send notes to Webhooks (e.g., [[n8n]], [[Zapier]], etc) - Parse YAML front-matter and use the metadata in Webhook call payloads - Handling attachments: detect, encode and include note attachments such as images and PDF documents in the Webhook payload - Response handling: automatically append Webhook responses to your notes - Options - Do not use response - Append the response to the note - Create a new note with the response - Overwrite the note with the response - Ask every time ## Configuration - Install the plugin - Go to the settings - Add one or more Webhook endpoints - Choose whether to append Webhook call responses to your notes - Configure attachment and context note options per Webhook ## Usage #### Full Notes 1. Open any note 2. Use the command palette (Ctrl/Cmd + P) 3. Search for "Send to "Webhook Name" 4. Your note's content, frontmatter, and attachments will be sent #### Selected Text 1. Select text in your note 2. Open command palette 3. Choose "Send Selection to "Webhook Name" (not available in preview mode) 4. The selected text will be sent and any response will be inserted after the selection ### Response Handling You can configure how responses from the webhook are handled: - **Append**: Add the response at the end of your note - **New Note**: Create a new note with versioning (v1, v2, etc.) - **Overwrite**: Replace the current note's content with the response - **None**: Don't save the response The handling mode can be set per webhook, with an option to ask every time. ### YAML Frontmatter Support The plugin automatically parses YAML frontmatter and includes it in the Webhook payload. Example note: ```yaml --- title: My Note tags: [Webhook, automation] category: tech exclude-attachment: attachment1.mp3 # Exclude a single attachment # OR exclude multiple attachments: exclude-attachment: - image1.png - document.pdf --- Your note content here... ![attachment.png] ``` Will be sent as: ```json { "title": "My Note", "tags": ["Webhook", "automation"], "category": "tech", "content": "Your note content here...\n\n![attachment.png]", "filename": "note.md", "timestamp": 1234567890, "attachments": [ { "name": "attachment.png", "type": "png", "size": 12345, "data": "base64_encoded_data..." } ] } ``` ### Inline Fields Support In addition to YAML frontmatter, you can use inline fields that will be included in the webhook payload: ```md title:: My Document status:: draft tags:: [research, notes] Your content here... ``` These fields will be automatically extracted and added to the payload when inline field processing is enabled for the Webhook. ### Attachment Support The plugin automatically: - Detects attachments referenced in your notes using the `![[filename]]` syntax - Reads the attachment files - Converts them to Base64 - Includes them in the Webhook payload - Supports images and other file types - Allows excluding specific attachments via YAML frontmatter For Webhooks where attachments are not necessary or might exceed the endpoint's file size limits, you can enable the "Exclude Attachments" option in the Webhook settings. All attachments will be omitted from requests to this endpoint. ### Context Notes Context notes enable you to create reusable content blocks that can be seamlessly integrated into your Webhook requests. This feature is particularly helpful for leveraging prompt templates stored in your Obsidian vault when interacting with AI models through Webhook data. Example: To use context notes for AI prompting, create a note with the following structure: ``` --- post-webhook: true # Required to make this note available as a context block for Webhook payloads. --- --user # can be any keyword Your user prompt to send to an AI model. --assistant # can be any keyword Tell the model to adopt a specific tone or personality. --system # can be any keyword Set the model's behavior. ``` 1. Enable "Include Context Note" for your Webhook 2. When sending content, you'll be prompted to select a context note 3. The parameters (separated by --keyword) will be included in the Webhook payload ## References - Download: https://obsidian.md/plugins?id=post-webhook - Source code: https://github.com/Masterb1234/obsidian-post-webhook