{
  "updatedAt": "2025-12-21T05:35:27.637Z",
  "createdAt": "2025-12-21T02:49:24.011Z",
  "id": "GeIXWnB2fjaNYiPL",
  "name": "Memory Service Integration",
  "description": null,
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {},
      "id": "start-node",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        304
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "agent-created",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Agent Created Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        240,
        480
      ]
    },
    {
      "parameters": {
        "url": "http://memory-service:8765/api/memory/events",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"event_type\": \"agent_created\",\n  \"source\": \"n8n\",\n  \"data\": {\n    \"name\": \"\",\n    \"description\": \"\",\n    \"workflow_id\": \"\",\n    \"created_at\": \"2025-12-21T04:22:39.137Z\"\n  }\n}",
        "options": {},
        "requestMethod": "POST"
      },
      "id": "post-to-memory",
      "name": "Post to Memory API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        464,
        480
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"success\": true, \"message\": \"Agent logged to memory service\" } }}",
        "options": {}
      },
      "id": "success-response",
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        688,
        480
      ]
    },
    {
      "parameters": {
        "url": "http://memory-service:8765/api/memory",
        "options": {},
        "requestMethod": "GET"
      },
      "id": "read-memory",
      "name": "Read Current Memory",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        464,
        304
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.data.tool_status.memory_service }}",
              "operation": "contains",
              "value2": "working"
            }
          ]
        }
      },
      "id": "check-memory-status",
      "name": "Memory Service Online?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        688,
        304
      ]
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Read Current Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent Created Webhook": {
      "main": [
        [
          {
            "node": "Post to Memory API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post to Memory API": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Current Memory": {
      "main": [
        [
          {
            "node": "Memory Service Online?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "staticData": null,
  "meta": null,
  "versionId": "f0fc0ec1-4790-4a2b-b7a5-3c540f97718c",
  "activeVersionId": "fdcc9a65-f65d-40d2-b101-f74fdcc489e0",
  "versionCounter": 5,
  "triggerCount": 1,
  "shared": [
    {
      "updatedAt": "2025-12-21T02:49:24.011Z",
      "createdAt": "2025-12-21T02:49:24.011Z",
      "role": "workflow:owner",
      "workflowId": "GeIXWnB2fjaNYiPL",
      "projectId": "004oYFZXoGrpEn24",
      "project": {
        "updatedAt": "2025-12-21T02:44:38.397Z",
        "createdAt": "2025-12-21T02:33:34.348Z",
        "id": "004oYFZXoGrpEn24",
        "name": "Michael Bermingham <michael@bermech.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "projectRelations": [
          {
            "updatedAt": "2025-12-21T02:33:34.348Z",
            "createdAt": "2025-12-21T02:33:34.348Z",
            "userId": "fc864aff-cad8-4db3-86c1-b24b3ee64c17",
            "projectId": "004oYFZXoGrpEn24",
            "user": {
              "updatedAt": "2025-12-21T03:55:22.239Z",
              "createdAt": "2025-12-21T02:33:32.491Z",
              "id": "fc864aff-cad8-4db3-86c1-b24b3ee64c17",
              "email": "michael@bermech.com",
              "firstName": "Michael",
              "lastName": "Bermingham",
              "personalizationAnswers": {
                "version": "v4",
                "personalization_survey_submitted_at": "2025-12-21T02:34:44.733Z",
                "personalization_survey_n8n_version": "2.0.3"
              },
              "settings": {
                "userActivated": false
              },
              "disabled": false,
              "mfaEnabled": false,
              "lastActiveAt": "2025-12-21",
              "isPending": false
            }
          }
        ]
      }
    }
  ],
  "tags": [],
  "activeVersion": {
    "updatedAt": "2025-12-21T02:49:24.02Z",
    "createdAt": "2025-12-21T02:49:24.02Z",
    "versionId": "fdcc9a65-f65d-40d2-b101-f74fdcc489e0",
    "workflowId": "GeIXWnB2fjaNYiPL",
    "nodes": [
      {
        "parameters": {},
        "id": "start-node",
        "name": "When clicking 'Test workflow'",
        "type": "n8n-nodes-base.manualTrigger",
        "typeVersion": 1,
        "position": [
          240,
          300
        ]
      },
      {
        "parameters": {
          "httpMethod": "POST",
          "path": "agent-created",
          "responseMode": "responseNode",
          "options": {}
        },
        "id": "webhook-trigger",
        "name": "Agent Created Webhook",
        "type": "n8n-nodes-base.webhook",
        "typeVersion": 1.1,
        "position": [
          240,
          480
        ],
        "webhookId": "agent-created-hook"
      },
      {
        "parameters": {
          "url": "http://memory-service:8765/api/memory/events",
          "authentication": "none",
          "requestMethod": "POST",
          "sendBody": true,
          "specifyBody": "json",
          "jsonBody": "={\n  \"event_type\": \"agent_created\",\n  \"source\": \"n8n\",\n  \"data\": {\n    \"name\": \"{{ $json.agent_name }}\",\n    \"description\": \"{{ $json.description }}\",\n    \"workflow_id\": \"{{ $json.workflow_id }}\",\n    \"created_at\": \"{{ $now.toISO() }}\"\n  }\n}",
          "options": {}
        },
        "id": "post-to-memory",
        "name": "Post to Memory API",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.1,
        "position": [
          460,
          480
        ]
      },
      {
        "parameters": {
          "respondWith": "json",
          "responseBody": "={{ { \"success\": true, \"message\": \"Agent logged to memory service\" } }}"
        },
        "id": "success-response",
        "name": "Success Response",
        "type": "n8n-nodes-base.respondToWebhook",
        "typeVersion": 1,
        "position": [
          680,
          480
        ]
      },
      {
        "parameters": {
          "url": "http://memory-service:8765/api/memory",
          "authentication": "none",
          "requestMethod": "GET",
          "options": {}
        },
        "id": "read-memory",
        "name": "Read Current Memory",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.1,
        "position": [
          460,
          300
        ]
      },
      {
        "parameters": {
          "conditions": {
            "string": [
              {
                "value1": "={{ $json.data.tool_status.memory_service }}",
                "operation": "contains",
                "value2": "working"
              }
            ]
          }
        },
        "id": "check-memory-status",
        "name": "Memory Service Online?",
        "type": "n8n-nodes-base.if",
        "typeVersion": 1,
        "position": [
          680,
          300
        ]
      }
    ],
    "connections": {
      "When clicking 'Test workflow'": {
        "main": [
          [
            {
              "node": "Read Current Memory",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Agent Created Webhook": {
        "main": [
          [
            {
              "node": "Post to Memory API",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Post to Memory API": {
        "main": [
          [
            {
              "node": "Success Response",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Read Current Memory": {
        "main": [
          [
            {
              "node": "Memory Service Online?",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    },
    "authors": "Michael Bermingham",
    "name": null,
    "description": null,
    "workflowPublishHistory": [
      {
        "createdAt": "2025-12-21T02:49:24.17Z",
        "id": 1,
        "workflowId": "GeIXWnB2fjaNYiPL",
        "versionId": "fdcc9a65-f65d-40d2-b101-f74fdcc489e0",
        "event": "activated",
        "userId": "fc864aff-cad8-4db3-86c1-b24b3ee64c17"
      }
    ]
  }
}