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.
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
You send a message with a lead's details to your Telegram bot.
ClickRuntime receives it straight away and checks it came from an allowed chat.
AI pulls out the name, email, phone, company and a short note from the message.
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
Build your own
Need it to work differently?
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
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?
Can my whole team use the same bot?
What if the AI misses something?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Add new customers to HubSpot and get a Telegram alert
Every new sign-up or sale is added to HubSpot as a contact and you get a Telegram message straight away.
See how it worksGet AI follow-up suggestions for your deals on Telegram
Each morning, deals sitting at Proposal sent get a suggested follow-up message delivered to you on Telegram.
See how it worksGet error alerts with a plain-English explanation
When one of your jobs or systems fails, #ops gets the error and a one-line guess at the cause, without the same error twice in an hour.
See how it worksKeep exploring
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.