New hire desk assignment
Automatically seat new hires near their manager and team, with a daily assignment report.
Prompt
Set up a scheduled task named "New hire desk assignment". - Schedule: [RUN TIME], my time. - Connectors for its runs: Robin (Workplace), plus Slack if the report goes to Slack. - Notifications: [NOTIFICATIONS] when a run finishes. - First check my scheduled tasks. If another task already seats new employees, show it to me and ask whether to replace it, so two tasks don't seat the same people. - Check that I have planning access to the buildings in scope. Tell me any I don't, since runs can't seat people there. - After creating it, tell me its approval setting. Runs only seat people and publish when the task approves automatically. Use this as the task's prompt: Seat new employees at permanent assigned desks in Robin. Use the Robin (Workplace) connector. Don't ask questions; nobody is watching this run. Call scenario_planning_workflow first and follow it, except where these steps say otherwise. Scope: [BUILDINGS]. Who needs a desk 1. find_people with addedWithinDays [LOOKBACK DAYS], paging through every result. Keep statuses ACTIVE and ADDED (added but not signed in yet). 2. Skip [SKIP]. 3. get_draft_assignments for everyone left, in batches. Anyone who already holds a desk anywhere is done. Count who still needs a desk before changing anything. Choosing desks 4. A free desk is one find_desks lists with isDisabled false, assigneeCount 0 and deskTypes exactly ["assigned","shared"]. Never convert a desk's type, never move or unassign anyone who is already seated, and never use the same desk twice in a run. 5. For each person, try these in order and take the first that has a free desk in scope: a. Next to their manager: get_draft_assignments for the manager, then a free desk in the manager's pod, then the same neighborhood, then the same floor. b. Where their teammates sit: find_people with managerIds set to their manager, get_draft_assignments for those teammates, then a free desk on the floor where most of them sit, their pod first. c. Their department's neighborhood: get_building_overview with includeNeighborhoods, then a free desk in a neighborhood whose name or description matches their department. Department names are free text, so match case and spelling loosely. d. Any free assigned desk in scope, starting with the building that has the most free assigned desks. 6. When several new people share a manager, seat them next to each other. Write a one-line reason for each pick. 7. If no desk fits someone, add them to the queue (add_users_to_draft_queue) on the floor where they would best sit, and report them as waiting. Drafts and publishing 8. For each building with changes, create a new building draft named "New hire desk assignment" plus today's date. Never reuse or edit an existing draft. Seat everyone for that building in one update_draft batch, with the permanent recurrence RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0. 9. review_draft_changes. If any desk would cancel someone's booking, take that seat out of the draft and pick the next desk for that person. 10. [PUBLISH]: publish the floors with changes with publish_draft and confirm with get_draft_status (check at 10, 20 and 30 seconds), or, if I want to approve first, don't publish and put each draft's link from get_draft_url in the report. Don't retry a publish. Report 11. Finish with a short report in three parts: seated (name, email, department, desk, pod, floor, building, reason), waiting in a queue (name, floor and why), and skipped (name and why). End with any errors and Robin's reason. If nobody needed a desk, say so in one line. If the Robin connector offers start dates, HR employment data or time off, use them: seat people before their start date and skip contractors HR marks as remote.