Skip to content

Weekly

Get a Friday list of deals that break your sales rules

Every Friday, each rep sees which of their open deals have missing fields, an out-of-date close date or a discount over your limit.

Runs
Weekly
Apps
Salesforce, Slack
AI
Optional
Access
api read; chat:write

Send this to your assistant

Create a ClickRuntime automation: every Friday, check open Salesforce opportunities for a discount over 20%, no next step, no amount, or a missing or past close date, and post the problems in #sales grouped by owner.

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 sales manager's forecast is only as good as the data behind it. Close dates from last month, deals with no amount, a 35% discount nobody approved: each is small, but together they make the pipeline report unreliable, and the manager ends up checking deals one by one before every forecast call.

This automation does that check every Friday against a short list of rules and posts what it finds to Slack, grouped by owner, so reps can tidy their deals before Monday's forecast.

What you get out of it

  • A forecast you can trust

    Missing amounts and stale close dates are fixed weekly, not discovered on the call.

  • Discount policy is visible

    Deals above your discount limit are flagged every week, so approvals happen before the quote goes out.

  • Reps fix their own deals

    Each owner sees their own list with links, so the manager isn't chasing individual records.

  • Rules are plain and consistent

    Every deal is checked the same way, every week, with no judgement calls.

How it works

What happens, step by step

  1. Every Friday the automation reads your open opportunities in Salesforce.

  2. It checks each deal against your rules: discount limit, next step, amount and close date.

  3. Deals with problems are grouped by owner.

  4. Each owner's list is posted to #sales, with what's wrong and a link to each deal.

Before it runs live

  • Connect Salesforce
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)

What you get

RunsWeekly
Get a Friday list of deals that break your sales rulestoday, 9:00Succeeded
Slack · #salesSam Patel: 2 deals to tidy before Monday - Fabrikam data platform: discount 32%, no next step

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

  • 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 Google Sheets
  • Combine it with other Salesforce and Slack 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.
weekly_deal_hygiene_audit.pyexample
from collections import defaultdict
from datetime import date
from clickruntime import on_trigger, credentials, http, notify
INSTANCE = "https://yourcompany.my.salesforce.com"
API = f"{INSTANCE}/services/data/v61.0"

def soql(headers, q):
    return http.get(f"{API}/query", headers=headers, params={"q": q}).json()["records"]
MAX_DISCOUNT = 20  # percent
@on_trigger
def run(event):
    headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
    opps = soql(headers, "SELECT Id, Name, Owner.Name, CloseDate, NextStep, Amount, Discount__c FROM Opportunity "
                         "WHERE IsClosed = false LIMIT 500")
    by_owner = defaultdict(list)
    for o in opps:
        issues = []
        if (o["Discount__c"] or 0) > MAX_DISCOUNT:
            issues.append(f"discount {o['Discount__c']}%")
        if not o["NextStep"]:
            issues.append("no next step")
        if not o["CloseDate"] or o["CloseDate"] < date.today().isoformat():
            issues.append("close date missing or in the past")
        if not o["Amount"]:
            issues.append("no amount")
        if issues:
            by_owner[o["Owner"]["Name"]].append(f"- <{INSTANCE}/{o['Id']}|{o['Name']}>: {', '.join(issues)}")
    for owner, lines in by_owner.items():
        notify.slack(f"*{owner}*: {len(lines)} deals to tidy before Monday\n" + "\n".join(lines), channel="#sales")
    return {"checked": len(opps), "flagged": sum(len(v) for v in by_owner.values())}

FAQ

Common questions

Where does the discount come from?
From a discount percentage field on the opportunity, called Discount__c in the example. If you keep discounts on quote lines, ask your AI assistant to read them from there.
Can I add my own rules?
Yes. Common additions are a required competitor field, a minimum amount for a stage, or a next step updated in the last 14 days.
Can it check free-text fields such as the next step?
Yes. Ask for an AI check, for example that the next step names a date and an action rather than just "follow up".
What permissions does it need?
api read; chat:write. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do 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 “Get a Friday list of deals that break your sales rules” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.