Log Telegram client chats into HubSpot every few hours

By General Input

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

Integrations

  • Telegram (User Account / MTProto)
  • HubSpot

Type

Agentic Task

Categories

  • Sales
  • Operations

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.

Related prompts

Explore more prompts
Turn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRMLead response desk with a running clock on every new leadApprove Lusha enrichment field by field before HubSpot saves it