{
  "name": "Create a Slack AI chatbot with threads & thinking UI using OpenRouter & Postgres",
  "nodes": [
    {
      "id": "7436eb20-9360-4219-8c2b-8b56eb3843ec",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -80,
        160
      ]
    },
    {
      "id": "9601c9d7-41c0-44da-8a9c-97956711bd07",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -80,
        -20
      ]
    },
    {
      "id": "23df5bee-5095-4c8d-9f78-c62119734332",
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -60,
        440
      ]
    },
    {
      "id": "0442b3d9-2149-49b6-9cc8-af92d1ed036c",
      "name": "On Message Received",
      "type": "n8n-nodes-base.slackTrigger",
      "position": [
        -860,
        80
      ]
    },
    {
      "id": "d9efc43e-b1c1-48c0-8c68-42304c752645",
      "name": "Check If User",
      "type": "n8n-nodes-base.if",
      "position": [
        -480,
        80
      ]
    },
    {
      "id": "99ccfdff-4fd1-4cff-99e0-7a2620735ff8",
      "name": "Set Thinking Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        -400
      ]
    },
    {
      "id": "f1bbe14d-9274-4e7a-804a-dd65b6efca24",
      "name": "Send Reply",
      "type": "n8n-nodes-base.slack",
      "position": [
        560,
        60
      ]
    },
    {
      "id": "484b674d-be92-49a9-9a0d-a4f9747dc5bb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -40
      ],
      "parameters": {
        "width": 300,
        "height": 280,
        "content": "## Listen for a DM\n\n**IMPORTANT**: Enter your Slack app's ID in the \"Channel to Watch\" field."
      }
    },
    {
      "id": "fdd9665d-b7c1-4a1d-b84d-6113ffb88a55",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -40
      ],
      "parameters": {
        "width": 300,
        "height": 280,
        "content": "## Filter out noise\n\nWe only care about user messages."
      }
    },
    {
      "id": "c7cc385d-189f-4fb0-9901-8acbd4696e0c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -560
      ],
      "parameters": {
        "width": 360,
        "height": 360,
        "content": "## Activate loading UI\n\nThis HTTP POST request will trigger the \"three dots\" thinking UI in the message thread. Slack automatically removes this UI when our app responds."
      }
    },
    {
      "id": "07c2ebc0-bc20-4584-bf87-31788aa1646d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -140
      ],
      "parameters": {
        "width": 440,
        "height": 460,
        "content": "## Customize your agent here\n\nThe agent is the brains of your chatbot. Customize the prompts and tooling however you need."
      }
    },
    {
      "id": "242fa108-e421-4428-814d-b4ebf967f12d",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        60,
        160
      ]
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If User": {
      "main": [
        [
          {
            "node": "Set Thinking Status",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On Message Received": {
      "main": [
        [
          {
            "node": "Check If User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}