{
  "name": "Task time analysis: Automated overspend time insights for ClickUp and more",
  "nodes": [
    {
      "id": "749b4a34-abca-448e-8039-a57801c00689",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -3260,
        540
      ]
    },
    {
      "id": "7f4fe2c5-3ef6-4887-805b-b2ec73817af2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1940,
        200
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Why requested for extra time?\n\nChecklist Name = Why needed Extra time?\n\nList of reasons with the comment link if possible."
      }
    },
    {
      "id": "2753b25c-1ded-4f33-91cc-d1b00f593388",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        200
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Why goes over estimation.\n\nChecklist Name = Why goes over estimation?\n\nEvaluate comments and discussions and based on that prepare list of reasons about why it goes over estimation."
      }
    },
    {
      "id": "714798ea-c08e-4b92-bc28-76e0cefa28ba",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2280,
        800
      ]
    },
    {
      "id": "20f433ee-3723-4e8e-997b-90c6870ef29c",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2440,
        800
      ]
    },
    {
      "id": "b5d541fb-ff1c-4387-adc7-4fd7d3ec0197",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        3540,
        520
      ]
    },
    {
      "id": "3d05bf5b-7e97-473c-bef0-a45d8055577f",
      "name": "Get Clickup Tasks",
      "type": "n8n-nodes-base.clickUp",
      "position": [
        -3020,
        540
      ]
    },
    {
      "id": "730d01c6-57f8-48ec-9fbe-9fc8d149408c",
      "name": "Fetch Time entries via task IDs",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -560,
        1280
      ]
    },
    {
      "id": "331d1286-f720-45f6-8e77-d6e822a517b6",
      "name": "Filter out unnecessary data from Tasks",
      "type": "n8n-nodes-base.code",
      "position": [
        -2800,
        540
      ]
    },
    {
      "id": "2be708ea-adf5-4f41-ae87-ad87539d5704",
      "name": "If task has crossed estimation",
      "type": "n8n-nodes-base.if",
      "position": [
        -2580,
        540
      ]
    },
    {
      "id": "040f3bcf-edef-42c6-aa4f-fd54c2cb1287",
      "name": "Fetch Master comments",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1620,
        160
      ]
    },
    {
      "id": "9ff0e6a3-9701-4686-908d-dce489103dc2",
      "name": "Loop Over Master comments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1220,
        160
      ]
    },
    {
      "id": "8749943a-1834-4adc-90cc-4c0ff3094bc5",
      "name": "If comments got thread comments",
      "type": "n8n-nodes-base.if",
      "position": [
        -280,
        180
      ]
    },
    {
      "id": "98f6f0b5-70d1-4341-b4cf-e6b313cc806a",
      "name": "Fetch comment threads",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -40,
        -80
      ]
    },
    {
      "id": "e4af0433-6cb0-4f80-a284-1520b1329971",
      "name": "Merge thread comments with master comments",
      "type": "n8n-nodes-base.merge",
      "position": [
        440,
        -220
      ]
    },
    {
      "id": "236d2c78-0af5-4f78-809d-a740f68beae0",
      "name": "Re-merge all master comments",
      "type": "n8n-nodes-base.merge",
      "position": [
        860,
        180
      ]
    },
    {
      "id": "91ddd52e-7c72-466d-b054-4eb9bf4a08b2",
      "name": "Re-structure comments to process them in loop node",
      "type": "n8n-nodes-base.code",
      "position": [
        1080,
        180
      ]
    },
    {
      "id": "aafe2a4c-3b8b-4eee-bde6-b8cf19ca8c10",
      "name": "Merge task data, comments and time entries",
      "type": "n8n-nodes-base.merge",
      "position": [
        1940,
        520
      ]
    },
    {
      "id": "b531daf1-ceeb-4739-bd3c-1cd0f9ca4d29",
      "name": "Modify Task data",
      "type": "n8n-nodes-base.code",
      "position": [
        -300,
        540
      ]
    },
    {
      "id": "8838e6b2-2e60-42a0-864b-e7b2cc640504",
      "name": "Move to next master comment",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1300,
        180
      ]
    },
    {
      "id": "dfa59ea4-1ed2-49fa-8490-41711685b032",
      "name": "Modify Master comment data",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        -220
      ]
    },
    {
      "id": "b9d06844-c5bb-4897-85cb-4bf992535b84",
      "name": "Return Comments data",
      "type": "n8n-nodes-base.code",
      "position": [
        560,
        -360
      ]
    },
    {
      "id": "61f7e795-d952-4161-a27e-338c3d7744a9",
      "name": "Modify threads comment data",
      "type": "n8n-nodes-base.code",
      "position": [
        200,
        -80
      ]
    },
    {
      "id": "3435d757-2812-46be-a0a5-546fb3cc7f82",
      "name": "Sort Master comments old to new",
      "type": "n8n-nodes-base.code",
      "position": [
        -600,
        180
      ]
    },
    {
      "id": "e657b291-a333-449b-82e7-e3e27c4c0c70",
      "name": "Modify Time entries data",
      "type": "n8n-nodes-base.code",
      "position": [
        -340,
        1280
      ]
    },
    {
      "id": "51e5cf99-7128-4008-b9d5-19f9818f29de",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        2820,
        520
      ]
    },
    {
      "id": "8ffc6a60-44c0-4a9e-8a3e-517d598b6845",
      "name": "Destructure & Filter comments array to loop them",
      "type": "n8n-nodes-base.code",
      "position": [
        -900,
        180
      ]
    },
    {
      "id": "ffa220b7-5097-4068-ad06-72ccaabcfd0d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3320,
        420
      ],
      "parameters": {
        "width": 940,
        "height": 320,
        "content": "## Fetch Overtime Tasks\n\nPull ClickUp tasks in target statuses and folders with time_spent > time_estimate.\n\n\n\n"
      }
    },
    {
      "id": "90acbb60-344b-4858-95e0-414af00ad3ec",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        1200
      ],
      "parameters": {
        "width": 540,
        "height": 260,
        "content": "## Get Time Entries  \nFetch time entries for each task to analyze where time was spent.\n\n\n"
      }
    },
    {
      "id": "8ee5b71b-b9c6-4630-878c-fbbfc8574d57",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        -380
      ],
      "parameters": {
        "width": 3240,
        "height": 800,
        "content": "## Get Comments and Its threads\nPull all user comments and thread replies from ClickUp.\n\n"
      }
    },
    {
      "id": "3377bb1b-94b8-48e7-b8d0-bcd80ba0b41d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        420
      ],
      "parameters": {
        "width": 860,
        "height": 520,
        "content": "## AI-Generated Checklist\n \nSend task data to GPT to extract two reason lists (extra time + overrun reasons).\n\n"
      }
    },
    {
      "id": "99e3f2b0-8c6a-4780-85c6-f01bed99c0f9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1020,
        1040
      ],
      "parameters": {
        "width": 1200,
        "height": 720,
        "content": "## Time spent on \n1) Development   \n2) Scoping \n3) Commenting+Call+Documentation  \n4) PR Review  \n5) QA  \n6) and miscellaneous time "
      }
    },
    {
      "id": "fd221230-7152-4187-83df-bbd490192ffa",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1380,
        1560
      ]
    },
    {
      "id": "bb32a71f-a59a-4a1d-a48f-4bbd87d69c87",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1540,
        1560
      ]
    },
    {
      "id": "e3ea3616-d303-4691-bbd9-a0a619cf7511",
      "name": "Generate time insights",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1500,
        1280
      ]
    },
    {
      "id": "07941593-50ca-4c08-b20e-b127fc5b8c85",
      "name": "Generate Reason checklist",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2400,
        520
      ]
    },
    {
      "id": "bb11bcba-3420-454f-ac54-4d02af4a06c4",
      "name": "Code2",
      "type": "n8n-nodes-base.code",
      "position": [
        2040,
        1280
      ]
    },
    {
      "id": "f4778407-9c8c-471d-ac18-b4c6c2c8ddd7",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        3140,
        520
      ]
    },
    {
      "id": "8237e6ce-da95-4106-bd19-a09e8bfd92f8",
      "name": "Code3",
      "type": "n8n-nodes-base.code",
      "position": [
        540,
        1700
      ]
    },
    {
      "id": "c2c2dd87-4a59-4f28-9a2d-4ac82b3baa01",
      "name": "Generate Prompt with Time entires",
      "type": "n8n-nodes-base.code",
      "position": [
        1100,
        1280
      ]
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Generate Reason checklist",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Generate time insights",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Modify Task data": {
      "main": [
        [
          {
            "node": "Merge task data, comments and time entries",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Clickup Tasks": {
      "main": [
        [
          {
            "node": "Filter out unnecessary data from Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Reason checklist",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate time insights",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Return Comments data": {
      "main": [
        [
          {
            "node": "Merge task data, comments and time entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Master comments": {
      "main": [
        [
          {
            "node": "Loop Over Master comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch comment threads": {
      "main": [
        [
          {
            "node": "Modify threads comment data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate time insights": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Modify Time entries data": {
      "main": [
        [
          {
            "node": "Merge task data, comments and time entries",
            "type": "main",
            "index": 2
          },
          {
            "node": "Generate Prompt with Time entires",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Reason checklist": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Master comments": {
      "main": [
        [
          {
            "node": "Return Comments data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Destructure & Filter comments array to loop them",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Modify Master comment data": {
      "main": [
        [
          {
            "node": "Re-merge all master comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Modify threads comment data": {
      "main": [
        [
          {
            "node": "Merge thread comments with master comments",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Move to next master comment": {
      "main": [
        [
          {
            "node": "Loop Over Master comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Re-merge all master comments": {
      "main": [
        [
          {
            "node": "Re-structure comments to process them in loop node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If task has crossed estimation": {
      "main": [
        [
          {
            "node": "Fetch Time entries via task IDs",
            "type": "main",
            "index": 0
          },
          {
            "node": "Modify Task data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Master comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Time entries via task IDs": {
      "main": [
        [
          {
            "node": "Modify Time entries data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If comments got thread comments": {
      "main": [
        [
          {
            "node": "Fetch comment threads",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge thread comments with master comments",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Re-merge all master comments",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Sort Master comments old to new": {
      "main": [
        [
          {
            "node": "If comments got thread comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Prompt with Time entires": {
      "main": [
        [
          {
            "node": "Generate time insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get Clickup Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter out unnecessary data from Tasks": {
      "main": [
        [
          {
            "node": "If task has crossed estimation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge task data, comments and time entries": {
      "main": [
        [
          {
            "node": "Generate Reason checklist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge thread comments with master comments": {
      "main": [
        [
          {
            "node": "Modify Master comment data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Destructure & Filter comments array to loop them": {
      "main": [
        [
          {
            "node": "Sort Master comments old to new",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Re-structure comments to process them in loop node": {
      "main": [
        [
          {
            "node": "Move to next master comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}