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
- Agency lead webhook
- Settings
- Validate and normalise lead
- Valid submission?
- Return validation errors
- Find existing HubSpot enquiry
- Enquiry already exists?
- Return existing deal
- Website domain approved?
- Fetch company homepage
- Prepare research evidence
- Extract lead brief and draft
- Lead research chat model
- Lead brief schema
24 steps in total.
Similar automations
CRM & Sales PipelineQualify, enrich, and route B2B inbound leads with GPT-4o, HubSpot, and Slack10 stepsCRM & Sales PipelineManage Loan Agency Leads with Twilio, Sheets and Drive8 stepsAI Agents & AssistantsQualify and route inbound leads with GPT-4.1, HubSpot, Google Calendar and Slack38 stepsContent Writing & GenerationAd Agency in a Box for Facebook Ads51 steps