Daily
Build a daily timesheet from your calendar and sent email
Each evening you get a timesheet of the day grouped by client, built from your meetings and sent emails.
- Runs
- Daily
- Apps
- Gmail, Google Calendar
- AI
- Yes, uses the built-in AI allowance
- Access
- Calendar read; Gmail gmail.modify
Send this to your assistant
Create a ClickRuntime automation: every evening, combine today's calendar events and sent emails into a timesheet grouped by client and email it to me.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A freelance consultant bills by the hour across five clients. At the end of the month she tries to rebuild her time from memory and her calendar, and the short calls and email work that never made it into a meeting are lost from the invoice.
A timesheet drafted each evening from what actually happened that day captures time while it is fresh, and she only has to correct it rather than reconstruct it.
What you get out of it
Bill for the time you worked
Short calls and email threads are listed alongside meetings, so small pieces of work stop disappearing from invoices.
Two minutes a day, not an afternoon a month
Checking a draft each evening is quicker than rebuilding four weeks of work from memory.
Clear records if a client asks
Each entry is tied to a meeting or email, which makes it easy to explain a line on an invoice.
See where your week goes
Grouping by client shows which accounts take more time than they pay for.
How it works
What happens, step by step
Every evening ClickRuntime reads today's events from your Google Calendar and the emails you sent today.
It matches each one to a client using the email addresses involved.
AI groups the entries by client, estimates time for email work and writes a short description for each line.
The timesheet is emailed to you so you can check it and copy it into your invoicing.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Google Calendar
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Gmail and Google Calendar steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timedelta, timezone
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from clickruntime import on_trigger, credentials, notify, ai
CLIENTS = {"acme.example": "Acme", "northwind.example": "Northwind"}
@on_trigger
def run(event):
creds = Credentials(credentials.connection("google", "work"))
start = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0)
events = build("calendar", "v3", credentials=creds, cache_discovery=False).events().list(calendarId="primary",
timeMin=start.isoformat(), timeMax=(start + timedelta(days=1)).isoformat(), singleEvents=True).execute()["items"]
gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users()
sent = gmail.messages().list(userId="me", q="in:sent newer_than:1d").execute().get("messages", [])
lines = [f"Meeting {e.get('summary')} {e['start'].get('dateTime')}-{e['end'].get('dateTime')} "
f"{[a['email'] for a in e.get('attendees', [])]}" for e in events]
for m in sent[:40]:
to = next(h["value"] for h in gmail.messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["To"]).execute()["payload"]["headers"])
lines.append(f"Email to {to}")
sheet = ai.generate(f"Clients by domain: {CLIENTS}. Emails count 10 min each. Build a timesheet grouped by client:\n" + "\n".join(lines),
max_output_tokens=700).text
notify.email_me(f"Timesheet {start:%d %b}", sheet)
return {"events": len(events), "emails": len(sent)}FAQ
Common questions
How does it know which client an event belongs to?
How is email time estimated?
Can it write to a spreadsheet instead?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a research brief before every external meeting
An hour before any meeting with people outside your company, you get an email about who they are, recent news and what you last discussed.
See how it worksDraft follow-ups for prospects who have gone quiet
Each morning you get ready-to-send follow-up drafts in Gmail for prospects who have not replied in a week, plus a slot in your calendar to send them.
See how it worksSend an agenda the day before Sprint Planning
Attendees get an agenda built from your notes the day before each Sprint Planning meeting.
See how it worksKeep exploring
Set up “Build a daily timesheet from your calendar and sent email” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.