Automatisierte zufällige Hausarbeiten-Zuweisung mit Google Tabellen und Gmail-Benachrichtigungen

Fortgeschritten

Dies ist ein Automatisierungsworkflow mit 15 Nodes. Hauptsächlich werden Code, Gmail, GoogleSheets, ScheduleTrigger und andere Nodes verwendet. Automatisierung der zufälligen Haushaltsaufgabenverteilung durch Google-Tabellen und Gmail-Benachrichtigungen

Voraussetzungen
  • Google-Konto + Gmail API-Anmeldedaten
  • Google Sheets API-Anmeldedaten

Kategorie

-
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "meta": {
    "instanceId": "0867aa2e4fb4e86d170a6ca997a164fd02d27420eb0e7cb54482c4b03d1672ac",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "2346a47e-4dc0-4017-83f4-c45098e88319",
      "name": "Zeitplan-Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1568,
        -288
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "daysInterval": 7
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ac1a1dc4-ab83-41cc-a4f9-78f200aeb324",
      "name": "Get Tasks",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1296,
        -288
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s/edit#gid=0",
          "cachedResultName": "Tasks"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s/edit?usp=drivesdk",
          "cachedResultName": "Chore_scheduler"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "x23VLPzDtSY8QGZL",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "cb86134c-7f25-48f2-af87-2297386ca3be",
      "name": "Get People",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -992,
        -288
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 307557581,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s/edit#gid=307557581",
          "cachedResultName": "Persons"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s/edit?usp=drivesdk",
          "cachedResultName": "Chore_scheduler"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "x23VLPzDtSY8QGZL",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "5870874f-35ce-4b0d-8230-ec7c27fa71eb",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -384,
        -288
      ],
      "webhookId": "8c1a3396-8d92-419e-ac17-794f5ecbfa98",
      "parameters": {
        "sendTo": "={{ $('Filter Data and Assign Tasks').item.json.email }}",
        "message": "=Hello {{ $('Filter Data and Assign Tasks').item.json.assigned_to }}!\n\nThe homework assigned to you this week is: {{ $('Filter Data and Assign Tasks').item.json.task }}.\n{{ $('Filter Data and Assign Tasks').item.json.description }}\n\nHave a good day!",
        "options": {},
        "subject": "=Task selection"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "Lq6xBv8sVLgAMlGL",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0c83e351-1158-4577-9f24-06297d7477fb",
      "name": "Filter Data and Assign Tasks",
      "type": "n8n-nodes-base.code",
      "position": [
        -688,
        -288
      ],
      "parameters": {
        "jsCode": "let tasks = $items('Get Tasks');\nlet people = $items('Get People');\n\n// Filter persons without Email\npeople = people.filter(item => {\n  const email = item.json.email;\n  return email && email.toString().trim() !== '';\n});\n\n// Filter tasks undefined\ntasks = tasks.filter(item => {\n  const task = item.json.task;\n  return task && task.toString().trim() !== '';\n});\n\n// Error if there aren´t any persons\nif (people.length === 0) {\n  throw new Error('No hay personas con correo electrónico para asignar las tareas.');\n}\n\n// Assign Tasks\nconst assignments = tasks.map((taskItem, index) => {\n  const personItem = people[Math.floor(Math.random() * people.length)];\n  return {\n    json: {\n      row_number: taskItem.json.row_number,\n      task: taskItem.json.task,\n      description: taskItem.json.description,\n      assigned_to: personItem.json.name,\n      email: personItem.json.email,\n    }\n  };\n});\n\nreturn assignments;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "d5692ac3-3119-4466-a557-15bf38acb8c0",
      "name": "Update assign_to in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -80,
        -288
      ],
      "parameters": {
        "columns": {
          "value": {
            "row_number": "={{ $('Filter Data and Assign Tasks').item.json.row_number }}",
            "assigned_to": "={{ $('Filter Data and Assign Tasks').item.json.assigned_to }}"
          },
          "schema": [
            {
              "id": "task",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "task",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "assigned_to",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "assigned_to",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s/edit#gid=0",
          "cachedResultName": "Tasks"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ghJREX21axnMDVF5tndQMIh6MWYUJevNRV9Ji4kBG7s/edit?usp=drivesdk",
          "cachedResultName": "Chore_scheduler"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "x23VLPzDtSY8QGZL",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d60ce508-5931-4250-968b-79f1064ed6de",
      "name": "Haftnotiz1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -224
      ],
      "parameters": {
        "color": 2,
        "width": 320,
        "content": "## Sheets Tasks Example\n![](https://i.imgur.com/VHb4GQM.jpeg)"
      },
      "typeVersion": 1
    },
    {
      "id": "17b51b73-044f-4798-a939-fac4daa167df",
      "name": "Haftnotiz2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2016,
        -672
      ],
      "parameters": {
        "color": 2,
        "width": 352,
        "height": 832,
        "content": "## Setup steps before start\n1.\tSpreadsheet – Create a Google Sheets document with two sheets (“Tasks” and “Persons”) You can see examples in the **images**.\n2.\tCreate your credential for Google Sheets with read and write permissions.\n3. Create your credential to send messages from Gmail.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "97d87ab3-a03d-4522-b516-3bbde84306f3",
      "name": "Haftnotiz",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1984,
        -448
      ],
      "parameters": {
        "color": 2,
        "width": 288,
        "height": 208,
        "content": "## Sheet Persons ![](https://i.imgur.com/0eN0zPX.jpeg)"
      },
      "typeVersion": 1
    },
    {
      "id": "d8e31fc6-60b1-4ca5-ad1b-70b396bc53e3",
      "name": "Haftnotiz3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -48
      ],
      "parameters": {
        "color": 2,
        "width": 320,
        "height": 192,
        "content": "## How to customise it\n\nChange the schedule interval to suit your rotation, edit the email template to include due dates or motivational messages, or modify the assignment script to weight tasks by difficulty. You could also send notifications via Slack or Telegram."
      },
      "typeVersion": 1
    },
    {
      "id": "289e4235-712e-4b95-bace-0eb749181767",
      "name": "Haftnotiz5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -464
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 352,
        "content": "**Filter Data and Assign Tasks Node (Optional):** \n\nIt's preconfigured but you can or modify the assignment script to weight tasks by difficulty.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ea1dd9bf-3a8c-42cf-b43e-cb5e6fe12d66",
      "name": "Haftnotiz6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -464
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 352,
        "content": "**Send a message node:** \n\nSelect your Gmail credential. If you want you can customise the subject and body of the email."
      },
      "typeVersion": 1
    },
    {
      "id": "ee4d6fb2-e4a4-44c9-9d1a-ea348ec2ca5f",
      "name": "Haftnotiz7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -464
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 352,
        "content": "**Update sheet assign_to in sheet node:** \n\nThe workflow uses the row_number to match the row being updated. Ensure mapping writes the assigned person’s name to the correct row. "
      },
      "typeVersion": 1
    },
    {
      "id": "75fc9783-7d22-448b-bd52-559f3ec38ca6",
      "name": "Haftnotiz8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -464
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 352,
        "content": "**Get People Node:** \n\nSelect the credential for your Google account and search for your Persons sheet in drive.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b2b88914-0526-4936-8d5a-b6215dd05eb9",
      "name": "Haftnotiz9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -464
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 352,
        "content": "**Get Tasks Node:** \n\nSelect the credential for your Google account and search for your Tasks sheet in drive.\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "ac1a1dc4-ab83-41cc-a4f9-78f200aeb324": {
      "main": [
        [
          {
            "node": "cb86134c-7f25-48f2-af87-2297386ca3be",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cb86134c-7f25-48f2-af87-2297386ca3be": {
      "main": [
        [
          {
            "node": "0c83e351-1158-4577-9f24-06297d7477fb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5870874f-35ce-4b0d-8230-ec7c27fa71eb": {
      "main": [
        [
          {
            "node": "d5692ac3-3119-4466-a557-15bf38acb8c0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "ac1a1dc4-ab83-41cc-a4f9-78f200aeb324",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5692ac3-3119-4466-a557-15bf38acb8c0": {
      "main": [
        []
      ]
    },
    "0c83e351-1158-4577-9f24-06297d7477fb": {
      "main": [
        [
          {
            "node": "5870874f-35ce-4b0d-8230-ec7c27fa71eb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes15
Kategorie-
Node-Typen5
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Autor
Adrian

Adrian

@nafri

Experienced tech professional with 10+ years in Big Data, AI, and automation, former bootcamp director, and passionate about innovation and strategic growth.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34