π¬ Draft and approve Clio time entries from Google Calendar with Claude
β‘ 2 views Β· π¬ Document Extraction & Analysis
Description
Quick Overview
This workflow runs daily to turn tagged Google Calendar events into draft Clio time entries by generating safe billing narratives with Anthropic Claude, then emails an approval digest and logs approved entries to Clio via a two-step webhook confirmation.
How it works
- Runs every morning at 7am to build yesterdayβs UTC date range and fetch events from Google Calendar.
- Filters to timed calendar events whose titles contain a bracketed matter reference (for example, β[2026-CH-042] β¦β) and calculates duration and metadata for each billable event.
- Searches Clio for a matching matter and either flags the event for manual handling if no exact display number match is found or prepares an Anthropic Claude prompt from the eventβs metadata.
- Sends the prompt to Anthropic Claude to generate a short billing narrative, then validates the response with a safety self-check, keyword scanning, and a 200-character limit.
- Builds a single digest email that groups ready-to-approve drafts (with approval links) and items needing attention, logs the digest via an external compliance sub-workflow, and sends it via SMTP.
- When an attorney clicks an approval link, serves a review page via webhook and requires a POST confirmation before creating the time entry in Clio.
- On valid confirmation, creates the Clio time entry, logs the approval via the compliance sub-workflow, and returns a success (or error) confirmation page.
Setup
- Add Google Calendar OAuth2 credentials and set the calendar ID variable (for example,
FIRM_ATTORNEY_CALENDAR_IDor leave it asprimary). - Add Clio OAuth2 credentials and set
CLIO_BASE_URLandFIRM_ATTORNEY_CLIO_USER_IDfor the user who should own the time entries. - Add an Anthropic API key using HTTP Header Auth (
x-api-key) so the workflow can call the Messages API. - Add SMTP credentials and set
FIRM_ATTORNEY_EMAILandFIRM_FROM_EMAILfor the daily digest delivery. - Set
N8N_PUBLIC_URLand ensure the two webhook endpoints (/webhook/approve-time-entryand/webhook/confirm-time-entry) are publicly reachable for approval and confirmation links. - Set
GUARDRAIL_WORKFLOW_IDto the compliance logging sub-workflow you want to execute for digest and approval audit entries.
π Nodes Used
Send Email, HTTP Request, Webhook, Execute Sub-workflow, Schedule Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File