Skip to content

The moment it happens

Send lead details to your Telegram bot and save them in HubSpot

Forward or type a lead's details to your Telegram bot and they're saved as a HubSpot contact, with a link sent back to you.

Runs
The moment it happens
Apps
HubSpot, Telegram
AI
Yes, uses the built-in AI allowance
Access
Telegram bot; contacts read+write

Send this to your assistant

Create a ClickRuntime automation: when I send lead details to my Telegram bot, pull out the name, email, phone and company, add or update the contact in HubSpot, and reply with a link to the record.

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

Salespeople meet leads everywhere: at a trade show stand, in a WhatsApp group, on a call while driving. The details end up as a note on their phone, and getting them into HubSpot means opening the app later, which often doesn't happen.

This lets you send the details to your own Telegram bot in whatever form you have them: a pasted email signature, a forwarded message or a quick typed note. AI picks out the fields, the contact is saved in HubSpot, and the bot replies with a link so you know it worked.

What you get out of it

  • Capture a lead in seconds

    Paste or type the details into a chat you already have open.

  • No form to fill in

    AI reads messy text such as email signatures or business card notes and finds the right fields.

  • Existing contacts are updated

    If the person is already in HubSpot, their record gets the new details instead of a duplicate.

  • Instant confirmation

    The bot replies with the contact's name and a link to the HubSpot record, so you can check it.

How it works

What happens, step by step

  1. You send a message with a lead's details to your Telegram bot.

  2. ClickRuntime receives it straight away and checks it came from an allowed chat.

  3. AI pulls out the name, email, phone, company and a short note from the message.

  4. The contact is added or updated in HubSpot, and the bot replies with what was saved and a link.

Before it runs live

  • Connect HubSpot
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Send lead details to your Telegram bot and save them in HubSpotjust nowSucceeded
Telegram · Sales botSaved Leo Grant (Contoso Freight), leo.grant@contosofreight.example https://app.hubspot.com/contacts/1234567/record/0-1/88214509

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 HubSpot and Telegram 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.
leads_from_telegram_into_hubspot.pyexample
from clickruntime import on_event, credentials, http, ai

ALLOWED_CHATS = {123456789}
PORTAL_ID = "1234567"
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ["name", "email", "phone", "company", "note"]}, "required": ["email"]}

def tg(chat_id, text):
    http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": chat_id, "text": text}).raise_for_status()

@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    chat = msg.get("chat", {}).get("id")
    if chat not in ALLOWED_CHATS or not msg.get("text"):
        return {"ignored": True}
    lead = ai.generate("Extract the lead's contact details from this text:\n" + msg["text"][:1500], json_schema=SCHEMA, max_output_tokens=150).json
    if "@" not in (lead.get("email") or ""):
        tg(chat, "I couldn't find an email address in that. Send it again with one?")
        return {"saved": False}
    props = {"email": lead["email"].lower(), "firstname": lead.get("name", ""), "phone": lead.get("phone", ""), "company": lead.get("company", "")}
    r = http.post("https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert", json={"inputs": [{"idProperty": "email", "id": props["email"], "properties": props}]},
                  headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"})
    r.raise_for_status()
    cid = r.json()["results"][0]["id"]
    tg(chat, f"Saved {props['firstname']} ({props['company']}), {props['email']}\nhttps://app.hubspot.com/contacts/{PORTAL_ID}/record/0-1/{cid}")
    return {"saved": True, "contact": cid}

FAQ

Common questions

What can I send to the bot?
Any text with the lead's details: a typed note, a pasted email signature or a forwarded message. It needs at least an email address to save the contact.
Can my whole team use the same bot?
Yes. Add each person's Telegram chat ID to the allowed list, and messages from anyone else are ignored.
What if the AI misses something?
The bot's reply shows the fields it saved, so you can spot a mistake and fix it in HubSpot, or send a corrected message.
What permissions does it need?
Telegram bot; contacts read+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 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 “Send lead details to your Telegram bot and save them in HubSpot” from your assistant

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