Vault Capture V2 Plan
Vault Capture V2 — Simplified Workflow Plan
Section titled “Vault Capture V2 — Simplified Workflow Plan”Context
Section titled “Context”Read the Deployment Log first for full system state:
03-resources/agent-system/docs/Deployment-Log.md
Problem
Section titled “Problem”The current Vault Capture workflow routes Slack messages through CrewAI (a separate Docker container running Python/FastAPI). This takes ~2.5 minutes per execution, required 5 bug fixes to get working (monkey-patched litellm, model ID corrections, assistant prefill workarounds), and has 6 failure points in the chain.
Solution
Section titled “Solution”Replace the CrewAI call with n8n’s built-in AI Agent node, which can call Claude directly via OpenRouter. No Python, no extra container, no monkey-patches. Expected execution time: ~5-10 seconds.
VPS Access
Section titled “VPS Access”- SSH:
ssh patrick@167.235.236.99 - n8n UI: https://n8n.baseworks.com
- n8n owner login: agents@baseworks.com (password in Patrick’s password manager)
Current System State
Section titled “Current System State”- n8n version: 2.8.3
- Docker containers: baseworks-n8n, baseworks-postgres, baseworks-crewai
- OpenRouter API key: already in
.envon VPS - Existing Vault Capture workflow ID:
A0hTmPJN38HRe3Ch(ACTIVE) - Slack Event Router workflow ID:
fcsJFL21APR2uyV9(ACTIVE) - Slack channel
#vault-inboxID:C0AG0MWBP5L NODES_EXCLUDE=[n8n-nodes-base.localFileTrigger]already set (Execute Command node enabled)- Vault path on VPS:
/opt/baseworks-vault - Vault ownership:
chown -R 1000:1000 /opt/baseworks-vault(already done)
What to Build
Section titled “What to Build”New Workflow: “Vault Capture v2”
Section titled “New Workflow: “Vault Capture v2””Build this as a NEW workflow (don’t modify the existing one yet). Keep both active during testing, then deactivate the old one once v2 is confirmed working.
Workflow Structure (5 nodes)
Section titled “Workflow Structure (5 nodes)”1. Webhook Trigger - Method: POST - Path: /vault-capture-v2 - (The Slack Event Router will be updated to point here after testing)
2. Extract Message (Set node) - Input: {{ $json.body.message }} (from the existing Vault Capture workflow's format) - Strip Slack mrkdwn formatting: remove _, *, ~ characters - Extract sender: {{ $json.body.sender }} - Output fields: cleaned_message, sender, timestamp
3. AI Agent Node (Tools Agent) - Chat Model: OpenRouter Chat Model sub-node - Credential: OpenRouter API key (create new credential in n8n) - Model: anthropic/claude-sonnet-4.6 - Temperature: 0.3 (low for consistent classification) - Max Tokens: 1024 - No memory needed (stateless, one-shot classification) - No tools needed (all context is in the system prompt) - System Prompt: (see below) - User Prompt: "Classify and file this message from {{ $json.sender }}:\n\n{{ $json.cleaned_message }}"
4. Post Filing Suggestion to Slack (Slack node) - Channel: #vault-inbox (C0AG0MWBP5L) - Credential: existing "Slack account" credential - Message: Filing suggestion with folder, filename, reason, and tags
5. Write File & Git Push (Execute Command node) - Write the markdown file with frontmatter to the chosen folder - Git add, commit, pushSystem Prompt for the AI Agent Node
Section titled “System Prompt for the AI Agent Node”You are the Baseworks vault filing assistant. Your job is to classify an incoming message and determine where it should be saved in the Obsidian vault.
## Vault Structure (PARA method)
00-inbox/ — Quick capture, unsorted notes (DEFAULT if unclear)01-projects/ — Active projects with defined outcomes02-areas/ communications/ — Response policies, email templates, FluentCRM community-forums-groups/ — Forum posts, DMs, group feed responses educational-programs/ — Study groups, labs, events method-admin/ — Internal methodology docs, science, taxonomy practice-platform/ — Online platform content primer/ — 10-segment course (transcripts, summaries) website/ — Blog articles, main pages collaborations/ — External partnerships03-resources/ — Reference material, guides, agent system04-archive/ — Completed/inactive items
## Filing Rules
- Use kebab-case filenames: YYYY-MM-DD-descriptive-slug.md- Forum posts or community discussion notes go in: 02-areas/community-forums-groups/- Method/technique/movement notes go in: 02-areas/method-admin/- Program/course/event content goes in: 02-areas/educational-programs/- Communication templates or policies go in: 02-areas/communications/- Website content ideas go in: 02-areas/website/- External partnership notes go in: 02-areas/collaborations/- Platform/tech notes go in: 02-areas/practice-platform/- Reference material, guides, how-tos go in: 03-resources/- If uncertain or it's a quick thought, file to 00-inbox/ (safe default)- Always include frontmatter: created (today's date), updated (today's date), tags (relevant keywords)
## Your Response
Return ONLY valid JSON, no markdown fencing, no explanation:{"folder":"02-areas/method-admin/","filename":"2026-02-21-descriptive-slug.md","tags":["tag1","tag2"],"filing_reason":"One sentence explaining why this folder","title":"Human-Readable Note Title"}Write File & Git Push Command
Section titled “Write File & Git Push Command”The Execute Command node should run something like:
FOLDER="{{ $json.output.folder }}"FILENAME="{{ $json.output.filename }}"TITLE="{{ $json.output.title }}"TAGS="{{ $json.output.tags }}"MESSAGE="{{ $json.cleaned_message }}"DATE=$(date +%Y-%m-%d)
mkdir -p /opt/baseworks-vault/$FOLDER
cat > /opt/baseworks-vault/$FOLDER/$FILENAME << 'VAULTEOF'---created: $DATEupdated: $DATEtags: [$TAGS]source: slack-capture---
# $TITLE
$MESSAGEVAULTEOF
cd /opt/baseworks-vault && git add "$FOLDER/$FILENAME" && git commit -m "vault-capture: $FILENAME" && git pushNote: The exact expression syntax for extracting the AI Agent’s JSON response will need to be worked out in the n8n UI. The AI Agent node returns its output in {{ $json.output }} or {{ $json.text }} depending on configuration. Parse the JSON response to extract folder, filename, tags, etc.
Important: Slack Event Router Update
Section titled “Important: Slack Event Router Update”After testing v2 with manual webhook calls, update the Slack Event Router workflow (fcsJFL21APR2uyV9) to route #vault-inbox messages to the new webhook URL (/webhook/vault-capture-v2) instead of the old one.
Testing Plan
Section titled “Testing Plan”- Create the OpenRouter credential in n8n (Settings → Credentials → Add → OpenRouter)
- Build the workflow in n8n UI
- Test with manual webhook call (curl or n8n test execution)
- Compare output with the existing Vault Capture workflow
- Test from Slack by updating the Event Router to point to v2
- Verify file appears in
/opt/baseworks-vault/and is pushed to GitHub - If everything works: deactivate old Vault Capture workflow (
A0hTmPJN38HRe3Ch)
What NOT to Do Yet
Section titled “What NOT to Do Yet”- Don’t remove the CrewAI container — it may still be needed for Content Creation and Forum Response workflows
- Don’t modify the existing Vault Capture workflow — build v2 as a separate workflow
- Don’t deactivate the Slack Event Router — it serves multiple workflows
n8n OpenRouter Credential Setup
Section titled “n8n OpenRouter Credential Setup”Since n8n 1.78+ (your version 2.8.3 qualifies), there’s a native OpenRouter Chat Model sub-node:
- In n8n UI: Settings → Credentials → Add Credential
- Search for “OpenRouter”
- Paste the OpenRouter API key (same one already in the VPS
.envfile — retrieve it withgrep OPENROUTER /opt/baseworks-vault/03-resources/agent-system/docker/.envon the VPS) - Save
Then in the AI Agent node, add the OpenRouter Chat Model sub-node and select anthropic/claude-sonnet-4.6 from the model dropdown.
Known Gotcha
Section titled “Known Gotcha”There’s a reported issue (Jan 2026) where the n8n AI Agent node fails when tools are attached to OpenRouter in some configurations. Since this workflow doesn’t need any tools (all context is in the system prompt), this shouldn’t affect us. But if issues arise, the fallback is to use the OpenAI Chat Model sub-node with a custom base URL (https://openrouter.ai/api/v1) and set the model as an expression.