n8n Integration

Add encrypted persistent memory to your n8n workflows using HTTP Request nodes and the Synapse Layer REST API. No custom code required — just configure and connect.

Overview

n8n is a workflow automation platform that supports HTTP requests natively. By using n8n's HTTP Request node with the Synapse Layer REST API, you can add persistent, encrypted memory to any automation workflow — CRM enrichment, support ticket context, lead scoring with memory, and more.

All data passes through the Cognitive Security Pipeline: PII sanitization, intent classification, and AES-256-GCM encryption at rest.

Store Memory Node

Configure an HTTP Request node to store memories:

MethodPOST
URLhttps://your-forge-url/api/v1/memory/commit
Headers
x-connect-token: YOUR_TOKEN
Content-Type: application/json

Request body:

json
{
  "content": "{{ $json.message }}",
  "agentId": "n8n-workflow",
  "metadata": {
    "source": "n8n",
    "workflow": "{{ $workflow.name }}"
  }
}

Note

Use n8n expressions ({{ $json.field }}) to dynamically inject data from previous nodes into the memory content.

Recall Memory Node

Configure an HTTP Request node to recall memories:

MethodPOST
URLhttps://your-forge-url/api/v1/sdk/recall

Request body:

json
{
  "query": "{{ $json.searchQuery }}",
  "agentId": "n8n-workflow",
  "topK": 5
}

Workflow Pattern

A typical n8n workflow with Synapse Layer memory:

TriggerRecall MemoryProcessStore MemoryOutput

The workflow recalls relevant context before processing, then stores new insights for future runs. Over time, the workflow builds up a persistent knowledge base that improves with each execution.

Authentication

Store your Synapse Layer connect token as an n8n credential:

  1. Go to Credentials in your n8n instance
  2. Create a new Header Auth credential
  3. Set the header name to x-connect-token
  4. Set the value to your connect token
  5. Reference this credential in all HTTP Request nodes

Warning

Never hardcode tokens in workflow JSON. Use n8n credentials for secure token management.