64 lines
2.0 KiB
JSON
64 lines
2.0 KiB
JSON
{
|
|
"name": "robeing-skill-slack-send-message-bridge",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"httpMethod": "POST",
|
|
"path": "skills/slack/send",
|
|
"responseMode": "responseNode",
|
|
"options": {}
|
|
},
|
|
"id": "skill-slack-001",
|
|
"name": "Webhook In",
|
|
"type": "n8n-nodes-base.webhook",
|
|
"typeVersion": 1,
|
|
"position": [220, 220]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"jsCode": "const body = $json.body || {};\nreturn {\n channel: body.channel,\n text: body.text,\n thread_ts: body.thread_ts || '',\n blocks: body.blocks || []\n};"
|
|
},
|
|
"id": "skill-slack-002",
|
|
"name": "Normalize Payload",
|
|
"type": "n8n-nodes-base.code",
|
|
"typeVersion": 2,
|
|
"position": [460, 220]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"resource": "message",
|
|
"operation": "post",
|
|
"channel": "={{ $json.channel }}",
|
|
"text": "={{ $json.text }}",
|
|
"otherOptions": {
|
|
"threadTs": "={{ $json.thread_ts }}"
|
|
}
|
|
},
|
|
"id": "skill-slack-003",
|
|
"name": "Post to Slack",
|
|
"type": "n8n-nodes-base.slack",
|
|
"typeVersion": 2,
|
|
"position": [710, 220]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"respondWith": "json",
|
|
"responseBody": "={\"success\":true,\"channel\":\"{{$('Normalize Payload').item.json.channel}}\",\"thread_ts\":\"{{$('Normalize Payload').item.json.thread_ts}}\"}",
|
|
"options": {}
|
|
},
|
|
"id": "skill-slack-004",
|
|
"name": "Return Response",
|
|
"type": "n8n-nodes-base.respondToWebhook",
|
|
"typeVersion": 1,
|
|
"position": [940, 220]
|
|
}
|
|
],
|
|
"connections": {
|
|
"Webhook In": { "main": [[{ "node": "Normalize Payload", "type": "main", "index": 0 }]] },
|
|
"Normalize Payload": { "main": [[{ "node": "Post to Slack", "type": "main", "index": 0 }]] },
|
|
"Post to Slack": { "main": [[{ "node": "Return Response", "type": "main", "index": 0 }]] }
|
|
},
|
|
"pinData": {},
|
|
"meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-skills" }
|
|
}
|