Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every 10 minutes, ClickRuntime checks your Gmail inbox for new messages and stops straight away if there are none.

  2. It looks each sender up in Pipedrive and skips anyone who is not a contact there.

  3. AI reads the reply and decides what the person wants and how urgent it is, with a one-line summary.

  4. A note and a matching follow-up activity are added to the person's deal in Pipedrive.

  5. 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

RunsEvery 10 minutes
Sort lead replies in Gmail into Pipedrive follow-upstoday, 9:00Succeeded
Slack · #salesHot reply from dana@contoso.example on Contoso rollout: asks for the contract this week so they can sign before month end.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
classify_lead_replies_and_create_pipedrive_follow_ups.pyexample
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?
Yes. It checks each sender against Pipedrive by email and skips anyone who is not already a person there.
What does the note on the deal contain?
The intent, the urgency, a one-line summary of the reply and the email subject, so you can see what happened without opening Gmail.
What makes a reply hot?
The AI marks a reply as high urgency when the person asks for a meeting, a quote or a contract, or mentions a near deadline. Only those are posted to Slack.
What permissions does it need?
Gmail read; Pipedrive write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.