{
  "name": "QAIP Slack Completions",
  "nodes": [
    {
      "parameters": {
        "trigger": [
          "app_mention"
        ],
        "watchWorkspace": true,
        "options": {}
      },
      "type": "n8n-nodes-base.slackTrigger",
      "typeVersion": 1,
      "position": [
        -224,
        -32
      ],
      "id": "19effcc6-72f4-4814-8805-82b0a7dc0196",
      "name": "Slack Trigger",
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "messages": {
          "message": [
            {
              "content": "={{ $json.text }}"
            }
          ]
        },
        "options": {},
        "requestOptions": {}
      },
      "type": "CUSTOM.qaip",
      "typeVersion": 1,
      "position": [
        -32,
        -32
      ],
      "id": "448a42aa-379a-4db7-a813-ecf9b3935044",
      "name": "Create a completion",
      "credentials": {
        "qaipApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "={{ $('Slack Trigger').item.json.channel }}",
          "mode": "id"
        },
        "messageType": "block",
        "blocksUi": "={{ JSON.stringify(\n  {\n    thread_ts: $('Slack Trigger').item.json.ts,\n    text: $json.choices[0].message.content,\n    blocks: [{\n      type: 'markdown',\n      text: $json.choices[0].message.content\n    }]\n  }, null, 2)\n}}",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        176,
        -32
      ],
      "id": "13368c21-5702-4c57-8616-b1557537ef15",
      "name": "Send a message",
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Slack Trigger": {
      "main": [
        [
          {
            "node": "Create a completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a completion": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "139282c6-f7f3-44c5-ba40-12fba46bf152",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "BfrN9BDK7YTkUO18",
  "tags": []
}