Daily Google Groups offboarding sweep from BambooHR

Each weekday at 6am ET, find yesterday's BambooHR terminations, hand off their group ownership to their manager, and remove them from every Google Group.

Agentic Task
BambooHRGoogle GroupsSlack BotHR & PeopleOperationsNotifications & AlertsOnboarding AutomationDaily Digests
PromptCreate

Build me an agent workflow that runs every weekday at 6am America/New_York and closes out Google Groups access for any employee whose last day in BambooHR was yesterday, so their group access is cut before the next workday starts. Use BambooHR, Google Groups, and Slack Bot.

Step 1. Find yesterday's leavers. Call BambooHR Get Employee Directory and filter to employees whose termination date equals yesterday in America/New_York. For each match, capture their BambooHR employee id, full name, and work email. If nobody matches, post a short Slack recap saying there were no offboardings today and stop.

Step 2. For each departing employee, call Google Groups Search Direct Groups with their work email to get every group they directly belong to. For each of those groups, call Google Groups List Memberships and find the departing person's membership so you know their roles (MEMBER, MANAGER, or OWNER).

Step 3. Ownership handoff first, always. For any group where the departing person is an OWNER or MANAGER, look up their manager in BambooHR with Get Employee (use the supervisor / manager field on the departing employee's record) and get the manager's work email. Look for the manager in the same group's memberships. If the manager is already a member, use Google Groups Modify Membership Roles to promote them to OWNER. If the manager is not in the group, use Create Membership to add them as OWNER. Only proceed to Step 4 for that group once an OWNER other than the departing person is in place.

Never strip the last owner from a group. If the departing person is the sole owner and (a) their BambooHR manager is missing, (b) the manager's email is not in your Google Workspace domain, or (c) the role promotion fails, skip the deletion for that group and add it to the 'needs human attention' list for the recap.

Step 4. Once ownership is safe, call Google Groups Delete Membership to remove the departing employee from every group returned in Step 2. Track per person: total groups removed, every ownership handoff that happened (which group, who got promoted), and every group that was skipped with the reason.

Step 5. Post one Slack Bot Send a Message to #it-offboarding (let me change the channel later). Group the recap by departing employee. For each person show: name and work email, number of groups removed, ownership transfers (group name and new owner), and any groups that need human attention with a one-line reason such as 'sole owner, no manager on file' or 'external-only owners left'. End with a one-line summary across all employees processed.

Reason about ownership edge cases instead of pushing through them: external-only owners, deactivated managers, nested groups, and missing manager records should land in the recap, not silently leave an orphan group behind. If BambooHR or Google Groups returns an error for a specific person or group, keep going for the others and include the failure in the recap.

Additional information

What does this prompt do?
  • Pulls yesterday's departing employees from BambooHR every weekday morning so their group access is cut by the time the next workday starts.
  • For every Google Group the person belongs to, checks whether they were an owner or manager and promotes their BambooHR manager into that role before anyone is removed.
  • Removes the departing employee from every group they were in, including private team groups, distribution lists, and discussion forums.
  • Posts a single recap in Slack listing each person, how many groups they were removed from, every ownership handoff, and any group that still needs a human to step in.
What do I need to use this?
  • A BambooHR account where termination dates are kept current in the employee directory.
  • A Google Workspace account with admin access to your Google Groups so the workflow can change roles and remove members.
  • A Slack workspace and a channel like #it-offboarding where the daily recap should land.
How can I customize it?
  • Change the run time, the time zone, or the days it runs (for example, every day instead of weekdays only).
  • Point the recap at a different Slack channel, or send it as a DM to the IT lead instead.
  • Adjust the ownership-transfer rule, for example always promote a specific operations lead instead of the departing person's direct manager.

Frequently asked questions

What happens if the person leaving was the only owner of a group?
Before removing them, the workflow promotes their BambooHR manager to owner of that group. If no manager is on file or the manager is not already in the group, it leaves the group alone and flags it in the Slack recap so a human can decide.
Will this remove someone from groups they own without warning?
No. Ownership is always handed off before any removal happens. The rule is simple: never strip the last owner from a group. Anything that cannot be cleanly transferred gets escalated in the recap instead of silently orphaned.
How does it know who is leaving?
Each morning it reads the BambooHR employee directory and picks out everyone whose termination date in BambooHR was yesterday. If your HR team enters terminations on time, the sweep catches them on the next run.
Can I run this on a different schedule?
Yes. The default is every weekday at 6am ET so access is cut before the next workday starts, but you can change the time, the time zone, or run it daily including weekends.
Does this also remove the person from Slack, email, or other tools?
Not in this workflow. It is focused on Google Groups, which is where most quiet access risk lives. You can pair it with separate offboarding workflows for Slack, Gmail forwarding, or SaaS apps.

Stop leaving ex-employees in your Google Groups.

Connect BambooHR, Google Groups, and Slack once. Every weekday at 6am ET, group access for yesterday's terminations is cleanly transferred and revoked before they would have walked in the door.