Communication & Messaging
Coffee Bot (Mattermost)
Coffee Bot (Mattermost)
Scheduled
Medium
6
Nodes
Scheduled
Trigger
Medium
Complexity
7/22/2025
Added
Workflow Overview
Total Nodes
6
Node Types
0
Workflow JSON
5.21 KB
{
"id": "7",
"name": "Coffee Bot (Mattermost)",
"nodes": [
{
"name": "Divide into groups",
"type": "n8n-nodes-base.function",
"position": [
1060,
300
],
"parameters": {
"functionCode": "const ideal_group_size = 3;\nlet groups = [];\nlet data_as_array = [];\nlet newItems = [];\n\n// Take all the users and add them to an array\nfor (let j = 0; j < items.length; j++) {\n data_as_array.push({username: items[j].json.username, email: items[j].json.email});\n}\n\n// Fisher-Yates (aka Knuth) Shuffle\nfunction shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n ...Showing first 1000 characters. Click "Expand" to view the full JSON.