{
  "name": "Zoho Overdue tasks",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1,
                2,
                3,
                4,
                5
              ],
              "triggerAtHour": 9,
              "triggerAtMinute": 45
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        528,
        -32
      ],
      "id": "4bde190e-0ce7-4944-9209-568e529bade6",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "url": "https://projectsapi.zoho.in/api/v3/portal/60042811877/tasks?view_id=314301000000558253",
        "authentication": "genericCredentialType",
        "genericAuthType": "oAuth2Api",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        736,
        -32
      ],
      "id": "5c72b7d4-a17b-4223-9896-9d7621576581",
      "name": "HTTP Request2",
      "credentials": {
        "oAuth2Api": {
          "id": "6a6EHwsbaujvjm1J",
          "name": "Zoho projects connections"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "tasks",
        "include": "allOtherFields",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        976,
        -32
      ],
      "id": "d727e95b-9281-4fa1-aa20-c376f23f2f94",
      "name": "Split Out"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "178b1b23-64ee-4d30-b346-11f98834b522",
              "name": "Project name ",
              "value": "={{ $json.tasks.project.name }}",
              "type": "string"
            },
            {
              "id": "e3dbba71-e831-458d-aa42-caa2f004b606",
              "name": "Task list name",
              "value": "={{ $json.tasks.tasklist.name }}",
              "type": "string"
            },
            {
              "id": "d58cdd17-d9e9-4815-90a4-081ead279277",
              "name": "Task name",
              "value": "={{ $json.tasks.name }}",
              "type": "string"
            },
            {
              "id": "a3710ac0-e2de-497a-a78f-a2908fa366c4",
              "name": "Prefix",
              "value": "={{ $json.tasks.prefix }}",
              "type": "string"
            },
            {
              "id": "680623dd-1097-4100-be87-f406b4be9123",
              "name": "Status",
              "value": "={{ $json.tasks.status.name }}",
              "type": "string"
            },
            {
              "id": "e97eed65-7fab-4ce2-9b73-f1e38482d7c4",
              "name": "Owner email",
              "value": "={{ $json.tasks.owners_and_work.owners[0].email }}",
              "type": "string"
            },
            {
              "id": "99b5e9a1-5698-41b5-83d5-a38798d0dc97",
              "name": "End date ",
              "value": "={{ $json.tasks.end_date.toDate().toLocaleDateString('en-GB').replace(/\\//g, '-') }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1216,
        -32
      ],
      "id": "bf38d31e-3f79-4e92-9792-140e4bad2a0b",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "jsCode": "// This loop ensures that all 94 items are processed and returned\nreturn $input.all().map(item => {\n    \n    // 1. Get the email from the current item\n    // Using the field name 'Owner email' from your 'Edit Fields' node\n    const rawEmail = item.json[\"Owner email\"] || \"\";\n    const inputEmail = rawEmail.trim().toLowerCase();\n\n    // 2. Full Lookup Map\n    const slackIdMap = {\n        \"emil@thedarenetwork.com\": \"U06E8FMKLF8\",\n        \"muhammed@thedarenetwork.com\": \"U077PRZ8MUK\",\n        \"rohit@thedarenetwork.com\": \"U078CP69Y48\",\n        \"pavithraa@thedarenetwork.com\": \"U07CSHN12JV\",\n        \"ria@thedarenetwork.com\": \"U0AFA4M4ZC4\",\n        \"shwetha@thedarenetwork.com\": \"U0AF6HC37QA\",\n        \"vinayak@thedarenetwork.com\": \"U0AG0RJHFC0\",\n        \"asif@thedarenetwork.com\": \"U07EJRBLD45\",\n        \"ameer@thedarenetwork.com\": \"U07FG30HXFC\",\n        \"raksha@thedarenetwork.com\": \"U07G4UBEHJ4\",\n        \"farhan@thedarenetwork.com\": \"U07KA17FAP8\",\n        \"sanjay@thedarenetwork.com\": \"U09L1BKA2DD\",\n        \"hasil@thedarenetwork.com\": \"U09L1BMKG3H\",\n        \"sudeesh@thedarenetwork.com\": \"U09L1BNH26B\",\n        \"srivathsa@thedarenetwork.com\": \"U09L1BNK95M\",\n        \"uvais@thedarenetwork.com\": \"U09L1BP3LCF\",\n        \"justeena@thedarenetwork.com\": \"U09LDBBEWDB\",\n        \"mitali@thedarenetwork.com\": \"U09LDBL19B7\",\n        \"ashwin@thedarenetwork.com\": \"U09LDBLF99T\",\n        \"nihal@thedarenetwork.com\": \"U09LENXC9SA\",\n        \"chesta@thedarenetwork.com\": \"U09LENXQ25C\",\n        \"nilanjan@thedarenetwork.com\": \"U09LGRFS7B4\",\n        \"aftab@thedarenetwork.com\": \"U09LGRKL534\",\n        \"pooja@thedarenetwork.com\": \"U09LGRL4SKU\",\n        \"nayonika@thedarenetwork.com\": \"U09LGRLV598\",\n        \"arshid@thedarenetwork.com\": \"U09LGRM28QJ\",\n        \"marzad@thedarenetwork.com\": \"U09LLBLRW5S\",\n        \"sumayya@thedarenetwork.com\": \"U09LLBRU952\",\n        \"siddharth@thedarenetwork.com\": \"U09LLBSJJ92\",\n        \"nithish@thedarenetwork.com\": \"U09LVNAMZG9\",\n        \"punith@thedarenetwork.com\": \"U09LVNBJAM7\",\n        \"sudha@thedarenetwork.com\": \"U09MB3Y2QSC\",\n        \"thulasi@thedarenetwork.com\": \"U09MB3Y7P6U\",\n        \"sarath@thedarenetwork.com\": \"U09MB3Y9WKA\",\n        \"kushal@thedarenetwork.com\": \"U09QCSJBMM3\",\n        \"shervin@thedarenetwork.com\": \"U09QZFU5J2V\",\n        \"amrita@thedarenetwork.com\": \"U09RVM1VD50\",\n        \"nancy@thedarenetwork.com\": \"U09S8J418BT\",\n        \"mohith@thedarenetwork.com\": \"U09TF5T6D28\",\n        \"lokesh@thedarenetwork.com\": \"U09V76VTW01\",\n        \"ameya@thedarenetwork.com\": \"U09V90ECFBQ\",\n        \"nisha@thedarenetwork.com\": \"U0A08JRPR1N\",\n        \"balaji@thedarenetwork.com\": \"U0A0HM717R9\",\n        \"sarathlal@thedarenetwork.com\": \"U0A0HM7AABD\",\n        \"ashwani@thedarenetwork.com\": \"U0A0TL549TN\",\n        \"muskan@thedarenetwork.com\": \"U0A130Q7X25\",\n        \"mekha@thedarenetwork.com\": \"U0A28EHRH0C\",\n        \"nambashisha@thedarenetwork.com\": \"U0A3DFSA8TV\",\n        \"zaman@thedarenetwork.com\": \"U0A3GE7U02H\",\n        \"vismaya@thedarenetwork.com\": \"U0A4E6UEEFJ\",\n        \"zainab@thedarenetwork.com\": \"U0A4J0E1P7Z\",\n        \"priya@thedarenetwork.com\": \"U0A4W0QCLSH\",\n    };\n\n    // 3. Return the original data + the new slackID field\n    return {\n        json: {\n            ...item.json,\n            slackID: slackIdMap[inputEmail] || \"NOT_FOUND\"\n        }\n    };\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1664,
        -32
      ],
      "id": "cfef5c96-93dc-47a5-9244-0abdfabf4409",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "9b6951df-18da-458a-a202-de1bf17d0924",
              "leftValue": "={{ $json['Owner email'] }}",
              "rightValue": "Unassigned User",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        1424,
        -32
      ],
      "id": "243d9b24-b181-4ec1-9e65-0b580998be42",
      "name": "If"
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "user",
        "user": {
          "__rl": true,
          "value": "={{ $json.slackID }}",
          "mode": "id"
        },
        "text": "=Overdue Task:\nProject - {{ $json['Project name '] }}\nTask list - {{ $json['Task list name'] }}\nTask - {{ $json['Task name'] }}\nPrefix - {{ $json.Prefix }}\nEnd date - {{ $json['End date '] }}",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        1856,
        -32
      ],
      "id": "067dea5b-db0b-4542-b8b0-97c01ae50071",
      "name": "Send a message",
      "webhookId": "1ebf296c-2982-448b-8034-844a9a37abd3",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "slackOAuth2Api": {
          "id": "n2Y45CYxhaBLsOcG",
          "name": "Slack account 2"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "6f935e86-acc1-4033-9225-14d602b6de09",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ec71a95432ae1169816e368ff566c55fc9a5562016ed19405e0147feef576edc"
  },
  "id": "dgosHgcTIVKDKexjWXyR4",
  "tags": []
}