Back to Blog
Automation Workflows

Secure Your Offboarding: How to Build an Automated Employee Deprovisioning Workflow with n8n

n8n
n8n Resources Team
April 11, 2026

The High Cost of Manual Employee Offboarding

When an employee leaves your company, a race against the clock begins. You need to revoke access to sensitive systems, preserve critical data, and notify relevant departments. Performing this process manually is not just slow; it's a significant security risk. A single missed step can leave a former employee with access to company data, creating a compliance nightmare.

Manual deprovisioning is prone to human error. Accounts are forgotten, data transfers are missed, and the entire process lacks a clear audit trail. This operational drag costs your IT and HR teams valuable time they could be spending on strategic initiatives.

This guide provides a practical, step-by-step solution. We'll build an automated employee offboarding workflow using n8n that connects your HR system to your core IT tools. This workflow will automatically suspend user accounts, transfer their data, and create follow-up tasks, ensuring a consistent, secure, and auditable offboarding process every time.

The Automated Offboarding Workflow: A High-Level Overview

Our goal is to create a workflow that triggers when an employee's termination date is reached. The workflow will then execute a series of critical deprovisioning actions across multiple platforms without manual intervention.

Here’s the logic:

  1. Trigger: The workflow runs on a daily schedule, checking for employees whose last day is today.

  2. Fetch Employee Data: It pulls a list of departing employees from a central source, like an HRIS (BambooHR) or a simple Google Sheet.

  3. Find User in Google Workspace: It uses the employee's email to locate their Google Workspace account.

  4. Suspend Account & Transfer Data: It suspends the user's Google account to immediately revoke access and initiates a transfer of their Google Drive files to their manager.

  5. Notify Stakeholders: It sends a detailed confirmation message to a private IT or HR channel in Slack.

  6. Create Final Checklist Task: It creates a task in a project management tool like Asana to track manual actions, such as recovering company hardware.

What You'll Need

Before you start, make sure you have an n8n instance and the necessary credentials for the services you want to connect:

  • An n8n instance: A running n8n Cloud or self-hosted instance.
  • HR Information Source: Access to your HRIS API (like BambooHR) or a designated Google Sheet that lists departing employees and their termination dates.
  • Google Workspace: Admin credentials with permissions to manage users and Drive data.
  • Slack: Credentials for a Slack app with permission to post messages to channels.
  • Asana (or similar): API credentials to create tasks.

Example n8n Workflow: Step-by-Step Implementation

This section breaks down how to build each part of the workflow in n8n. We'll use a Google Sheet as our HR data source for maximum accessibility, but the logic can be easily adapted for an HRIS like BambooHR.

Step 1: The Trigger (Daily Schedule)

Every automated process needs a trigger. Since we want to check for departing employees daily, a Schedule node is the perfect starting point.

  • Add a Schedule node to your canvas.
  • Set the Trigger Interval to Daily.
  • Set the Hour to a time outside of peak business hours, such as 1 AM.

This ensures the workflow runs once a day to begin the offboarding process.

Step 2: Get Today's Departures from Google Sheets

Next, the workflow needs to fetch the list of employees whose last day is today.

  • Add a Google Sheets node.

  • Configure your credentials.

  • Set the Operation to Read.

  • Enter the Spreadsheet ID and Sheet Name of your offboarding tracker.

  • In the Options, set Key to the column header containing the termination date (e.g., terminationDate) and Value to an expression that gets today's date: {{ $now.toFormat('yyyy-MM-dd') }}. This tells the node to only return rows where the date matches today.

This node will output a list of all employees scheduled for offboarding today.

Step 3: Find and Suspend the Google Workspace User

Now we iterate through each departing employee to take action on their Google account. An Split in Batches node is useful here to process one employee at a time.

  1. Split in Batches Node: Add this node after the Google Sheets node and leave the batch size at 1.

  2. Google Admin Node (Find User): Add a Google Admin node. Set the Resource to User and Operation to Get. In the User Key field, use an expression to map the email from the Google Sheet: {{ $json.email }}.

  3. Google Admin Node (Suspend User): Add another Google Admin node. Set Resource to User and Operation to Update. Use the same User Key as the previous step. In the Update Fields, click Add Field and select Suspended. Set the value to true.

Step 4: Transfer Google Drive Data

Losing a departing employee's files is not an option. Before the account is eventually deleted, transfer ownership of their Drive data to their manager.

  • Add a Google Admin node.

  • Set the Resource to Data Transfer and Operation to Create.

  • For Old Owner User ID, use the email of the departing employee: {{ $json.email }}.

  • For New Owner User ID, map the manager's email from your Google Sheet: {{ $json.managerEmail }}.

  • Under Application Data Transfers, add an item and select Drive.

Step 5: Notify IT and HR in Slack

Clear communication is key. Send an automated alert to a private Slack channel to confirm that the deprovisioning has been initiated.

  • Add a Slack node.
  • Set the Channel to your private IT or HR channel (e.g., #it-offboarding-logs).
  • Craft a clear message in the Text field. Use expressions to include the employee's name and a summary of actions taken.

Example Message: `Automated Offboarding Initiated for: {{ $json.name }}.

  • Google Workspace account has been suspended.
  • Google Drive file transfer to {{ $json.managerEmail }} is in progress.`

Step 6: Create a Manual Follow-up Task in Asana

Some offboarding steps, like recovering a laptop or phone, still require human intervention. Create a task automatically to ensure nothing is forgotten.

  • Add an Asana node.
  • Set the Operation to Create.
  • Select the Project for your offboarding checklists.
  • Set the Task Name dynamically: Recover hardware from {{ $json.name }}.
  • In the Notes field, add any relevant details, like the employee's last day and manager.
  • Assign the task to the appropriate person or team.

Beyond the Basics: Enhancing Your Offboarding Workflow

This workflow provides a powerful and secure foundation. Once it's running smoothly, you can expand it to cover more systems and scenarios:

  • Revoke SaaS Access: Add HTTP Request nodes or dedicated n8n nodes to deactivate user accounts in other critical applications like Salesforce, GitHub, or Figma.
  • Set an Out of Office: Use the Gmail node to automatically set a final out-of-office reply on the user's account, redirecting inquiries to their manager.
  • Handle Error Cases: Use the IF node to create branches for when a user isn't found in a system, sending an alert for manual review.
  • Archive and Delete: For compliance, you can add steps to export the user's mailbox using Google Takeout and then schedule the account for permanent deletion after a set period (e.g., 30 days).

From Manual Risk to Automated Security

By automating your employee deprovisioning process with n8n, you transform a high-risk, manual checklist into a reliable, secure, and auditable system. This workflow not only protects your company's data but also frees up your HR and IT teams to focus on more strategic work. Adapt this template to your company's tech stack and build a truly seamless offboarding experience.

Enjoyed this article?

Share it with others who might find it useful