Skip to content

The moment it happens

Turn form leads into Salesforce leads and alert sales

Every form submission becomes a scored Salesforce lead, and the hot ones are posted to #sales straight away.

Runs
The moment it happens
Apps
Salesforce, Slack
AI
Optional
Access
api; chat:write

Send this to your assistant

Create a ClickRuntime automation: give me a link my lead form can send to. Score each lead from 1 to 10, create it in Salesforce if it isn't there already, and post leads scoring 8 or more 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 B2B software company gets demo requests through its website form. They land in an inbox, someone copies them into Salesforce at the end of the day, and the sales team learns about a request from a large prospect the next morning, after the prospect has already booked demos elsewhere.

This automation creates the Salesforce lead the moment the form is sent, skips people who are already leads, and posts the promising ones to #sales with a score and a reason.

What you get out of it

  • Leads are in Salesforce instantly

    No end-of-day copying, so reports and assignment rules see every lead as it arrives.

  • No duplicate leads

    If someone fills in the form twice, the existing lead is kept and no second record is created.

  • Hot leads get attention first

    Only leads scoring 8 or more are posted, so #sales stays focused.

  • Context travels with the lead

    The score and reason are saved in the lead's description, so whoever picks it up knows why it was rated that way.

How it works

What happens, step by step

  1. Your form sends each submission to the automation's link.

  2. It checks Salesforce for an existing lead with the same email and stops if there is one.

  3. AI scores the lead from 1 to 10 and gives a short reason.

  4. A new lead is created in Salesforce with the score in its description.

  5. Leads scoring 8 or more are posted to #sales with a link.

Before it runs live

  • Connect Salesforce
  • 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
Turn form leads into Salesforce leads and alert salesjust nowSucceeded
Slack · #salesHot lead (9/10): Morgan Hale at Tailspin Toys Wants a demo for 60 users and has budget approved for this quarter.

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 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.
new_lead_to_salesforce_with_slack_alert.pyexample
from clickruntime import on_event, credentials, http, ai, notify

INSTANCE = "https://yourcompany.my.salesforce.com"
API = f"{INSTANCE}/services/data/v61.0"
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "reason": {"type": "string"}},
          "required": ["score", "reason"]}

@on_event
def handle(event):
    form = event.json or {}
    email = form["email"].replace("'", "")
    headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
    found = http.get(f"{API}/query", headers=headers, params={
        "q": f"SELECT Id FROM Lead WHERE Email = '{email}' AND IsConverted = false LIMIT 1"}).json()["records"]
    if found:
        return {"lead": found[0]["Id"], "new": False}
    r = ai.generate(f"Score this lead 1-10 for fit and buying intent.\nCompany: {form.get('company')}\n"
                    f"Message: {str(form.get('message', ''))[:1500]}", json_schema=SCHEMA, max_output_tokens=100).json
    lead_id = http.post(f"{API}/sobjects/Lead", headers=headers, json={
        "Email": email, "FirstName": form.get("first_name"), "LastName": form.get("last_name") or email,
        "Company": form.get("company") or "Unknown", "LeadSource": "Web", "Rating": "Hot" if r["score"] >= 8 else "Warm",
        "Description": f"{form.get('message', '')}\n\nAI score {r['score']}/10: {r['reason']}"}).json()["id"]
    if r["score"] >= 8:
        notify.slack(f"Hot lead ({r['score']}/10): <{INSTANCE}/{lead_id}|{form.get('first_name')} {form.get('last_name')}> "
                     f"at {form.get('company')}\n{r['reason']}", channel="#sales")
    return {"lead": lead_id, "new": True, "score": r["score"]}

FAQ

Common questions

Which forms can send leads?
Any form or tool that can send a webhook with the person's email, name, company and message. Website builders, form tools and ad platforms usually can.
How does it decide a lead is hot?
AI scores fit and buying intent from the company and message. Leads scoring 8 or more are marked Hot in Salesforce and posted to Slack; you can change the cutoff.
What happens if the lead already exists?
If an unconverted lead with the same email exists, nothing new is created and no Slack post is sent.
What permissions does it need?
api; 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 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 “Turn form leads into Salesforce leads and alert sales” from your assistant

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