Desk clear-out report
Get a weekly list of desks to clear after employees leave.
Prompt
Set up a scheduled task named "Desk clear-out report". - Schedule: [RUN TIME], my time. - Connectors for its runs: Robin (Workplace) and Claude Docs, plus Slack if the report goes to Slack. - Notifications: [NOTIFICATIONS] when a run finishes. - First check my scheduled tasks. If another task already reports or releases desks of people who left, show it to me and ask whether to replace it. - Run it once now so the snapshot doc "Robin desk assignment snapshot" exists from today. People removed before today can't be found, because Robin no longer has them. - If the desk action below releases desks, check that I have planning access to the buildings in scope. After creating it, tell me its approval setting. Use this as the task's prompt: Find desks that still have someone's things on them after that person left, and report where each desk is so someone can clear it out. Use the Robin (Workplace) connector, and the Claude Docs connector for the snapshot. Don't ask questions; nobody is watching this run. Unless the desk action below releases desks, only read from Robin. Scope: [BUILDINGS]. Who counts as gone: [WHO]. Also report: [ALSO]. Snapshot 1. Take today's snapshot of every assigned desk in scope. For each building: get_building_overview to find floors with assigned desks, get_building_live_state once, then get_draft_data for each of those floors. Record every desk that has an assignee: building, floor, pod, desk name, desk id, person's name, email and user id. The live-state copy can carry pending edits other people made; if a floor's assigned-desk count there disagrees with find_desks assigneeCount, trust find_desks and note it. 2. Find my Claude doc titled "Robin desk assignment snapshot" and read its table. That is the snapshot from the last run. If the doc doesn't exist yet, this is the first run: create it, save today's snapshot, and only report the people found in step 4. Who left 3. Compare the two snapshots. For every desk whose person is gone from it, look that person up with find_people, userNameFilter set to their email and statuses ACTIVE, ADDED, INVITE_PENDING, INVITE_EXPIRED and DEACTIVATED. If they aren't found, they were removed from Robin: put the desk on the clear-out list with the name and email from the last snapshot, since Robin no longer has them. 4. find_people with statuses DEACTIVATED (and INVITE_EXPIRED if expired invitations count), paging through every result. Anyone in today's snapshot with one of those statuses still holds a desk: put it on the clear-out list. 5. If a person from the last snapshot is now at a different desk, list them as moved, with both desks, so their things can follow them. If they're still active but have no desk now, list the old desk as "check this desk". 6. Flag anyone who left but also has an active account under the same name, and desks whose desk name is the person's name. Desks to release 7. [DESK ACTION]. Removed people's desks are already free in Robin. To release desks still assigned to deactivated or expired accounts: create a new building draft per building named "Desk clear-out report" plus today's date (never reuse an existing draft), set those desks' assignments to an empty list in one update_draft batch keeping each desk's type, run review_draft_changes, then either leave it unpublished with its link from get_draft_url, or publish with notifications off and confirm with get_draft_status. Save and report 8. Replace the table in "Robin desk assignment snapshot" with today's snapshot (one row per desk: building, floor, pod, desk name, desk id, person, email, user id) and put today's date at the top. Only do this after the comparison, so the last snapshot isn't lost. 9. Report in parts (desks to clear, people who moved, desks to check), with totals first. List desks grouped by building, then floor, then pod, so someone can walk them in order. For each desk: desk name, desk id, the person's name and email, why, and whether it was released. End with any flags and errors with Robin's reason, and a link to the snapshot doc. If there's nothing to report, end with one line: "Nothing to clear." If the Robin connector offers user removal history, HR offboarding data, a clear-out status or last check-in dates, use them: find removed people directly instead of from the snapshot, include people leaving in the next 7 days, leave out desks already cleared, and add when each desk was last used.