Legal-hold BambooHR terminations in Google Vault before deletion

Every weekday at 6pm, catch new BambooHR terminations, place their Google Workspace mail, drive, groups, and chat on legal hold, and confirm in Slack before IT deletes the account.

Agentic Task
BambooHRGoogle VaultSlackHR & PeopleOperationsNotifications & AlertsData Sync
PromptCreate

Every weekday at 6pm local time, run an agent that catches newly terminated employees in BambooHR and places their Google Workspace data on legal hold in Google Vault before offboarding IT can delete the account. Google Workspace license reassignment and account cleanup typically start within 24 hours of a termination, so the hold has to land the same day HR enters the change.

Start by calling BambooHR Get Changed Employees with a since timestamp of the previous run (default to 24 hours ago on the first run) to find every employee whose record changed. For each changed employee, call BambooHR Get Employee to read at least their work email, department, job title, employment status, termination date, and any tags. Keep only the ones whose status just flipped to terminated, or whose termination date is today or in the very near past.

For each qualifying leaver, decide whether preservation is required. Default to yes for anyone in a preservation-required role: executives, finance, sales, engineering, HR, legal, or anyone whose BambooHR record carries an open-matter tag. For anyone outside those buckets, skip the hold and record the reason (for example: 'individual contributor in a non-preservation department, no open matter tag').

For each person you are holding, first call Google Vault List Matters to look for an existing matter named after this person and their termination date (something like 'Preservation: Jane Doe (2026-07-12)'). If none exists, call Google Vault Create Matter with that name and a short description referencing the BambooHR employee ID and termination date. Then call Google Vault Create Hold on that matter, scoped by account to the person's Google Workspace email, with the corpora set to cover Mail, Drive, Groups, and Chat (one hold per corpus if the API requires, or a single hold if it supports multiple corpora).

Finally, post a single confirmation to the #legal-holds Slack channel using Slack Send a Message. Format it as a short digest: a header with today's date, then two sections. The first section lists everyone you preserved, with their name, department, termination date, and the matter name. The second section lists everyone you deliberately did not hold, each with a one-line reason. If there were no terminations, post a brief 'no new terminations today' note so the team knows the workflow ran.

Business rules to bake in: never create a duplicate matter for the same person and termination date; if Create Hold fails for one corpus, still attempt the others and note the partial failure in the Slack recap; if a person appears in the changed feed but is not actually terminated (for example, a rehire or a name change), ignore them silently; treat BambooHR's timezone as authoritative for termination-date comparisons.

Additional information

What does this prompt do?
  • Checks BambooHR every weekday evening for anyone whose status just changed to terminated
  • Places their Google Workspace mail, drive, groups, and chat on legal hold under a matter named after them and their termination date
  • Posts a confirmation to your #legal-holds Slack channel listing who was preserved and who was intentionally skipped, with the reason for each
What do I need to use this?
  • A BambooHR account with read access to employee status and job fields
  • A Google Workspace admin account with Google Vault access
  • A Slack workspace and a channel like #legal-holds where confirmations should land
How can I customize it?
  • Change the schedule (default weekdays at 6pm, right after HR would have entered terminations for the day)
  • Adjust which departments or roles require a preservation hold (defaults cover executives, finance, sales, engineering, HR, and anyone tagged with an open matter)
  • Rename the confirmation channel or add a fallback DM to your legal or compliance lead

Frequently asked questions

Why do we need this if IT already offboards leavers?
Standard offboarding usually starts by reclaiming or deleting the Google Workspace license, and once that happens the mail, drive, and chat history goes with it. Placing a Google Vault hold first freezes the data so legal, HR, or an audit can still get to it later, even after IT wipes the account.
Will this preserve data for everyone who leaves?
No. It only holds people in roles or departments where preservation is standard practice, plus anyone your team has already flagged with an open matter. Everyone else is skipped and the reason shows up in the Slack recap so you can double-check.
What data does the hold actually cover?
By default, mail, drive files, group messages, and chat. You can narrow the corpora if your team only cares about email, or widen it to include calendar and voice.
Does it create a new matter for every leaver?
Only if one does not already exist. The agent looks for a matter named after the person and their termination date before creating a new one, so re-running the workflow will not spawn duplicates.
What happens if BambooHR has no terminations that day?
The workflow still runs, finds nothing, and posts a short 'no new terminations today' note to the Slack channel so you know it fired.

Never lose a leaver's data to offboarding again.

Put this legal-hold safety net between BambooHR terminations and Google Workspace deletion in a single click.