Weekly
Block focus time in next week's calendar
Every Sunday evening, two-hour focus blocks are added to next week's free slots and the plan is posted to your Slack.
- Runs
- Weekly
- Apps
- Google Calendar, Slack
- AI
- Optional
- Access
- Calendar read+write; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: every Sunday evening, add 2-hour focus blocks to next week's free slots in my Google Calendar and post the plan to my Slack.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A product designer starts every week meaning to protect time for deep work. By Tuesday her calendar is full of short meetings booked into every gap, and the design work happens in the evenings.
Claiming focus blocks before the week starts means colleagues see her as busy and book around them, and the Sunday summary shows her when the real work will happen.
What you get out of it
Deep work stops losing to meetings
Blocks booked before Monday are already in your calendar when others look for a slot, so they plan around them.
Only free time is used
Blocks go into gaps that are actually open, so nothing you already agreed to is moved or double-booked.
A plan for the week ahead
The Slack summary shows when your focus time falls, which makes it easier to decide what to work on in each block.
Done every week without thinking
The habit does not depend on remembering it on a Sunday night; it simply happens.
How it works
What happens, step by step
Every Sunday evening ClickRuntime checks next week's Google Calendar for free time within your working hours.
It picks open two-hour gaps, at most one per day.
It adds a Focus time event in each gap, shown as busy to others.
A short plan of the week's focus blocks is posted to your Slack.
Before it runs live
- Connect Google Calendar
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Google Sheets
- Combine it with other Google Calendar and Slack steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timedelta, timezone
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from clickruntime import on_trigger, credentials, notify
@on_trigger
def run(event):
cal = build("calendar", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
monday = (datetime.now(timezone.utc) + timedelta(days=1)).replace(hour=0, minute=0, second=0, microsecond=0)
busy = cal.freebusy().query(body={"timeMin": monday.isoformat(), "timeMax": (monday + timedelta(days=5)).isoformat(),
"items": [{"id": "primary"}]}).execute()["calendars"]["primary"]["busy"]
spans = [(datetime.fromisoformat(b["start"].replace("Z", "+00:00")), datetime.fromisoformat(b["end"].replace("Z", "+00:00"))) for b in busy]
plan = []
for d in range(5):
for hour in (9, 11, 14):
start = monday + timedelta(days=d, hours=hour)
end = start + timedelta(hours=2)
if not any(s < end and e > start for s, e in spans):
cal.events().insert(calendarId="primary", body={"summary": "Focus time", "transparency": "opaque",
"start": {"dateTime": start.isoformat()}, "end": {"dateTime": end.isoformat()}}).execute()
plan.append(f"{start:%a %H:%M}-{end:%H:%M}")
break
notify.slack("Focus blocks next week: " + (", ".join(plan) or "no free 2-hour slots"), channel="#me")
return {"blocks": len(plan)}FAQ
Common questions
How many blocks does it add?
Will it book over lunch or early mornings?
Can I move a block once it's booked?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get today's calendar in a Slack message every morning
Each weekday at 7am a Slack message lists your meetings for the day, so you see your schedule where you already work.
See how it worksGet a brief on external guests before each meeting
Half an hour before a meeting with people from outside your company, a short brief on their companies arrives in your Slack DMs.
See how it worksFlag meetings on public holidays and post the on-call rota in Slack
Every Monday your team sees next week's meetings that clash with public holidays or leave, and who is on call this week, in one Slack post.
See how it worksKeep exploring
Set up “Block focus time in next week's calendar” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.