Skip to content

The moment it happens

Celebrate won deals in Slack and ask finance to invoice

When a Pipedrive deal is marked Won, #wins gets the deal, value and products, and finance is asked to approve the invoice.

Runs
The moment it happens
Apps
Pipedrive, Slack
AI
Not needed
Access
Pipedrive token; chat:write

Send this to your assistant

Create a ClickRuntime automation: when a Pipedrive deal moves to Won, post the deal name, value and products to #wins and ask finance to approve the invoice.

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 rep closes a deal on Friday afternoon and marks it Won in Pipedrive. The team would like to know, and finance needs to know, because nothing gets invoiced until someone tells them what was sold and for how much. Too often that hand-over is a forwarded email on Monday, or a message that leaves out the products, and the invoice goes out days late.

This automation turns the Won status into the hand-over. The moment a deal is won, the team sees it in #wins with the value and line items, and finance gets everything they need to approve the invoice in the same post.

What you get out of it

  • Faster invoicing

    Finance learns about a win within seconds, with the products and amounts in front of them, so invoices go out the same day.

  • The whole team sees wins

    A post in #wins gives the rep credit and keeps everyone aware of what is closing.

  • Complete details every time

    The message is built from the deal record, so the value, currency and products are never left out or mistyped.

  • One clear approval step

    Finance has a single place to check and approve, rather than chasing details across emails.

  • Only real wins trigger it

    Edits to open deals are ignored, so the channel only hears about deals that have just moved to Won.

How it works

What happens, step by step

  1. When a deal is updated in Pipedrive, Pipedrive tells ClickRuntime straight away.

  2. It checks whether the deal has just moved to Won, and ignores every other change.

  3. It reads the deal's value, currency, owner and products from Pipedrive.

  4. A message is posted to #wins with the details and a request for finance to approve the invoice.

Before it runs live

  • Connect Pipedrive
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Celebrate won deals in Slack and ask finance to invoicejust nowSucceeded
Slack · #winsWon: Acme Retail annual plan - 18,400.00 EUR - 40 x Team seats @ 460.00. Finance: please approve the invoice for this deal.

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
  • 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 Pipedrive 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.
closed_won_deal_alert_with_invoice_approval.pyexample
from clickruntime import on_event, credentials, http, notify

API = "https://api.pipedrive.com"

@on_event
def handle(event):
    body = event.json or {}
    deal, previous = body.get("data") or {}, body.get("previous") or {}
    if deal.get("status") != "won" or previous.get("status") == "won":
        return {"ignored": True}
    headers = {"Authorization": f"Bearer {credentials.connection('pipedrive', 'work')}"}
    products = http.get(f"{API}/api/v2/deals/{deal['id']}/products", headers=headers).json().get("data") or []
    lines = "\n".join(f"- {p['quantity']} x {p.get('name') or p['product_id']} @ {p['item_price']:,.2f}" for p in products)
    notify.slack(
        f":tada: Won: {deal['title']} - {deal['value']:,.2f} {deal['currency']}\n{lines or '- no products listed'}\n"
        f"Finance: please approve the invoice for this deal.",
        channel="#wins")
    return {"deal": deal["id"], "products": len(products)}

FAQ

Common questions

Does it create the invoice itself?
This version posts the details for finance to approve and leaves the invoice to your accounting tool. You can ask your AI assistant to also create a draft invoice there once that tool is connected.
Will it post again if someone edits a won deal?
No. It only posts when the deal's status changes to Won, not on later edits to a deal that was already won.
Can finance get a separate message?
Yes. You can post the celebration to #wins and the approval request to a private #finance channel instead of one shared post.
What permissions does it need?
Pipedrive token; chat:write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
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 “Celebrate won deals in Slack and ask finance to invoice” from your assistant

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