{
  "name": "Automated employee offboarding: lock Redmine & GitLab accounts using Odoo 18",
  "nodes": [
    {
      "id": "29e11f4a-6af3-4fcb-ac2f-0e287ce1f036",
      "name": "END",
      "type": "n8n-nodes-base.noOp",
      "position": [
        224,
        912
      ]
    },
    {
      "id": "365d76e7-f556-4a20-9f30-9060b42fe747",
      "name": "Step2: Handle get today",
      "type": "n8n-nodes-base.code",
      "position": [
        -224,
        672
      ]
    },
    {
      "id": "b388dae5-6b64-4f90-a24d-ebcec5639469",
      "name": "Step3: Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -432,
        912
      ]
    },
    {
      "id": "d2a4f72b-e694-4604-b3b3-f21eaf13a177",
      "name": "Step5: If total_count is not equal to 0 = true",
      "type": "n8n-nodes-base.if",
      "position": [
        -16,
        784
      ]
    },
    {
      "id": "8a870043-42f4-4f41-b7de-d4f98e990b6e",
      "name": "Step6: Check if there is a valid record.",
      "type": "n8n-nodes-base.code",
      "position": [
        224,
        672
      ]
    },
    {
      "id": "8228a302-6dff-4216-b043-b41656fcce68",
      "name": "Step7: If hasRecords is empty==> true",
      "type": "n8n-nodes-base.if",
      "position": [
        432,
        784
      ]
    },
    {
      "id": "2630d71f-971b-416f-bd38-6fe61a6fb8eb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        512
      ],
      "parameters": {
        "width": 1068,
        "height": 584,
        "content": "## Step 1 --> 4: The flow will automatically run daily at 17:00 and check if any members are working their last shift on the current day.\n* Step 5: If there are no records, the flow will end. If there"
      }
    },
    {
      "id": "73449f33-b4c1-4c5e-b3ae-4fd8da50bce7",
      "name": "Step1: Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -432,
        672
      ]
    },
    {
      "id": "2d3de564-bb63-4765-9663-5586c908b4f8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        400
      ],
      "parameters": {
        "width": 832,
        "height": 488,
        "content": "## Loop Over Items\n- Get the information of that member on Odoo, then extract their work email.\n- Use that email to find that user on RM6.\n  + If found, take the user's ID and lock the user."
      }
    },
    {
      "id": "d79b45c4-1f2a-40b9-b472-9d32123423ac",
      "name": "Step8: Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        672,
        688
      ]
    },
    {
      "id": "9a50191b-a20a-4cdb-a461-47da8b8baafa",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1616,
        448
      ],
      "parameters": {
        "width": 1308,
        "height": 672,
        "content": "## Lock, remove all group, delete membership in project on RM6"
      }
    },
    {
      "id": "245da7d1-8cf3-44f7-b56e-009c1087012d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        1232
      ],
      "parameters": {
        "width": 1224,
        "height": 320,
        "content": "## Check block a user on Gitlab"
      }
    },
    {
      "id": "71fc8048-ea59-4e1c-a6c5-73627aaa5205",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        1168
      ],
      "parameters": {
        "width": null,
        "height": 80,
        "content": "## Use APIkey Odoo 18"
      }
    },
    {
      "id": "3dbbadf8-4d27-49ef-afa4-bef8f35d63a6",
      "name": "END1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        672,
        528
      ]
    },
    {
      "id": "68681c9a-ae82-4b60-b9c5-5aab983cc712",
      "name": "Step11: Get user info in RM6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1328,
        688
      ]
    },
    {
      "id": "cafcc135-283d-4d3b-ae21-6e9005637625",
      "name": "Step12:  Check if there is a record or not?",
      "type": "n8n-nodes-base.if",
      "position": [
        1568,
        688
      ]
    },
    {
      "id": "288bec11-508c-4ecb-8c9a-d319b595e496",
      "name": "Step13: Update the user's status to \"locked\" on RM6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        608
      ]
    },
    {
      "id": "0dcb4fcd-c5ab-45bc-90e2-292b032af1b0",
      "name": "Step14: Remove the user from all groups in RM 6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2000,
        608
      ]
    },
    {
      "id": "b30b26f1-5e2e-4d30-924e-6a0dca67456a",
      "name": "Step15: Get membership list of user in RM 6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2224,
        608
      ]
    },
    {
      "id": "07847913-2ab6-4082-b804-e6d5cbe6e5f0",
      "name": "Step16: Get memberships_id",
      "type": "n8n-nodes-base.code",
      "position": [
        2432,
        608
      ]
    },
    {
      "id": "bb6be057-56e8-46d2-b1ee-092116f2f652",
      "name": "Step17: Loop Over memberships_id",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2624,
        608
      ]
    },
    {
      "id": "958a44fd-f6d6-4462-9d1a-97287532ec6f",
      "name": "Step18: Delete membership in project on RM 6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2800,
        704
      ]
    },
    {
      "id": "c82a9c18-1419-44bb-be44-ac216633fd73",
      "name": "Step19: Get user information in Gitlab",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1664,
        1344
      ]
    },
    {
      "id": "fe50b2d0-7437-4272-97de-08f99ec45cd3",
      "name": "Step20:  Check if there is a record = true",
      "type": "n8n-nodes-base.if",
      "position": [
        1920,
        1328
      ]
    },
    {
      "id": "3ba6b5e4-a344-4021-89f0-59e2318dc557",
      "name": "Step21: Check if the user is not blocked = true",
      "type": "n8n-nodes-base.if",
      "position": [
        2160,
        1296
      ]
    },
    {
      "id": "eff03657-4a4a-467c-8a6c-87e78b85fc1a",
      "name": "Step22: Check if the user is not deactivate = true",
      "type": "n8n-nodes-base.if",
      "position": [
        2384,
        1280
      ]
    },
    {
      "id": "12ef1a30-ecba-4e4a-9d72-8eeaa2f442a5",
      "name": "Step23: Block a user in Gitlab",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2688,
        1328
      ]
    },
    {
      "id": "e28de410-2e4a-47a0-8ac2-43e95049b077",
      "name": "Step24: Get user information in Gitlab",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        784
      ]
    },
    {
      "id": "bda33ccf-b67b-4c09-996d-e86db238c771",
      "name": "Step25:  Check if there is a record = true",
      "type": "n8n-nodes-base.if",
      "position": [
        2000,
        784
      ]
    },
    {
      "id": "37324328-c131-4f3f-a8a3-4b635f580bd9",
      "name": "Step26: Check if the user is not blocked = true",
      "type": "n8n-nodes-base.if",
      "position": [
        2224,
        864
      ]
    },
    {
      "id": "2250c2c1-dfc1-4873-8600-51e829b2f688",
      "name": "Step27: Check if the user is not deactivate = true",
      "type": "n8n-nodes-base.if",
      "position": [
        2432,
        912
      ]
    },
    {
      "id": "1380048c-2981-4d07-9e63-3d6bf62f9e37",
      "name": "Step28: Block a user in Gitlab",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2688,
        960
      ]
    },
    {
      "id": "b218ac6d-1695-4e22-99f0-b8e93f52f368",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        2800,
        480
      ]
    },
    {
      "id": "87ad0556-fde3-47f6-b07a-ea545209db3e",
      "name": "Step9: Get employee information in Odoo 18",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        912,
        688
      ]
    },
    {
      "id": "274c6f67-bfd6-4c2d-8ff5-a48dda3ed130",
      "name": "Step4: Get Employee Resignation in Odoo 18",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        912
      ]
    },
    {
      "id": "ece600ac-63a2-4eef-9d6d-649110803be1",
      "name": "Step10: Handle work_email",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        688
      ]
    },
    {
      "id": "d39321ea-115d-4351-b8c0-4302668a3457",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        368
      ],
      "parameters": {
        "width": 800,
        "height": 1056,
        "content": "## Automatically lock Redmine, Gitlab accounts for employees after their last shift\nThis workflow is designed for IT Ops, HR, and Security teams automating employee offboarding. Zero manual work: Disa"
      }
    }
  ],
  "connections": {
    "END": {
      "main": [
        []
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Step19: Get user information in Gitlab",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step3: Set Variables": {
      "main": [
        [
          {
            "node": "Step4: Get Employee Resignation in Odoo 18",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step8: Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Step9: Get employee information in Odoo 18",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step1: Schedule Trigger": {
      "main": [
        [
          {
            "node": "Step2: Handle get today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step2: Handle get today": {
      "main": [
        [
          {
            "node": "Step3: Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step10: Handle work_email": {
      "main": [
        [
          {
            "node": "Step11: Get user info in RM6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step16: Get memberships_id": {
      "main": [
        [
          {
            "node": "Step17: Loop Over memberships_id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step11: Get user info in RM6": {
      "main": [
        [
          {
            "node": "Step12:  Check if there is a record or not?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step23: Block a user in Gitlab": {
      "main": [
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step28: Block a user in Gitlab": {
      "main": [
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step17: Loop Over memberships_id": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step18: Delete membership in project on RM 6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step7: If hasRecords is empty==> true": {
      "main": [
        [
          {
            "node": "END1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step19: Get user information in Gitlab": {
      "main": [
        [
          {
            "node": "Step20:  Check if there is a record = true",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step24: Get user information in Gitlab": {
      "main": [
        [
          {
            "node": "Step25:  Check if there is a record = true",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step6: Check if there is a valid record.": {
      "main": [
        [
          {
            "node": "Step7: If hasRecords is empty==> true",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step20:  Check if there is a record = true": {
      "main": [
        [
          {
            "node": "Step21: Check if the user is not blocked = true",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step25:  Check if there is a record = true": {
      "main": [
        [
          {
            "node": "Step26: Check if the user is not blocked = true",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step4: Get Employee Resignation in Odoo 18": {
      "main": [
        [
          {
            "node": "Step5: If total_count is not equal to 0 = true",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step9: Get employee information in Odoo 18": {
      "main": [
        [
          {
            "node": "Step10: Handle work_email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step12:  Check if there is a record or not?": {
      "main": [
        [
          {
            "node": "Step13: Update the user's status to \"locked\" on RM6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step24: Get user information in Gitlab",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step15: Get membership list of user in RM 6": {
      "main": [
        [
          {
            "node": "Step16: Get memberships_id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step18: Delete membership in project on RM 6": {
      "main": [
        [
          {
            "node": "Step17: Loop Over memberships_id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step5: If total_count is not equal to 0 = true": {
      "main": [
        [
          {
            "node": "Step6: Check if there is a valid record.",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "END",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step14: Remove the user from all groups in RM 6": {
      "main": [
        [
          {
            "node": "Step15: Get membership list of user in RM 6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step21: Check if the user is not blocked = true": {
      "main": [
        [
          {
            "node": "Step22: Check if the user is not deactivate = true",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step26: Check if the user is not blocked = true": {
      "main": [
        [
          {
            "node": "Step27: Check if the user is not deactivate = true",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step22: Check if the user is not deactivate = true": {
      "main": [
        [
          {
            "node": "Step23: Block a user in Gitlab",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step27: Check if the user is not deactivate = true": {
      "main": [
        [
          {
            "node": "Step28: Block a user in Gitlab",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Step8: Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step13: Update the user's status to \"locked\" on RM6": {
      "main": [
        [
          {
            "node": "Step14: Remove the user from all groups in RM 6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}