Auto-block focus time in Google Calendar on busy days
Needs changesWhat this workflow does
This workflow has 8 nodes and runs on a schedule (cron 0 8 * * *). Along the way it connects Google Calendar.
How it runs
Trigger: On a schedule (cron 0 8 * * *).
- Get Full Week Events (Google Calendar): get many
- Calculate Full Week Focus Time Slots (Code): runs custom JavaScript code
- Should Create Focus Time? (If): checks a condition and branches into true / false
- Split Free Slots (Item Lists): reshapes item lists (legacy Item Lists node)
- Log No Focus Time Needed (Code): runs custom JavaScript code
- Create Focus Time Event (Google Calendar): uses Google Calendar
- Log Results (Code): runs custom JavaScript code
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- Item Lists (legacy) in Split Free Slots: replace with Split Out, Aggregate, Sort, Limit, Remove Duplicates or Summarize (match the operation used).
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
| Removed in 3.0 | Replace with |
|---|---|
| Item Lists (legacy) Split Free Slots | Split Out, Aggregate, Sort, Limit, Remove Duplicates or Summarize (match the operation used) |
Nodes used (5)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Google Calendar
n8n-nodes-base.googleCalendar - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Item Lists
n8n-nodes-base.itemLists
From the author
How it works: - This flow checks the user's Google calender of events from Sunday to Saturday of current week, to determine how many hours have been booked each day. - If a day has over 6 hours booked, it blocks out the remaining work hours for dedicated…