Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / CRM & Sales Pipeline

CRM & Sales Pipeline

Qualify agency leads and draft email replies with OpenAI, HubSpot, Gmail and Slack

When an API call/webhook arrives, it updates your CRM with OpenAI / ChatGPT using Gmail, HubSpot, Slack.

What it does

## Agency lead research → explainable qualification → CRM and reply draft For: web/design/automation agencies receiving free-text enquiries. Turn a vague request into a researched brief, a traceable score and a draft an account manager can review. How it works: authenticated webhook → validation → check existing submission in HubSpot → fetch company homepage when domain is approved → AI structured brief → deterministic score → upsert contact → create associated deal → Gmail draft → Slack owner alert. Ordinary replays return the existing deal without creating another draft. Setup 1. Settings: agency name, services, budget threshold/currency, owner IDs, deal pipeline/stage IDs, Slack channel, model and allowed website domains. Empty allowlist skips research safely. 2. Connect webhook Header Auth, OpenAI, HubSpot App Token, Gmail OAuth2 and Slack credentials. Set the same HubSpot token on the native and HTTP nodes. Required scopes: crm.objects.contacts.read/write and crm.objects.deals.read/write. 3. Website POST JSON: requestId, name, email, company, website, message. Generate a UUID once per submission and preserve it on retries. The website backend must call this endpoint with the header credential; never put a shared secret in browser JavaScript. 4. Use internal HubSpot owner, pipeline and deal-stage IDs, not labels. No custom properties required. 5. Test a high-budget request, unknown budget, blocked/unavailable website, AI failure and replay of the same requestId. Customise: Settings contains weights, supported services and owner map. Prompts are editable in the AI stage. Research is only one homepage, not a full website audit. Explicit budget is in Settings currency; other/unknown currencies get no budget points. Outputs: existing/new deal ID, score with reasons, company summary and Gmail draft. No prospect email is automatically sent. Reliability limits: HubSpot search dedupe handles normal sequential retries, not simultaneous submissions (search indexing can lag). Serialize requests per requestId at your form backend. Failures after CRM writes can leave partial results; the error response and execution ID tell the owner to inspect and finish manually. Do not blindly retry a 502. Never claim exactly-once delivery.

The steps

  1. Agency lead webhook
  2. Settings
  3. Validate and normalise lead
  4. Valid submission?
  5. Return validation errors
  6. Find existing HubSpot enquiry
  7. Enquiry already exists?
  8. Return existing deal
  9. Website domain approved?
  10. Fetch company homepage
  11. Prepare research evidence
  12. Extract lead brief and draft
  13. Lead research chat model
  14. Lead brief schema

24 steps in total.

Similar automations