Create block events for published shifts in Google Calendar
Developer ToolAPI IntegrationMarketingRecipe ToolsProductivitySales Enablement
What it does
When someone publishes shifts in Deputy, this automation fetches employee data for each shift and creates two block events on their Google Calendar. The lower and upper boundary events mark the shift time so the employee's calendar shows they are unavailable.
Who it's for
Operations teams who need to block employee calendars automatically when shifts are published in Deputy.
How teams use this
Block calendars when shifts publish
Publish shifts in Deputy and have Google Calendar automatically block each employee's time so they cannot double-book. The team sees real-time calendar updates without manual entry.
Sync shifts across multiple calendar systems
Extend this automation to also push shift blocks to Microsoft Outlook or another calendar platform. Add a second calendar event creation step after the Google Calendar steps to include additional systems.
Log shift metadata for audits
Track which shifts were published and when by logging shift metadata to a job report. This creates an audit trail of all published shifts without storing data elsewhere.
How it works
- Catch published shifts from Deputy. A webhook receives an array of shift objects in real time when someone publishes shifts in Deputy.
- Iterate through each shift. Loop through the shifts array so each shift object is processed separately and employee data can be fetched for it.
- Fetch the employee data. Send a request via Rest to Deputy to retrieve the working employee's details so their Google Calendar can be updated with the shift.
- Create lower boundary block event. Add an event to the employee's Google Calendar marking the start of the shift so their availability is blocked.
- Create upper boundary block event. Add an event to the employee's Google Calendar marking the end of the shift so their full shift time is blocked.