Your email_sheet_summary chains two apps. Now Calendar and Tasks. You have a list of upcoming events — how do you turn each one into a follow-up task automatically?
After email_sheet_summary the two-app chain pattern is clear. For calendar events, I want a task for each upcoming meeting — '48h prep: Board Meeting', '48h prep: Investor Call'. Right now I add those manually.
find_events gives you the list. Then loop over each event, take the summary field, and call add_task with a formatted title. Calendar feeds Tasks:
events = find_events(cal_id, time_min)
tasks = []
for event in events:
title = f"Prep: {event.get('summary', 'Meeting')}"
task = add_task(list_id, title, "Auto-created from calendar event")
tasks.append(task)What if there are no upcoming events? Does the loop crash?
No — an empty list produces zero iterations. The loop body never runs. tasks stays []. Your function returns an empty list, not an error. Safe by default. Here's the full function:
def upcoming_to_tasks(cal_id: str, list_id: str) -> list:
result = toolset.execute_action(Action.GOOGLECALENDAR_FIND_EVENT, {"calendar_id": cal_id, "time_min": "2026-04-20T00:00:00Z"})
events = result.get("events", [])
tasks = []
for event in events:
title = f"Prep: {event.get('summary', 'Meeting')}"
task = toolset.execute_action(Action.GOOGLETASKS_INSERT_TASK, {"tasklist": list_id, "title": title, "notes": "Auto-created"})
tasks.append(task)
print(f"Created {len(tasks)} tasks from {len(events)} events")
return tasksEvery upcoming meeting gets a prep task automatically. Board call Monday — prep task added. Investor call Thursday — prep task added. My task list manages itself.
Your Google Tasks list just got a robot contributor. It will never miss a meeting prep task again.
Calendar to Tasks — two apps, one chain. The pattern is always the same: get data from app A, process it, write to app B. Composable everywhere.
Deduplication matters in loops. If you run this function twice without clearing tasks, you'll get duplicate prep tasks. In production, check whether the task already exists before inserting. For now, run once per day maximum.
The pattern: get events from Calendar, insert a task for each. Chaining Calendar to Tasks means every upcoming board meeting and investor call automatically gets a prep reminder — nothing falls through the cracks.
events = find_events(cal_id, time_min)
for event in events:
add_task(list_id, f"Prep: {event['summary']}", "Auto")An empty events list produces zero iterations — the loop body never runs. Safe to call even when no events exist.
Running the function twice creates duplicate tasks. Add deduplication or run once per day.
Your email_sheet_summary chains two apps. Now Calendar and Tasks. You have a list of upcoming events — how do you turn each one into a follow-up task automatically?
After email_sheet_summary the two-app chain pattern is clear. For calendar events, I want a task for each upcoming meeting — '48h prep: Board Meeting', '48h prep: Investor Call'. Right now I add those manually.
find_events gives you the list. Then loop over each event, take the summary field, and call add_task with a formatted title. Calendar feeds Tasks:
events = find_events(cal_id, time_min)
tasks = []
for event in events:
title = f"Prep: {event.get('summary', 'Meeting')}"
task = add_task(list_id, title, "Auto-created from calendar event")
tasks.append(task)What if there are no upcoming events? Does the loop crash?
No — an empty list produces zero iterations. The loop body never runs. tasks stays []. Your function returns an empty list, not an error. Safe by default. Here's the full function:
def upcoming_to_tasks(cal_id: str, list_id: str) -> list:
result = toolset.execute_action(Action.GOOGLECALENDAR_FIND_EVENT, {"calendar_id": cal_id, "time_min": "2026-04-20T00:00:00Z"})
events = result.get("events", [])
tasks = []
for event in events:
title = f"Prep: {event.get('summary', 'Meeting')}"
task = toolset.execute_action(Action.GOOGLETASKS_INSERT_TASK, {"tasklist": list_id, "title": title, "notes": "Auto-created"})
tasks.append(task)
print(f"Created {len(tasks)} tasks from {len(events)} events")
return tasksEvery upcoming meeting gets a prep task automatically. Board call Monday — prep task added. Investor call Thursday — prep task added. My task list manages itself.
Your Google Tasks list just got a robot contributor. It will never miss a meeting prep task again.
Calendar to Tasks — two apps, one chain. The pattern is always the same: get data from app A, process it, write to app B. Composable everywhere.
Deduplication matters in loops. If you run this function twice without clearing tasks, you'll get duplicate prep tasks. In production, check whether the task already exists before inserting. For now, run once per day maximum.
The pattern: get events from Calendar, insert a task for each. Chaining Calendar to Tasks means every upcoming board meeting and investor call automatically gets a prep reminder — nothing falls through the cracks.
events = find_events(cal_id, time_min)
for event in events:
add_task(list_id, f"Prep: {event['summary']}", "Auto")An empty events list produces zero iterations — the loop body never runs. Safe to call even when no events exist.
Running the function twice creates duplicate tasks. Add deduplication or run once per day.
Create a free account to get started. Paid plans unlock all tracks.