Turn X buyer-intent posts into HubSpot leads every 2 hours

Every two hours during business hours, scan X for people saying they're shopping, switching, or fed up, and file the real ones as HubSpot leads with a tweet note.

Agentic Task
TwitterAPI.ioHubSpotSalesMarketingLead EnrichmentResearch & MonitoringNotifications & Alerts

Build me an agent workflow that turns public X (Twitter) buyer-intent posts into qualified leads in HubSpot. It should run on a cron, every 2 hours during business hours (default 8am to 6pm ET, Monday through Friday).

Inputs I configure:

1. INTENT_QUERIES: a list of advanced search queries that signal buying intent for my category. Examples: "looking for a [category] tool", "anyone recommend a [category]", "fed up with [competitor]", "switching from [competitor]", "alternatives to [competitor]", "moving off [competitor]". I'll provide the real category and competitor names.

2. ICP_FILTER: minimum follower count (default 100), required bio keywords (e.g. founder, head of, operations, marketing), allowed locations (default any), excluded keywords (e.g. memes, parody, bot).

3. MAX_CANDIDATES_PER_RUN: hard cap on how many authors the agent will fully profile and qualify per run (default 25). This is the main credit-budget control.

4. LOOKBACK_HOURS: how far back to look on each run (default 3 hours, so we overlap the 2-hour cadence and never miss a tweet).

Each run, the agent should:

Step 1. For each query in INTENT_QUERIES, call TwitterAPI.io Advanced Search with the query plus a recency filter (within LOOKBACK_HOURS) and English-language filter. Collect the union of tweets across all queries. Deduplicate by tweet author so we never enrich the same handle twice in one run.

Step 2. Triage the raw matches in-agent (no external calls) and drop obvious noise: retweets, replies that are jokes, tweets that are clearly memes or sarcasm, tweets that link to a tweet from a known competitor's own marketing handle. Keep only first-person statements that look like a real person asking, complaining, or switching. Order what remains by simple intent strength (shopping > switching > general complaint) and take the top MAX_CANDIDATES_PER_RUN.

Step 3. For each surviving candidate author, call TwitterAPI.io Get User Info and Get User Profile About to pull bio, follower count, account creation date, location, verified status, and the extended "about" details. Apply ICP_FILTER: discard if follower count below the threshold, bio matches excluded keywords, account is less than 30 days old, or the profile reads as bot/parody/automation.

Step 4. For each qualified author, write a short intent classification ("shopping", "switching from [competitor]", or "frustrated with [competitor]") and a 1-to-2-sentence suggested talking point for the SDR that references the actual tweet content. Do not invent facts about the person beyond what's in their profile and the tweet.

Step 5. Push to HubSpot. Use Batch Upsert Contacts keyed on a custom property storing the Twitter handle (e.g. twitter_handle), so re-runs update rather than duplicate. Set lifecycle stage to "lead", set a custom source property (e.g. lead_source_detail) to "twitter-intent", and fill firstname, lastname, jobtitle (from bio if available), city/country (from profile location), and the twitter_handle property. Then call Create Note for each contact with the tweet text, the tweet URL, the intent category, the matched query, and the suggested talking point, associated to the new contact.

Step 6. Discard everything that didn't qualify rather than logging it to HubSpot. Low-signal matches stay out of the CRM. Keep a brief in-run summary of counts (tweets scanned, candidates considered, qualified, written) so I can see budget usage in the workflow log.

Guardrails:

Be strict about qualification. Most matches are noise, and a polluted CRM is worse than no CRM update. When in doubt, drop the candidate. Never make up an email address; if the profile doesn't expose one, leave email blank and rely on the twitter_handle property as the unique key. Respect the MAX_CANDIDATES_PER_RUN cap exactly, even if more strong matches appear, so credit spend stays predictable.

Additional information

What does this prompt do?
  • Watches X for the exact phrases your buyers use when they're shopping, switching tools, or complaining about a competitor.
  • Checks each poster's profile to filter out bots, jokes, and accounts that are not your ICP before anything touches your CRM.
  • Files the qualified ones as new HubSpot contacts with a custom source of twitter-intent and a lifecycle stage of lead.
  • Attaches a note to each contact with the original tweet, a link, the intent category, and a short suggested talking point your SDR can use to open the conversation.
What do I need to use this?
  • A HubSpot account where you can create contacts and notes.
  • A TwitterAPI.io account with enough credit balance to cover roughly one search per intent phrase plus a couple of profile lookups per candidate, every two hours.
  • A short list of buyer-intent phrases that match your category, your competitors, and the words your best customers used when they first showed up.
How can I customize it?
  • Edit the list of intent phrases. Add your category, your competitors, and switching language. Keep it tight, three to eight phrases tend to convert best.
  • Tighten or loosen the ICP filter. Set a minimum follower count, required bio keywords, allowed locations, and a maximum number of candidates to fully qualify per run.
  • Change the cadence or business hours window. Run hourly during launch weeks, or only weekday mornings if your team handles outreach the same day.

Frequently asked questions

Will this flood my CRM with random or junk accounts?
No. Before anything is written to HubSpot, the agent checks each author's bio, follower count, and location, and discards bots, jokes, and accounts that do not look like your ICP. Only the survivors become contacts.
What phrases should I actually search for?
Three categories work well. Shopping intent like 'looking for a CRM' or 'anyone recommend a CRM'. Switching intent like 'moving off HubSpot' or 'leaving Salesforce'. Frustration like 'fed up with Pipedrive' or 'cancelling our Mailchimp'. Use your own category and competitor names.
How do I keep the cost under control?
Two knobs. Keep the intent phrase list short and specific, and cap the number of authors the agent fully profiles per run. Generic phrases match thousands of unrelated tweets and burn through credits with no payoff.
Where do the new leads show up in HubSpot?
As new contacts with lifecycle stage 'lead' and a custom source value of 'twitter-intent', each with a note attached that holds the original tweet, a link, the intent category, and a suggested opener for your SDR.
Can I send the qualified leads somewhere besides HubSpot?
Yes. You can swap or add destinations, for example posting the same brief to a Slack channel or appending to a Google Sheet. The X qualification logic stays the same, only the final write step changes.

Stop letting buyer-intent tweets go cold.

Connect X and HubSpot once, and this agent quietly turns public buying signals into warm leads your SDRs can open with context.