find_events from Week 2 returns upcoming calendar events. add_task from Week 2 inserts a task. Chain them: every upcoming client call generates a preparation task automatically.
Loop over the events, create a task for each one with the event title and date as the task title and notes.
Exactly. Two apps, one loop. find_events returns the event list; for each event, add_task creates a preparation task. The Calendar feeds the task list:
events = find_events(cal_id, time_min)
for event in events:
title = f"Prep — {event.get('summary', 'Meeting')}"
notes = f"Event on {event.get('start', '')}"
add_task(list_id, title, notes)Why .get('summary', 'Meeting')? Can a Calendar event have no title?
Yes — Google Calendar allows untitled events. An event without a title returns no summary key. .get('summary', 'Meeting') gives a fallback label so the task still gets created rather than crashing on a KeyError. Same reflex as every API response in this track.
So before every client call this week, a preparation task already exists in my task list. I did not have to create any of them manually.
Calendar feeds Tasks. The workflow does the follow-through:
def upcoming_to_tasks(cal_id: str, list_id: str) -> list:
events = find_events(cal_id, "2026-04-20T00:00:00Z")
created = []
for event in events:
title = f"Prep — {event.get('summary', 'Meeting')}"
notes = f"Event on {event.get('start', {}).get('dateTime', '')}"
task = add_task(list_id, title, notes)
created.append(task)
print(f"Created {len(created)} tasks from {len(events)} events")
return createdCalendar and Tasks wired in twenty lines. My Monday prep list creates itself.
What would you add — a reminder to send the agenda 24 hours before the event?
Fetch events from Calendar, then create a matching task for each one:
events = find_events(cal_id, time_min)
tasks = []
for event in events:
task = add_task(list_id, event['summary'], event.get('description', ''))
tasks.append(task)
return tasksA confirmed kickoff call in Calendar should automatically create a 'Send kickoff prep doc' task in Tasks. The two apps share the same data — only the action differs.
Return value: a list of created task dicts — one per event. The list length tells you how many tasks were created in this run.
find_events from Week 2 returns upcoming calendar events. add_task from Week 2 inserts a task. Chain them: every upcoming client call generates a preparation task automatically.
Loop over the events, create a task for each one with the event title and date as the task title and notes.
Exactly. Two apps, one loop. find_events returns the event list; for each event, add_task creates a preparation task. The Calendar feeds the task list:
events = find_events(cal_id, time_min)
for event in events:
title = f"Prep — {event.get('summary', 'Meeting')}"
notes = f"Event on {event.get('start', '')}"
add_task(list_id, title, notes)Why .get('summary', 'Meeting')? Can a Calendar event have no title?
Yes — Google Calendar allows untitled events. An event without a title returns no summary key. .get('summary', 'Meeting') gives a fallback label so the task still gets created rather than crashing on a KeyError. Same reflex as every API response in this track.
So before every client call this week, a preparation task already exists in my task list. I did not have to create any of them manually.
Calendar feeds Tasks. The workflow does the follow-through:
def upcoming_to_tasks(cal_id: str, list_id: str) -> list:
events = find_events(cal_id, "2026-04-20T00:00:00Z")
created = []
for event in events:
title = f"Prep — {event.get('summary', 'Meeting')}"
notes = f"Event on {event.get('start', {}).get('dateTime', '')}"
task = add_task(list_id, title, notes)
created.append(task)
print(f"Created {len(created)} tasks from {len(events)} events")
return createdCalendar and Tasks wired in twenty lines. My Monday prep list creates itself.
What would you add — a reminder to send the agenda 24 hours before the event?
Fetch events from Calendar, then create a matching task for each one:
events = find_events(cal_id, time_min)
tasks = []
for event in events:
task = add_task(list_id, event['summary'], event.get('description', ''))
tasks.append(task)
return tasksA confirmed kickoff call in Calendar should automatically create a 'Send kickoff prep doc' task in Tasks. The two apps share the same data — only the action differs.
Return value: a list of created task dicts — one per event. The list length tells you how many tasks were created in this run.
Create a free account to get started. Paid plans unlock all tracks.