See llms.txt for all machine-readable content.

Back to Templates

Plan dependent tasks across workdays and export calendar snapshots with Google

Quick overview

This workflow collects tasks and busy-time blocks from Google Sheets, generates a multi-day work plan that respects dependencies and daily capacity, routes it through a Google Sheets review gate, and after approval exports a UTC ICS calendar snapshot to Google Drive and prepares Gmail draft notifications.

How it works

  1. Starts when someone submits the n8n Form (or runs the manual demo trigger) with a plan ID, plan date, optional excluded task IDs, and an optional exported baseline case key.
  2. Reads the plan register, tasks, and busy blocks from Google Sheets and builds a proposed schedule across business days by merging overlapping busy intervals, honoring working hours, dependencies, earliest dates, and a per-day minute budget.
  3. Writes or updates the proposal in the Google Sheets plan register and, if needed, creates a Gmail draft requesting a reviewer decision.
  4. Polls the Google Sheets plan register until a matching reviewer decision is recorded (approve/reject/revise) with the correct proposal hash and reviewer email, or until the review window times out.
  5. If approved, re-reads tasks and busy blocks from Google Sheets and aborts the export if the source snapshot has changed since the proposal was reviewed.
  6. If the proposal is still valid, creates an ICS calendar file for the scheduled tasks and uploads it to a private Google Drive folder (or reuses an existing identical export), then saves the final status and outcome details back to Google Sheets and drafts a final Gmail notification.

Setup

  1. Create a Google Sheets spreadsheet with three tabs named Tasks, BusyBlocks, and Plans, using the columns expected by the workflow (including decision, reviewed_hash, reviewer, and comment fields in Plans).
  2. Add Google Sheets credentials in n8n and set the spreadsheet ID in the workflow configuration values.
  3. Add Google Drive credentials and set a private output folder ID where the workflow can search for and upload exported ICS files.
  4. Add Gmail credentials and set the recipient email addresses (reportTo and reviewerEmail) used for review-request and outcome draft messages.
  5. Configure planning parameters such as timezone, workdays, working hours, horizonDays, dailyCapacityMinutes, polling/review timing, and whether to block exports when tasks are late, then disable demoMode to use live Google services.