first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,14 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
};
describe('Test SlackV2, channel => append', () => {
nock('https://slack.com').post('/api/conversations.archive').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['archive.workflow.json'],
});
});
@@ -0,0 +1,89 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "channel",
"operation": "archive",
"channelId": {
"__rl": true,
"value": "C084ZURRQPL",
"mode": "list",
"cachedResultName": "test-001"
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"ok": true
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "13de7d28-7e93-4602-a4d1-5389e8ccc4dc",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,53 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
channel: {
id: 'C085WNEHP4Y',
name: 'test-003',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_private: false,
created: 1734325731,
is_archived: false,
is_general: false,
unlinked: 0,
name_normalized: 'test-003',
is_shared: false,
is_org_shared: false,
is_pending_ext_shared: false,
pending_shared: [],
context_team_id: 'T0364MSFHV2',
updated: 1734325731240,
parent_conversation: null,
creator: 'U0362BXQYJW',
is_ext_shared: false,
shared_team_ids: ['T0364MSFHV2'],
pending_connected_team_ids: [],
is_member: true,
last_read: '0000000000.000000',
topic: {
value: '',
creator: '',
last_set: 0,
},
purpose: {
value: '',
creator: '',
last_set: 0,
},
previous_names: [],
priority: 0,
},
};
describe('Test SlackV2, channel => create', () => {
nock('https://slack.com').post('/api/conversations.create').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['create.workflow.json'],
});
});
@@ -0,0 +1,119 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "channel",
"channelId": "test-003"
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"id": "C085WNEHP4Y",
"name": "test-003",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_private": false,
"created": 1734325731,
"is_archived": false,
"is_general": false,
"unlinked": 0,
"name_normalized": "test-003",
"is_shared": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"pending_shared": [],
"context_team_id": "T0364MSFHV2",
"updated": 1734325731240,
"parent_conversation": null,
"creator": "U0362BXQYJW",
"is_ext_shared": false,
"shared_team_ids": ["T0364MSFHV2"],
"pending_connected_team_ids": [],
"is_member": true,
"last_read": "0000000000.000000",
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
},
"previous_names": [],
"priority": 0
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "297d0c4b-32e6-4b08-8818-af5e64762521",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,54 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
channel: {
id: 'C085WNEHP4Y',
name: 'test-003',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_private: false,
created: 1734325731,
is_archived: false,
is_general: false,
unlinked: 0,
name_normalized: 'test-003',
is_shared: false,
is_org_shared: false,
is_pending_ext_shared: false,
pending_shared: [],
context_team_id: 'T0364MSFHV2',
updated: 1734325731240,
parent_conversation: null,
creator: 'U0362BXQYJW',
is_ext_shared: false,
shared_team_ids: ['T0364MSFHV2'],
pending_connected_team_ids: [],
is_member: true,
last_read: '0000000000.000000',
topic: {
value: '',
creator: '',
last_set: 0,
},
purpose: {
value: '',
creator: '',
last_set: 0,
},
previous_names: [],
},
};
describe('Test SlackV2, channel => get', () => {
nock('https://slack.com')
.post('/api/conversations.info?channel=C085WNEHP4Y')
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['get.workflow.json'],
});
});
@@ -0,0 +1,127 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "channel",
"operation": "get",
"channelId": {
"__rl": true,
"value": "C085WNEHP4Y",
"mode": "list",
"cachedResultName": "test-003"
},
"options": {
"includeNumMembers": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"id": "C085WNEHP4Y",
"name": "test-003",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_private": false,
"created": 1734325731,
"is_archived": false,
"is_general": false,
"unlinked": 0,
"name_normalized": "test-003",
"is_shared": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"pending_shared": [],
"context_team_id": "T0364MSFHV2",
"updated": 1734325731240,
"parent_conversation": null,
"creator": "U0362BXQYJW",
"is_ext_shared": false,
"shared_team_ids": ["T0364MSFHV2"],
"pending_connected_team_ids": [],
"is_member": true,
"last_read": "0000000000.000000",
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
},
"previous_names": []
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "753332eb-25d1-443a-acef-92993e89751a",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,119 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
channels: [
{
id: 'C0362BX17TM',
name: 'general',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_private: false,
created: 1646724991,
is_archived: false,
is_general: true,
unlinked: 0,
name_normalized: 'general',
is_shared: false,
is_org_shared: false,
is_pending_ext_shared: false,
pending_shared: [],
context_team_id: 'T0364MSFHV2',
updated: 1734075560630,
parent_conversation: null,
creator: 'U0362BXQYJW',
is_ext_shared: false,
shared_team_ids: ['T0364MSFHV2'],
pending_connected_team_ids: [],
is_member: true,
topic: {
value: '',
creator: '',
last_set: 0,
},
purpose: {
value:
'This is the one channel that will always include everyone. Its a great spot for announcements and team-wide conversations.',
creator: 'U0362BXQYJW',
last_set: 1646724991,
},
properties: {
use_case: 'welcome',
},
previous_names: [],
num_members: 1,
},
{
id: 'C0362BXRZQA',
name: 'random',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_private: false,
created: 1646724991,
is_archived: false,
is_general: false,
unlinked: 0,
name_normalized: 'random',
is_shared: false,
is_org_shared: false,
is_pending_ext_shared: false,
pending_shared: [],
context_team_id: 'T0364MSFHV2',
updated: 1725415586388,
parent_conversation: null,
creator: 'U0362BXQYJW',
is_ext_shared: false,
shared_team_ids: ['T0364MSFHV2'],
pending_connected_team_ids: [],
is_member: true,
topic: {
value: '',
creator: '',
last_set: 0,
},
purpose: {
value:
'This channel is for... well, everything else. Its a place for team jokes, spur-of-the-moment ideas, and funny GIFs. Go wild!',
creator: 'U0362BXQYJW',
last_set: 1646724991,
},
properties: {
tabs: [
{
id: 'files',
label: '',
type: 'files',
},
],
tabz: [
{
type: 'files',
},
],
use_case: 'random',
},
previous_names: [],
num_members: 2,
},
],
response_metadata: {
next_cursor: 'dGVhbTpDMDM2MkMyM1RSOA==',
},
};
describe('Test SlackV2, channel => getAll', () => {
nock('https://slack.com')
.get(
'/api/conversations.list?types=public_channel%2Cprivate_channel%2Cim%2Cmpim&exclude_archived=true&limit=2',
)
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['getAll.workflow.json'],
});
});
@@ -0,0 +1,181 @@
{
"name": "slack new tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "channel",
"operation": "getAll",
"limit": 2,
"filters": {
"excludeArchived": true,
"types": ["public_channel", "private_channel", "im", "mpim"]
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"id": "C0362BX17TM",
"name": "general",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_private": false,
"created": 1646724991,
"is_archived": false,
"is_general": true,
"unlinked": 0,
"name_normalized": "general",
"is_shared": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"pending_shared": [],
"context_team_id": "T0364MSFHV2",
"updated": 1734075560630,
"parent_conversation": null,
"creator": "U0362BXQYJW",
"is_ext_shared": false,
"shared_team_ids": ["T0364MSFHV2"],
"pending_connected_team_ids": [],
"is_member": true,
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "This is the one channel that will always include everyone. Its a great spot for announcements and team-wide conversations.",
"creator": "U0362BXQYJW",
"last_set": 1646724991
},
"properties": {
"use_case": "welcome"
},
"previous_names": [],
"num_members": 1
}
},
{
"json": {
"id": "C0362BXRZQA",
"name": "random",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_private": false,
"created": 1646724991,
"is_archived": false,
"is_general": false,
"unlinked": 0,
"name_normalized": "random",
"is_shared": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"pending_shared": [],
"context_team_id": "T0364MSFHV2",
"updated": 1725415586388,
"parent_conversation": null,
"creator": "U0362BXQYJW",
"is_ext_shared": false,
"shared_team_ids": ["T0364MSFHV2"],
"pending_connected_team_ids": [],
"is_member": true,
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "This channel is for... well, everything else. Its a place for team jokes, spur-of-the-moment ideas, and funny GIFs. Go wild!",
"creator": "U0362BXQYJW",
"last_set": 1646724991
},
"properties": {
"tabs": [
{
"id": "files",
"label": "",
"type": "files"
}
],
"tabz": [
{
"type": "files"
}
],
"use_case": "random"
},
"previous_names": [],
"num_members": 2
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "f74e9c2c-83f4-4ef8-b436-704e1a27a9ef",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,176 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
messages: [
{
user: 'U0362BXQYJW',
type: 'message',
ts: '1734322597.935429',
bot_id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
team: 'T0364MSFHV2',
bot_profile: {
id: 'B0382SHFM46',
deleted: false,
name: 'blocks-test',
updated: 1648028754,
app_id: 'A037UTP0Z39',
icons: {
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
},
team_id: 'T0364MSFHV2',
},
blocks: [
{
type: 'rich_text',
block_id: 'piR',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'test message\n',
},
{
type: 'text',
text: 'Automated with this ',
style: {
italic: true,
},
},
{
type: 'link',
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
text: 'n8n workflow',
style: {
italic: true,
},
},
],
},
],
},
],
},
{
user: 'U0362BXQYJW',
type: 'message',
ts: '1734322341.161179',
bot_id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
team: 'T0364MSFHV2',
bot_profile: {
id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
name: 'blocks-test',
icons: {
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
},
deleted: false,
updated: 1648028754,
team_id: 'T0364MSFHV2',
},
blocks: [
{
type: 'rich_text',
block_id: '2BN',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'test message\n',
},
{
type: 'text',
text: 'Automated with this ',
style: {
italic: true,
},
},
{
type: 'link',
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
text: 'n8n workflow',
style: {
italic: true,
},
},
],
},
],
},
],
},
{
user: 'U0362BXQYJW',
type: 'message',
ts: '1734321960.507649',
edited: {
user: 'B0382SHFM46',
ts: '1734324905.000000',
},
bot_id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
text: 'updated message',
team: 'T0364MSFHV2',
bot_profile: {
id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
name: 'blocks-test',
icons: {
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
},
deleted: false,
updated: 1648028754,
team_id: 'T0364MSFHV2',
},
blocks: [
{
type: 'rich_text',
block_id: 'wR+',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'updated message',
},
],
},
],
},
],
},
{
subtype: 'channel_join',
user: 'U0362BXQYJW',
text: '<@U0362BXQYJW> has joined the channel',
type: 'message',
ts: '1734321942.689159',
},
],
};
describe('Test SlackV2, channel => history', () => {
nock('https://slack.com')
.get('/api/conversations.history?channel=C08514ZPKB8&inclusive=true&page=1&limit=100')
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['history.workflow.json'],
});
});
@@ -0,0 +1,254 @@
{
"name": "slack new tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "channel",
"operation": "history",
"channelId": {
"__rl": true,
"value": "C08514ZPKB8",
"mode": "list",
"cachedResultName": "test-002"
},
"returnAll": true,
"filters": {
"inclusive": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"user": "U0362BXQYJW",
"type": "message",
"ts": "1734322597.935429",
"bot_id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
"team": "T0364MSFHV2",
"bot_profile": {
"id": "B0382SHFM46",
"deleted": false,
"name": "blocks-test",
"updated": 1648028754,
"app_id": "A037UTP0Z39",
"icons": {
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
},
"team_id": "T0364MSFHV2"
},
"blocks": [
{
"type": "rich_text",
"block_id": "piR",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "test message\n"
},
{
"type": "text",
"text": "Automated with this ",
"style": {
"italic": true
}
},
{
"type": "link",
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
"text": "n8n workflow",
"style": {
"italic": true
}
}
]
}
]
}
]
}
},
{
"json": {
"user": "U0362BXQYJW",
"type": "message",
"ts": "1734322341.161179",
"bot_id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
"team": "T0364MSFHV2",
"bot_profile": {
"id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"name": "blocks-test",
"icons": {
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
},
"deleted": false,
"updated": 1648028754,
"team_id": "T0364MSFHV2"
},
"blocks": [
{
"type": "rich_text",
"block_id": "2BN",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "test message\n"
},
{
"type": "text",
"text": "Automated with this ",
"style": {
"italic": true
}
},
{
"type": "link",
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
"text": "n8n workflow",
"style": {
"italic": true
}
}
]
}
]
}
]
}
},
{
"json": {
"user": "U0362BXQYJW",
"type": "message",
"ts": "1734321960.507649",
"edited": {
"user": "B0382SHFM46",
"ts": "1734324905.000000"
},
"bot_id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"text": "updated message",
"team": "T0364MSFHV2",
"bot_profile": {
"id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"name": "blocks-test",
"icons": {
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
},
"deleted": false,
"updated": 1648028754,
"team_id": "T0364MSFHV2"
},
"blocks": [
{
"type": "rich_text",
"block_id": "wR+",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "updated message"
}
]
}
]
}
]
}
},
{
"json": {
"subtype": "channel_join",
"user": "U0362BXQYJW",
"text": "<@U0362BXQYJW> has joined the channel",
"type": "message",
"ts": "1734321942.689159"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "6b7102c7-d3c5-4b88-b67d-4ee6ae51b581",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,16 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
describe('Test SlackV2, file => upload', () => {
nock('https://slack.com')
.get('/api/files.getUploadURLExternal?filename=test%20_name.txt&length=25')
.reply(200, { ok: true, upload_url: 'https://slack.com/api/files.upload' })
.post('/api/files.upload', () => true)
.reply(200, { ok: true, file: { id: 'file_id' } })
.post('/api/files.completeUploadExternal')
.reply(200, { ok: true, files: [{ id: 'file_id' }] });
new NodeTestHarness().setupTests({
workflowFiles: ['upload.workflow.json'],
});
});
@@ -0,0 +1,147 @@
{
"name": "slack new tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [440, 360]
},
{
"parameters": {
"resource": "file",
"options": {
"fileName": "test _name.txt",
"initialComment": "test inline",
"threadTs": "1734322671.726339",
"title": "Test Title"
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1100, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1320, 360]
},
{
"parameters": {
"operation": "toJson",
"options": {}
},
"id": "76e317ed-7f2b-46b9-8c9b-f91a0b5d0fdd",
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [860, 360]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "a60db675-c351-49fc-bbad-555a70ee5d6d",
"name": "f1",
"value": "123",
"type": "string"
},
{
"id": "b96e7f11-a0ea-4a7f-b803-5ab3238af054",
"name": "f2",
"value": "456",
"type": "string"
}
]
},
"options": {}
},
"id": "773453a7-2bdc-4d50-a3e6-be5e1b86d820",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [660, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"id": "file_id"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Convert to File": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Convert to File",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "3a19732a-4416-487c-9f76-1291c610b5d1",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,16 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
channel: 'C08514ZPKB8',
message_timestamp: '1734322671.726339',
};
describe('Test SlackV2, message => delete', () => {
nock('https://slack.com').post('/api/chat.delete').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['delete.workflow.json'],
});
});
@@ -0,0 +1,92 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"operation": "delete",
"select": "channel",
"channelId": {
"__rl": true,
"value": "C08514ZPKB8",
"mode": "list",
"cachedResultName": "test-002"
},
"timestamp": 1734322671.726339
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"ok": true,
"channel": "C08514ZPKB8",
"message_timestamp": "1734322671.726339"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "cf10cd01-6650-48ca-b4a2-ec07be9d026c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,18 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
permalink: 'https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322671726339',
channel: 'C08514ZPKB8',
};
describe('Test SlackV2, message => getPermalink', () => {
nock('https://slack.com')
.get('/api/chat.getPermalink?channel=C08514ZPKB8&message_ts=1734322671.726339')
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['getPermalink.workflow.json'],
});
});
@@ -0,0 +1,91 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"operation": "getPermalink",
"channelId": {
"__rl": true,
"value": "C08514ZPKB8",
"mode": "list",
"cachedResultName": "test-002"
},
"timestamp": 1734322671.726339
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"ok": true,
"permalink": "https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322671726339",
"channel": "C08514ZPKB8"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "64c251c3-afe5-4636-a3fc-de769f8a9ea0",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,66 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
channel: 'C08514ZPKB8',
message: {
user: 'U0362BXQYJW',
type: 'message',
ts: '1734322671.726339',
bot_id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
text: 'test message',
team: 'T0364MSFHV2',
bot_profile: {
id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
name: 'blocks-test',
icons: {
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
},
deleted: false,
updated: 1648028754,
team_id: 'T0364MSFHV2',
},
blocks: [
{
type: 'rich_text',
block_id: 't02Ox',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'test message',
},
],
},
],
},
],
},
message_timestamp: '1734322671.726339',
};
describe('Test SlackV2, message => post', () => {
nock('https://slack.com')
.post('/api/chat.postMessage', {
channel: 'C08514ZPKB8',
icon_emoji: '😁',
includeLinkToWorkflow: false,
link_names: true,
mrkdwn: true,
text: 'test message',
unfurl_links: true,
unfurl_media: true,
})
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['post.workflow.json'],
});
});
@@ -0,0 +1,143 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"select": "channel",
"channelId": {
"__rl": true,
"value": "C08514ZPKB8",
"mode": "list",
"cachedResultName": "test-002"
},
"text": "test message",
"otherOptions": {
"includeLinkToWorkflow": false,
"botProfile": {
"imageValues": {
"profilePhotoType": "emoji",
"icon_emoji": "😁"
}
},
"link_names": true,
"mrkdwn": true,
"unfurl_links": true,
"unfurl_media": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"ok": true,
"channel": "C08514ZPKB8",
"message": {
"user": "U0362BXQYJW",
"type": "message",
"ts": "1734322671.726339",
"bot_id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"text": "test message",
"team": "T0364MSFHV2",
"bot_profile": {
"id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"name": "blocks-test",
"icons": {
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
},
"deleted": false,
"updated": 1648028754,
"team_id": "T0364MSFHV2"
},
"blocks": [
{
"type": "rich_text",
"block_id": "t02Ox",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "test message"
}
]
}
]
}
]
},
"message_timestamp": "1734322671.726339"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "2bc19572-58f0-4cb9-91c3-78b4b3e0cd95",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,210 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
query: 'test in:test-002',
messages: {
total: 3,
pagination: {
total_count: 3,
page: 1,
per_page: 2,
page_count: 1,
first: 1,
last: 3,
},
paging: {
count: 2,
total: 3,
page: 1,
pages: 1,
},
matches: [
{
iid: 'a60ff37e-5653-4c53-8a44-783ea4315476',
team: 'T0364MSFHV2',
score: 0,
channel: {
id: 'C08514ZPKB8',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_shared: false,
is_org_shared: false,
is_ext_shared: false,
is_private: false,
name: 'test-002',
pending_shared: [],
is_pending_ext_shared: false,
},
type: 'message',
user: 'U0362BXQYJW',
username: 'michael.k',
ts: '1734322597.935429',
blocks: [
{
type: 'rich_text',
block_id: '+bc',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'test message\n',
},
{
type: 'text',
text: 'Automated with this ',
style: {
italic: true,
},
},
{
type: 'link',
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
text: 'n8n workflow',
style: {
italic: true,
},
},
],
},
],
},
],
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
permalink: 'https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322597935429',
no_reactions: true,
},
{
iid: '96ee0d2e-1a7d-40bf-b4b2-71ee15f004a8',
team: 'T0364MSFHV2',
score: 0,
channel: {
id: 'C08514ZPKB8',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_shared: false,
is_org_shared: false,
is_ext_shared: false,
is_private: false,
name: 'test-002',
pending_shared: [],
is_pending_ext_shared: false,
},
type: 'message',
user: 'U0362BXQYJW',
username: 'michael.k',
ts: '1734322341.161179',
blocks: [
{
type: 'rich_text',
block_id: 'FGAKN',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'test message\n',
},
{
type: 'text',
text: 'Automated with this ',
style: {
italic: true,
},
},
{
type: 'link',
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
text: 'n8n workflow',
style: {
italic: true,
},
},
],
},
],
},
],
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
permalink: 'https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322341161179',
no_reactions: true,
},
{
iid: '72f79902-65f7-4bf3-b64b-3fd0b0c3746c',
team: 'T0364MSFHV2',
score: 0,
channel: {
id: 'C08514ZPKB8',
is_channel: true,
is_group: false,
is_im: false,
is_mpim: false,
is_shared: false,
is_org_shared: false,
is_ext_shared: false,
is_private: false,
name: 'test-002',
pending_shared: [],
is_pending_ext_shared: false,
},
type: 'message',
user: 'U0362BXQYJW',
username: 'michael.k',
ts: '1734321960.507649',
blocks: [
{
type: 'rich_text',
block_id: 'fnjm',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'test message\n',
},
{
type: 'text',
text: 'Automated with this ',
style: {
italic: true,
},
},
{
type: 'link',
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
text: 'n8n workflow',
style: {
italic: true,
},
},
],
},
],
},
],
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
permalink: 'https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734321960507649',
no_reactions: true,
},
],
},
};
describe('Test SlackV2, message => search', () => {
nock('https://slack.com')
.post('/api/search.messages?query=test%20in%3Atest-002&sort=timestamp&sort_dir=desc&count=2')
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['search.workflow.json'],
});
});
@@ -0,0 +1,262 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"operation": "search",
"query": "test",
"limit": 2,
"options": {
"searchChannel": ["test-002"]
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"iid": "a60ff37e-5653-4c53-8a44-783ea4315476",
"team": "T0364MSFHV2",
"score": 0,
"channel": {
"id": "C08514ZPKB8",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_shared": false,
"is_org_shared": false,
"is_ext_shared": false,
"is_private": false,
"name": "test-002",
"pending_shared": [],
"is_pending_ext_shared": false
},
"type": "message",
"user": "U0362BXQYJW",
"username": "michael.k",
"ts": "1734322597.935429",
"blocks": [
{
"type": "rich_text",
"block_id": "+bc",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "test message\n"
},
{
"type": "text",
"text": "Automated with this ",
"style": {
"italic": true
}
},
{
"type": "link",
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
"text": "n8n workflow",
"style": {
"italic": true
}
}
]
}
]
}
],
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
"permalink": "https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322597935429",
"no_reactions": true
}
},
{
"json": {
"iid": "96ee0d2e-1a7d-40bf-b4b2-71ee15f004a8",
"team": "T0364MSFHV2",
"score": 0,
"channel": {
"id": "C08514ZPKB8",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_shared": false,
"is_org_shared": false,
"is_ext_shared": false,
"is_private": false,
"name": "test-002",
"pending_shared": [],
"is_pending_ext_shared": false
},
"type": "message",
"user": "U0362BXQYJW",
"username": "michael.k",
"ts": "1734322341.161179",
"blocks": [
{
"type": "rich_text",
"block_id": "FGAKN",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "test message\n"
},
{
"type": "text",
"text": "Automated with this ",
"style": {
"italic": true
}
},
{
"type": "link",
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
"text": "n8n workflow",
"style": {
"italic": true
}
}
]
}
]
}
],
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
"permalink": "https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322341161179",
"no_reactions": true
}
},
{
"json": {
"iid": "72f79902-65f7-4bf3-b64b-3fd0b0c3746c",
"team": "T0364MSFHV2",
"score": 0,
"channel": {
"id": "C08514ZPKB8",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_shared": false,
"is_org_shared": false,
"is_ext_shared": false,
"is_private": false,
"name": "test-002",
"pending_shared": [],
"is_pending_ext_shared": false
},
"type": "message",
"user": "U0362BXQYJW",
"username": "michael.k",
"ts": "1734321960.507649",
"blocks": [
{
"type": "rich_text",
"block_id": "fnjm",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "test message\n"
},
{
"type": "text",
"text": "Automated with this ",
"style": {
"italic": true
}
},
{
"type": "link",
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
"text": "n8n workflow",
"style": {
"italic": true
}
}
]
}
]
}
],
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&amp;utm_medium=powered_by&amp;utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
"permalink": "https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734321960507649",
"no_reactions": true
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "0ea58133-0522-40ae-ab51-ec3c1eced057",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,67 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
channel: 'C08514ZPKB8',
text: 'updated message',
message: {
user: 'U0362BXQYJW',
type: 'message',
edited: {
user: 'B0382SHFM46',
ts: '1734324905.000000',
},
bot_id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
text: 'updated message',
team: 'T0364MSFHV2',
bot_profile: {
id: 'B0382SHFM46',
app_id: 'A037UTP0Z39',
name: 'blocks-test',
icons: {
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
},
deleted: false,
updated: 1648028754,
team_id: 'T0364MSFHV2',
},
blocks: [
{
type: 'rich_text',
block_id: 'Akc',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'updated message',
},
],
},
],
},
],
},
message_timestamp: '1734321960.507649',
};
describe('Test SlackV2, message => update', () => {
nock('https://slack.com')
.post('/api/chat.update', {
channel: 'C08514ZPKB8',
link_names: true,
parse: 'none',
text: 'updated message',
ts: '1734321960.507649',
})
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['update.workflow.json'],
});
});
@@ -0,0 +1,142 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"operation": "update",
"channelId": {
"__rl": true,
"value": "C08514ZPKB8",
"mode": "list",
"cachedResultName": "test-002"
},
"ts": 1734321960.507649,
"text": "updated message",
"updateFields": {
"link_names": true,
"parse": "none"
},
"otherOptions": {
"includeLinkToWorkflow": false
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"ok": true,
"channel": "C08514ZPKB8",
"text": "updated message",
"message": {
"user": "U0362BXQYJW",
"type": "message",
"edited": {
"user": "B0382SHFM46",
"ts": "1734324905.000000"
},
"bot_id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"text": "updated message",
"team": "T0364MSFHV2",
"bot_profile": {
"id": "B0382SHFM46",
"app_id": "A037UTP0Z39",
"name": "blocks-test",
"icons": {
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
},
"deleted": false,
"updated": 1648028754,
"team_id": "T0364MSFHV2"
},
"blocks": [
{
"type": "rich_text",
"block_id": "Akc",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "updated message"
}
]
}
]
}
]
},
"message_timestamp": "1734321960.507649"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "27133240-8ff6-4115-b330-9cbc9aa95b25",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,26 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
describe('Test SlackV2, user => updateProfile', () => {
nock('https://slack.com')
.post('/api/users.profile.set', {
profile: {
customFieldUi: {
customFieldValues: [{ alt: '', id: 'Xf05SGHVUDKM', value: 'TEST title' }],
},
email: 'some@email.com',
fields: { Xf05SGHVUDKM: { alt: '', value: 'TEST title' } },
first_name: 'first',
last_name: 'last',
status_emoji: '👶',
status_expiration: 1734670800,
status_text: 'test status',
},
user: 'id-new',
})
.reply(200, { profile: { test: 'OK' } });
new NodeTestHarness().setupTests({
workflowFiles: ['updateProfile.workflow.json'],
});
});
@@ -0,0 +1,106 @@
{
"name": "slack new tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "user",
"operation": "updateProfile",
"options": {
"customFieldUi": {
"customFieldValues": [
{
"id": "Xf05SGHVUDKM",
"value": "TEST title"
}
]
},
"email": "some@email.com",
"first_name": "first",
"last_name": "last",
"status": {
"set_status": [
{
"status_emoji": "👶",
"status_expiration": "2024-12-20T00:00:00",
"status_text": "test status"
}
]
},
"user": "id-new"
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"test": "OK"
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "297af4ef-eca5-493d-8a1f-c735fcb805f2",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,35 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
usergroup: {
id: 'S0615G0KT',
team_id: 'T060RNRCH',
is_usergroup: true,
name: 'Marketing Team',
description: 'Marketing gurus, PR experts and product advocates.',
handle: 'marketing-team',
is_external: false,
date_create: 1446746793,
date_update: 1446746793,
date_delete: 0,
auto_type: null,
created_by: 'U060RNRCZ',
updated_by: 'U060RNRCZ',
deleted_by: null,
prefs: {
channels: [],
groups: [],
},
user_count: '0',
},
};
describe('Test SlackV2, userGroup => create', () => {
nock('https://slack.com').post('/api/usergroups.create').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['create.workflow.json'],
});
});
@@ -0,0 +1,108 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking 'Execute workflow'",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "userGroup",
"operation": "create",
"name": "Marketing Team",
"Options": {
"channelIds": ["C08514ZPKB8"],
"description": "Marketing department user group",
"handle": "marketing",
"include_count": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"auto_type": null,
"created_by": "U060RNRCZ",
"date_create": 1446746793,
"date_delete": 0,
"date_update": 1446746793,
"deleted_by": null,
"description": "Marketing gurus, PR experts and product advocates.",
"handle": "marketing-team",
"id": "S0615G0KT",
"is_external": false,
"is_usergroup": true,
"name": "Marketing Team",
"prefs": {
"channels": [],
"groups": []
},
"team_id": "T060RNRCH",
"updated_by": "U060RNRCZ",
"user_count": "0"
}
}
]
},
"connections": {
"When clicking 'Execute workflow'": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "cf10cd01-6650-48ca-b4a2-ec07be9d026c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,39 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
usergroup: {
id: 'S07XXXXXX',
team_id: 'T1234567890',
is_usergroup: true,
is_subteam: true,
name: 'Marketing Team',
description: 'Marketing department user group',
handle: 'marketing',
is_external: false,
date_create: 1734322671,
date_update: 1734322671,
date_delete: 1734322800,
auto_type: null,
auto_provision: false,
enterprise_subteam_id: '',
created_by: 'U1234567890',
updated_by: 'U1234567890',
deleted_by: 'U1234567890',
prefs: {
channels: [],
groups: [],
},
users: [],
user_count: 0,
},
};
describe('Test SlackV2, userGroup => disable', () => {
nock('https://slack.com').post('/api/usergroups.disable').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['disable.workflow.json'],
});
});
@@ -0,0 +1,109 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking 'Execute workflow'",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "userGroup",
"operation": "disable",
"userGroupId": "S07XXXXXX",
"options": {
"include_count": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"auto_provision": false,
"auto_type": null,
"created_by": "U1234567890",
"date_create": 1734322671,
"date_delete": 1734322800,
"date_update": 1734322671,
"deleted_by": "U1234567890",
"description": "Marketing department user group",
"enterprise_subteam_id": "",
"handle": "marketing",
"id": "S07XXXXXX",
"is_external": false,
"is_subteam": true,
"is_usergroup": true,
"name": "Marketing Team",
"prefs": {
"channels": [],
"groups": []
},
"team_id": "T1234567890",
"updated_by": "U1234567890",
"user_count": 0,
"users": []
}
}
]
},
"connections": {
"When clicking 'Execute workflow'": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "cf10cd01-6650-48ca-b4a2-ec07be9d026c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,39 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
usergroup: {
id: 'S07XXXXXX',
team_id: 'T1234567890',
is_usergroup: true,
is_subteam: true,
name: 'Marketing Team',
description: 'Marketing department user group',
handle: 'marketing',
is_external: false,
date_create: 1734322671,
date_update: 1734322671,
date_delete: 0,
auto_type: null,
auto_provision: false,
enterprise_subteam_id: '',
created_by: 'U1234567890',
updated_by: 'U1234567890',
deleted_by: null,
prefs: {
channels: [],
groups: [],
},
users: [],
user_count: 0,
},
};
describe('Test SlackV2, userGroup => enable', () => {
nock('https://slack.com').post('/api/usergroups.enable').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['enable.workflow.json'],
});
});
@@ -0,0 +1,109 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking 'Execute workflow'",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "userGroup",
"operation": "enable",
"userGroupId": "S07XXXXXX",
"option": {
"include_count": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"auto_provision": false,
"auto_type": null,
"created_by": "U1234567890",
"date_create": 1734322671,
"date_delete": 0,
"date_update": 1734322671,
"deleted_by": null,
"description": "Marketing department user group",
"enterprise_subteam_id": "",
"handle": "marketing",
"id": "S07XXXXXX",
"is_external": false,
"is_subteam": true,
"is_usergroup": true,
"name": "Marketing Team",
"prefs": {
"channels": [],
"groups": []
},
"team_id": "T1234567890",
"updated_by": "U1234567890",
"user_count": 0,
"users": []
}
}
]
},
"connections": {
"When clicking 'Execute workflow'": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "cf10cd01-6650-48ca-b4a2-ec07be9d026c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,69 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
usergroups: [
{
id: 'S07XXXXXX',
team_id: 'T1234567890',
is_usergroup: true,
is_subteam: true,
name: 'Marketing Team',
description: 'Marketing department user group',
handle: 'marketing',
is_external: false,
date_create: 1734322671,
date_update: 1734322671,
date_delete: 0,
auto_type: null,
auto_provision: false,
enterprise_subteam_id: '',
created_by: 'U1234567890',
updated_by: 'U1234567890',
deleted_by: null,
prefs: {
channels: [],
groups: [],
},
users: ['U1234567890', 'U0987654321'],
user_count: 2,
},
{
id: 'S08YYYYYY',
team_id: 'T1234567890',
is_usergroup: true,
is_subteam: true,
name: 'Engineering Team',
description: 'Engineering department user group',
handle: 'engineering',
is_external: false,
date_create: 1734322600,
date_update: 1734322600,
date_delete: 0,
auto_type: null,
auto_provision: false,
enterprise_subteam_id: '',
created_by: 'U1234567890',
updated_by: 'U1234567890',
deleted_by: null,
prefs: {
channels: [],
groups: [],
},
users: ['U1111111111', 'U2222222222', 'U3333333333'],
user_count: 3,
},
],
};
describe('Test SlackV2, userGroup => getAll', () => {
nock('https://slack.com')
.get('/api/usergroups.list')
.query({ include_count: 'true', include_disabled: 'true', include_users: 'true' })
.reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['getAll.workflow.json'],
});
});
@@ -0,0 +1,139 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking 'Execute workflow'",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "userGroup",
"operation": "getAll",
"returnAll": false,
"limit": 100,
"options": {
"include_count": true,
"include_disabled": true,
"include_users": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"id": "S07XXXXXX",
"team_id": "T1234567890",
"is_usergroup": true,
"is_subteam": true,
"name": "Marketing Team",
"description": "Marketing department user group",
"handle": "marketing",
"is_external": false,
"date_create": 1734322671,
"date_update": 1734322671,
"date_delete": 0,
"auto_type": null,
"auto_provision": false,
"enterprise_subteam_id": "",
"created_by": "U1234567890",
"updated_by": "U1234567890",
"deleted_by": null,
"prefs": {
"channels": [],
"groups": []
},
"users": ["U1234567890", "U0987654321"],
"user_count": 2
}
},
{
"json": {
"id": "S08YYYYYY",
"team_id": "T1234567890",
"is_usergroup": true,
"is_subteam": true,
"name": "Engineering Team",
"description": "Engineering department user group",
"handle": "engineering",
"is_external": false,
"date_create": 1734322600,
"date_update": 1734322600,
"date_delete": 0,
"auto_type": null,
"auto_provision": false,
"enterprise_subteam_id": "",
"created_by": "U1234567890",
"updated_by": "U1234567890",
"deleted_by": null,
"prefs": {
"channels": [],
"groups": []
},
"users": ["U1111111111", "U2222222222", "U3333333333"],
"user_count": 3
}
}
]
},
"connections": {
"When clicking 'Execute workflow'": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "cf10cd01-6650-48ca-b4a2-ec07be9d026c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}
@@ -0,0 +1,39 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
const API_RESPONSE = {
ok: true,
usergroup: {
id: 'S07XXXXXX',
team_id: 'T1234567890',
is_usergroup: true,
is_subteam: true,
name: 'Marketing Team Updated',
description: 'Updated marketing department user group',
handle: 'marketing-team',
is_external: false,
date_create: 1734322671,
date_update: 1734322900,
date_delete: 0,
auto_type: null,
auto_provision: false,
enterprise_subteam_id: '',
created_by: 'U1234567890',
updated_by: 'U1234567890',
deleted_by: null,
prefs: {
channels: ['C08514ZPKB8', 'C08514ZPKB9'],
groups: [],
},
users: [],
user_count: 0,
},
};
describe('Test SlackV2, userGroup => update', () => {
nock('https://slack.com').post('/api/usergroups.update').reply(200, API_RESPONSE);
new NodeTestHarness().setupTests({
workflowFiles: ['update.workflow.json'],
});
});
@@ -0,0 +1,113 @@
{
"name": "slack tests",
"nodes": [
{
"parameters": {},
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
"name": "When clicking 'Execute workflow'",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "userGroup",
"operation": "update",
"userGroupId": "S07XXXXXX",
"updateFields": {
"name": "Marketing Team Updated",
"description": "Updated marketing department user group",
"handle": "marketing-team",
"channels": ["C08514ZPKB8", "C08514ZPKB9"],
"include_count": true
}
},
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.3,
"position": [1040, 360],
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
"credentials": {
"slackApi": {
"id": "Bg0bWXf8apAimCqJ",
"name": "Slack account 2"
}
}
},
{
"parameters": {},
"id": "06652908-6b8e-443a-9508-ab229b011b73",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1260, 360]
}
],
"pinData": {
"No Operation, do nothing": [
{
"json": {
"auto_provision": false,
"auto_type": null,
"created_by": "U1234567890",
"date_create": 1734322671,
"date_delete": 0,
"date_update": 1734322900,
"deleted_by": null,
"description": "Updated marketing department user group",
"enterprise_subteam_id": "",
"handle": "marketing-team",
"id": "S07XXXXXX",
"is_external": false,
"is_subteam": true,
"is_usergroup": true,
"name": "Marketing Team Updated",
"prefs": {
"channels": ["C08514ZPKB8", "C08514ZPKB9"],
"groups": []
},
"team_id": "T1234567890",
"updated_by": "U1234567890",
"user_count": 0,
"users": []
}
}
]
},
"connections": {
"When clicking 'Execute workflow'": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Slack": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "cf10cd01-6650-48ca-b4a2-ec07be9d026c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
},
"id": "qJdEfiBgYLdfYOTs",
"tags": []
}