Log Telegram client chats into HubSpot every few hours

Capture Telegram conversations with clients as HubSpot notes and follow-up tasks, so deal context stops getting trapped in chat.

Agentic Task
Telegram (User Account / MTProto)HubSpotSalesOperationsData SyncNotifications & Alerts

Build me an agent workflow that runs on a cron schedule every few hours (default: every 3 hours) and logs my Telegram client conversations into HubSpot so deal context stops getting trapped in chat.

Trigger: cron. Default cadence every 3 hours, configurable. The workflow should remember the timestamp of the last successful run and only look at Telegram messages newer than that watermark.

Integrations: Telegram (User Account / MTProto) for reading my chats, and HubSpot for the CRM writes.

Step 1 — Pull recent Telegram activity. Use Telegram's List Dialogs operation to enumerate my direct-message conversations (skip groups, supergroups, channels, and bots). For each DM that has had a new message since the last-run watermark, call Telegram's Get Chat History to fetch the messages newer than the watermark, oldest-first. Cap history per chat at the last 200 messages so a long-quiet chat that suddenly explodes doesn't blow up the run.

Step 2 — Decide who counts as a client. For each Telegram peer with new activity, resolve their identity: prefer the phone number Telegram exposes on the peer (only available for saved contacts), then fall back to first name + last name. Call HubSpot's Search Contacts operation to find a matching contact, searching by phone number first and by name only as a fallback. If no confident match is found, skip the chat entirely — non-client DMs are not logged.

Step 3 — Summarize and log a note. For each matched HubSpot contact, summarize what was discussed in the new messages: 3 to 6 short bullets covering topics, decisions, blockers, and anything that sounds like a number, date, or named deliverable. Include the time window the summary covers. Then call HubSpot's Create Note operation to attach the summary to that contact's record. Include a short header line like "Telegram conversation — <date range>" so reps can scan the timeline.

Step 4 — Create a follow-up task only when warranted. If the agent detects an unresolved question, an explicit ask, or a commitment from either side (e.g. "can you send the contract?", "I'll follow up Monday with pricing"), call HubSpot's Create Task operation associated with the same contact. The task subject should be a one-line action (e.g. "Send pricing follow-up to Anna per Telegram thread"), with a due date of 1 business day out by default, and assigned to the contact's HubSpot owner if one exists. Do not create tasks for casual chat, social messages, or already-answered questions.

Skip rules: ignore group chats, channels, bots, my own Saved Messages, and any DM where no HubSpot contact match was found. Never send a Telegram message — this workflow only reads from Telegram and writes to HubSpot.

Configurable knobs the user should be able to edit later: schedule cadence, the matching strategy (phone only vs. phone with name fallback vs. restrict to contacts on open deals), default task due date offset, default task assignee, and whether to include specific named group chats in addition to DMs.

Output for each run: a short structured log of how many DMs were scanned, how many HubSpot contacts were matched, how many notes were created, and how many tasks were created, so I can spot-check that it's working.

Additional information

What does this prompt do?
  • Every few hours, an agent scans your Telegram direct messages for new activity with people who are already contacts in HubSpot.
  • For each matched contact, it writes a short note on their HubSpot record summarizing what was discussed since the last run.
  • When the agent spots an open question, an explicit ask, or a commitment from either side, it also creates a follow-up task with a due date.
  • Random non-client DMs are ignored, so your CRM only fills up with real deal context.
What do I need to use this?
  • A Telegram account that you actually use to talk with clients.
  • A HubSpot login with permission to read contacts and create notes and tasks.
  • Your client contacts already in HubSpot, ideally with phone numbers filled in so the agent can match them to Telegram.
How can I customize it?
  • Change how often it runs, from every couple of hours to twice a day or once a day.
  • Adjust how the agent decides what counts as a client, for example phone number match only, name fallback, or limit to contacts on open deals.
  • Tune when a follow-up task gets created, what the default due date looks like, and which salesperson it gets assigned to.

Frequently asked questions

Will this work if my clients haven't shared their phone number on Telegram?
Telegram only shows a contact's phone number to you if you've already saved them in your phone book. The agent uses that phone to look up the matching HubSpot record. If a client isn't in your contacts, the agent falls back to matching by name, and skips the chat if there's no confident match.
Does this read group chats or just direct messages?
Just direct messages by default. Group chats are noisy and rarely map to a single HubSpot contact, so the agent ignores them. You can tell the agent to include specific groups if an active deal lives in one.
Will every contact get a note on every run?
No. The agent only writes a note for contacts who actually sent or received new messages since the previous run. Quiet days produce nothing in HubSpot.
Can I keep the agent from creating tasks for small talk?
Yes. The agent only creates a follow-up task when it spots an unresolved question, an explicit ask, or a commitment from either side. Casual back and forth just gets logged as a note.
Is this safe to run on my personal Telegram account?
The agent reads your chats with a session you generate once and can revoke any time from Telegram's Settings then Devices menu. It never sends messages on your behalf, it only reads recent activity and writes the summary into HubSpot.

Stop losing deal context in Telegram threads.

Connect Telegram and HubSpot once, and Geni keeps every client conversation logged on the right contact record.