Skip to main content

Analyze Google Calendar patterns with OpenAI and send Gmail weekly digest

Workflow preview

Workflow preview
100%
Analyze Google Calendar patterns with OpenAI and send Gmail weekly digest preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow runs on a weekday schedule or via webhook, pulls events from Google Calendar, analyzes meeting and focus time patterns, generates optimization advice with OpenAI, then ...

Best for

  • Personal Productivity automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.googlecalendar, n8n-nodes-base.code, n8n-nodes-base.filter, n8n-nodes-base.merge

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Analyze Google Calendar patterns with OpenAI and send Gmail weekly digest
Workflow name
Analyze Google Calendar patterns with OpenAI and send Gmail weekly digest

Quick Overview

This workflow runs on a weekday schedule or via webhook, pulls events from Google Calendar, analyzes meeting and focus-time patterns, generates optimization advice with OpenAI, then emails a digest through Gmail and appends the results to Google Sheets.

How it works

  1. Runs every weekday morning on a schedule or starts on demand from an incoming webhook request.
  2. Sets a 7-day lookback and 7-day lookahead window and fetches all matching events from Google Calendar.
  3. Normalizes event fields, then excludes all-day, private/OOO, cancelled, and zero-duration events and classifies the remaining events into categories like deep work, collaboration, 1:1s, admin, and external.
  4. Aggregates the events and computes metrics such as meeting hours, focus hours, peak meeting hour, heaviest day, back-to-back chains, fragmentation score, top recurring meetings, and largest available free blocks.
  5. Sends the computed metrics to OpenAI (GPT-4.1-mini) to generate a concise weekly calendar optimization report.
  6. Formats a final report payload with a calculated health score, emails the digest via Gmail, appends the report data to Google Sheets, and returns a JSON success response for webhook runs.

Setup

  1. Connect Google Calendar OAuth2 credentials and select the calendar ID to analyze.
  2. Connect an OpenAI API key and confirm the model selection (gpt-4.1-mini) fits your account and usage limits.
  3. Connect Gmail OAuth2 credentials and replace the recipient address in the email step.
  4. Connect Google Sheets OAuth2 credentials, replace YOUR_SHEET_ID (and sheet/tab name if needed) in the Google Sheets append request URL, and ensure the target sheet exists with the expected columns.
  5. If using the manual trigger, copy the webhook URL from n8n and call it with a POST request from your preferred tool.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Daily Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 7 - Webhook - Manual Trigger

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1.1

Block 8 - Set Analysis Window

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Fetch Google Calendar Events

Type / Role
n8n-nodes-base.googleCalendar - googleCalendar
Config choices
Version 1.1

Block 10 - Python - Normalize Events

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Filter Valid Events

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 12 - Python - Classify Events

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Aggregate All Events

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 14 - Python - Pattern Detection Engine

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - AI - Generate Optimization Insights

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.6

Block 16 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 17 - JS - Format Final Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Send Digest Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 19 - Log to Google Sheets

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 20 - Webhook Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 21 - Wait For Result

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

3. Summary Table

Workflow Analyze Google Calendar patterns with OpenAI and send Gmail weekly digest
Complexity advanced
Nodes 21
Categories Personal Productivity, AI Summarization
Author Oneclick AI Squad
Published 10 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16230/16230.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Analyze Google Calendar patterns with OpenAI and send Gmail weekly digest do?

Quick Overview This workflow runs on a weekday schedule or via webhook, pulls events from Google Calendar, analyzes meeting and focus time patterns, generates optimization advice with OpenAI, then ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Summarization use case.