Every 10 minutes
Sort lead replies in Gmail into Pipedrive follow-ups
Replies from Pipedrive contacts are tagged by intent and urgency, logged on their deal with a follow-up activity, and hot ones are flagged in Slack.
- Runs
- Every 10 minutes
- Apps
- Gmail, Pipedrive
- AI
- Yes, uses the built-in AI allowance
- Access
- Gmail read; Pipedrive write
Send this to your assistant
Create a ClickRuntime automation: every 10 minutes, check Gmail for replies from people in Pipedrive, classify intent and urgency with AI, add a note and an activity on their deal, and Slack the hot ones to #sales.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A founder doing her own sales sends follow-ups from Gmail and tracks deals in Pipedrive. Replies trickle in between meetings: a yes to a demo, a question about the contract, an out-of-office, a polite no. Keeping Pipedrive current means opening each email, finding the deal and adding a note and a task, and on busy days the pipeline quietly falls behind the inbox.
This automation reads new Gmail messages from people who are already in Pipedrive, decides what each reply means and how urgent it is, and logs it on the right deal with a follow-up activity. Replies that need a fast answer are also posted to Slack, so they do not wait until the evening.
What you get out of it
Pipedrive keeps up with your inbox
Every reply from a contact is noted on their deal, so the history is complete without manual logging.
Follow-ups are created for you
Each reply gets an activity that matches its intent, with a due date based on how urgent it is.
Urgent replies stand out
Hot replies are flagged in Slack so you can answer while the lead is still engaged.
Noise is ignored
Mail from people not in Pipedrive, newsletters and out-of-office replies do not create tasks.
Nothing is handled twice
Each message is remembered once it is processed, so repeat checks never add duplicate notes.
How it works
What happens, step by step
Every 10 minutes, ClickRuntime checks your Gmail inbox for new messages and stops straight away if there are none.
It looks each sender up in Pipedrive and skips anyone who is not a contact there.
AI reads the reply and decides what the person wants and how urgent it is, with a one-line summary.
A note and a matching follow-up activity are added to the person's deal in Pipedrive.
Urgent replies are also posted to #sales, and each message is remembered so it is only handled once.
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 Pipedrive
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
- 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 Pipedrive steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, state, notify, report_fetched
API = "https://api.pipedrive.com"
SCHEMA = {"type": "object", "properties": {"intent": {"type": "string"}, "urgent": {"type": "boolean"}, "summary": {"type": "string"}}}
@on_trigger
def run(event):
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
seen = set(state.get("seen") or [])
new = [m["id"] for m in gmail.users().messages().list(userId="me", q="in:inbox newer_than:1d").execute().get("messages", []) if m["id"] not in seen]
report_fetched(len(new))
if not new:
return {"new": 0}
headers = {"Authorization": f"Bearer {credentials.connection('pipedrive', 'work')}"}
for mid in new:
msg = gmail.users().messages().get(userId="me", id=mid, format="metadata", metadataHeaders=["From", "Subject"]).execute()
sender = {x["name"]: x["value"] for x in msg["payload"]["headers"]}.get("From", "").split("<")[-1].strip("> ")
found = http.get(f"{API}/api/v2/persons/search", headers=headers, params={"term": sender, "fields": "email", "exact_match": "true"}).json()["data"]["items"]
deals = http.get(f"{API}/api/v2/deals", headers=headers, params={"person_id": found[0]["item"]["id"], "status": "open"}).json()["data"] if found else []
if deals:
r = ai.generate(f"Classify this sales reply by intent and urgency:\n{msg['snippet']}", json_schema=SCHEMA, max_output_tokens=150).json
http.post(f"{API}/v1/notes", headers=headers, json={"deal_id": deals[0]["id"], "content": f"{r['intent']}: {r['summary']}"})
http.post(f"{API}/v1/activities", headers=headers, json={"subject": f"Follow up: {r['intent']}", "type": "email", "deal_id": deals[0]["id"]})
if r["urgent"]:
notify.slack(f"Hot reply from {sender} on {deals[0]['title']}: {r['summary']}", channel="#sales")
state.set("seen", (list(seen) + new)[-500:])
return {"new": len(new)}FAQ
Common questions
Does it only look at replies from people in Pipedrive?
What does the note on the deal contain?
What makes a reply hot?
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 Pipedrive brief by email before each sales meeting
Each morning you get one email with the deal stage, value, recent notes and past activities for everyone you're meeting that day.
See how it worksAdd website form leads to Pipedrive and email them a thank-you
Each form submission becomes a person and a deal in Pipedrive, and the lead gets a confirmation email from your Gmail straight away.
See how it worksLabel new emails automatically
New mail is sorted into labels like Inquiry, Invoice and Newsletter within minutes of arriving.
See how it worksKeep exploring
Set up “Sort lead replies in Gmail into Pipedrive follow-ups” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.
