{
  "name": "SynapsAI — BSP pipeline (inbound → agent → BSP send)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "bsp-inbound",
        "authentication": "headerAuth",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "5c5d1be0-5fc1-5bfb-aa1c-646808fc4cc9",
      "name": "BSP inbound",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "20af4f77-d067-5434-b119-0997c1210b90"
    },
    {
      "parameters": {
        "resource": "agent",
        "operation": "ask",
        "agentKey": "",
        "externalUserId": "={{ $json.body.from }}",
        "text": "={{ $json.body.text }}",
        "waitForReply": true,
        "waitMinutes": 5,
        "options": {
          "idempotencyKey": "={{ $json.body.messageId }}",
          "phone": "={{ $json.body.from }}"
        }
      },
      "id": "ee9ba355-ed75-540a-90cd-5b1bfc84dce6",
      "name": "Ask SynapsAI",
      "type": "n8n-nodes-synapsai.synapsAi",
      "typeVersion": 1,
      "position": [
        260,
        0
      ],
      "credentials": {
        "synapsAiApi": {
          "id": "",
          "name": "SynapsAI API"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.your-bsp.example/v1/messages",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ to: $('BSP inbound').item.json.body.from, text: $json.text }) }}",
        "options": {}
      },
      "id": "3c0c29c1-439d-5fa0-8087-be85d39e54ac",
      "name": "Send through BSP",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        0
      ]
    }
  ],
  "connections": {
    "BSP inbound": {
      "main": [
        [
          {
            "node": "Ask SynapsAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask SynapsAI": {
      "main": [
        [
          {
            "node": "Send through BSP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "description": "Your messaging provider posts each inbound message to this workflow; SynapsAI answers inside it and the reply is sent back through the provider.",
    "requires": "n8n-nodes-synapsai >= 0.1.0; SynapsAI GROWTH+"
  },
  "pinData": {},
  "tags": []
}