Connect
Use self-hosted n8n on the same workstation as your Claude-Mem worker. This example targets loopback access, not n8n Cloud or a separate container’slocalhost.
Import examples/n8n/memory.workflow.json. The file has no workflow ID, so it cannot overwrite an unrelated workflow by a fixed ID. Reuse the imported workflow for later runs instead of importing duplicate copies. It is inactive and has only a manual trigger.
Edit the Configure node before running:
baseUrlis your actual worker origin, including its port. The included37700is a placeholder, not port discovery. To find the port, readCLAUDE_MEM_WORKER_PORTin~/.claude-mem/settings.json. If it isn’t set, the worker uses its per-user default,37700 + (your user ID % 100), whichecho $((37700 + $(id -u) % 100))prints on macOS and Linux. Check it withcurl -s http://127.0.0.1:PORT/api/health.projectis the exact Claude-Mem project name you want to save and read.text,titleandquerydescribe the explicitly requested note and lookup.
status is success and that Retrieve contains the expected ID, project and text. The n8n CLI can exit zero after a workflow error, so its exit code alone does not establish success.
Behavior and data flow
Save sendstext, title and project to /api/memory/save. Confirm save requires the worker’s success: true response. An unconfirmed save goes to Stop And Error before any recall request. Search narrows results to the configured project. Retrieve fetches the ID from the confirmed save receipt with the same project filter.
Each HTTP request has a five-second timeout. The workflow has a 30-second execution limit, no retry setting and no automatic trigger. Running it again is another explicit save request. To recall an existing note without saving again, adapt the workflow to use that existing ID.
The configured note is saved through the worker’s existing privacy and storage rules. Saved content follows your existing synchronization settings. n8n also retains execution data according to your instance settings, so recalled memory can appear in its execution history. The workflow makes no model-provider calls.
Verified walkthrough
Verified with n8n 2.47.4 and Node 24.15.0 on macOS. Use a real Node 24 binary for this tested setup; checknode --version. No n8n account or paid model is required for the isolated CLI walkthrough.
After building Claude-Mem, set NODE_BIN to Node 24, N8N_CLI to the installed n8n/bin/n8n script and put Bun on PATH, then run:
Troubleshooting
- Save fails with a connection error, or times out after five seconds. The worker isn’t running, or
baseUrlhas the wrong port. Check it withcurl -s http://127.0.0.1:PORT/api/health. If n8n runs in a container,127.0.0.1is the container itself, not your workstation. - The run stops with “The worker did not confirm a saved memory.” The worker answered without
success: true, so nothing was searched or retrieved. Open the Save node’s output in the execution to read the worker’s response.

