Every 5 minutes
Post new comments on Google Drive files to Slack
New comments and replies on Google Docs, Sheets and Slides in a Drive folder are posted to a Slack channel every 5 minutes with the quoted text and a link.
- Runs
- Every 5 minutes
- Apps
- Google Drive, Slack
- AI
- Not needed
- Access
- drive.readonly; chat:write
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, post new comments and replies on files in my Drive folder "Client deliverables" to #reviews with the author, the file name, the quoted text and a link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Feedback on documents lives in Google comments, but the people who need to act on it live in Slack. Drive's comment emails go to the file owner and whoever was mentioned, so the rest of the team only sees feedback when they open the file.
This automation checks a folder every 5 minutes, finds files that changed, reads comments and replies added since the last run and posts each one to a Slack channel with the commenter, the file, the text being discussed and a link straight to the document.
Agencies use it to see client feedback on deliverables as it comes in, and content teams use it to follow review rounds on drafts without opening each doc.
What you get out of it
Feedback where the team is
Comments reach the whole channel, not only the file owner's inbox.
Context included
The quoted text the comment is attached to is shown, so the message makes sense without opening the file.
Replies and resolutions too
Follow-up replies and "resolved" actions are posted, showing when a point is closed.
Only changed files are read
Files untouched since the last check are skipped, which keeps each run quick.
Any Google file type
Comments on Docs, Sheets, Slides and PDFs in Drive all appear.
How it works
What happens, step by step
Every 5 minutes the automation lists files in the folder that changed since the last check.
For each one it reads comments and replies added since then.
Each new comment is posted to Slack with who wrote it, the file, the text it was attached to and a link.
Resolved comments are shown as resolved, so the channel shows progress too.
Before it runs live
- Connect Google Drive
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
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
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Google Sheets
- Combine it with other Google Drive and Slack steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, state, notify
import datetime
FOLDER_ID = "1AbCdEfDeliverablesId"
CHANNEL = "#reviews"
def drive(path, **params):
resp = http.get(f"https://www.googleapis.com/drive/v3{path}", params=params,
headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"})
resp.raise_for_status()
return resp.json()
@on_trigger
def run(event):
now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.000Z")
since = state.get("since")
state.set("since", now)
if since is None:
return {"baseline": now}
files = drive("/files", q=f"'{FOLDER_ID}' in parents and trashed = false and modifiedTime > '{since}'",
fields="files(id,name,webViewLink)", pageSize=100)["files"]
posted = 0
for f in files:
comments = drive(f"/files/{f['id']}/comments", startModifiedTime=since, pageSize=100,
fields="comments(content,createdTime,resolved,author(displayName),quotedFileContent,replies(content,createdTime,action,author(displayName)))")["comments"]
for c in comments:
quote = (c.get("quotedFileContent") or {}).get("value")
q = f"> {quote[:200]}\n" if quote else ""
if c["createdTime"] > since:
notify.slack(f"💬 {c['author']['displayName']} on *{f['name']}*\n{q}{c['content'][:1500]}\n{f['webViewLink']}", channel=CHANNEL)
posted += 1
for r in c.get("replies", []):
if r["createdTime"] > since:
text = "marked this resolved" if r.get("action") == "resolve" else r["content"][:1500]
notify.slack(f"↳ {r['author']['displayName']} on *{f['name']}*: {text}\n{f['webViewLink']}", channel=CHANNEL)
posted += 1
return {"posted": posted}FAQ
Common questions
Do people need to @mention someone for it to show up?
Are comments in subfolders included?
Can it post into a channel per client?
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
Alert Slack when a Google shared drive file is deleted
Files moved to trash or removed from a Google shared drive are posted to a Slack channel every 10 minutes with who removed them and the file name.
See how it worksScreen CVs in Drive and post the shortlist to Slack
Every CV saved to your Candidates folder gets a score against the job and a short summary in your hiring channel.
See how it worksSummarise new Drive videos in Slack
Every video added to your Recordings folder gets a short written summary and link posted to your team's Slack channel.
See how it worksKeep exploring
Set up “Post new comments on Google Drive files to Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.