Draft a personalized outbound email for every new HubSpot lead
When a new contact lands in HubSpot, an agent writes a tailored first-touch email with Fireworks AI and stages it in Gmail for your rep to review.
When a new contact is created in HubSpot, I want an agent to draft a personalized first-touch outbound email with Fireworks AI and stage it for sales review. The agent never sends the email itself, a human always reviews and sends.
Trigger: a HubSpot webhook firing on new contact creation. The webhook delivers the contact's HubSpot ID.
Steps the agent should take:
1. Use HubSpot Get Contact to pull the contact by ID and read at least: first name, last name, email, job title, lifecycle stage, original source / UTM source, recent form submission notes, the associated company ID, and the contact owner ID.
2. If the contact has an associated company, use HubSpot Search Companies to pull industry, employee count or size band, and website / domain for that company.
3. Use HubSpot Get Owner to resolve the assigned rep's name and email so the email can be signed from them.
4. If BOTH job title and associated company are missing, stop the workflow and post a one-line Slack note saying the lead was skipped for lack of context. Never draft a generic email.
5. Call Fireworks AI Create Chat Completion with a Llama 3.1 70B class open-source model (for example accounts/fireworks/models/llama-v3p1-70b-instruct). Pass the lead and company context as a structured brief in the system / user messages. Ask for a tight 4 to 6 sentence outreach email that: opens with one concrete reason we are reaching out (their stated interest from form notes, role fit based on title, or a company signal like industry or size), is warm but specific, avoids fluff and avoids the word Dear, and ends with a single calendar ask. Also ask the model to return a separate short subject line tied to that personalization angle. Have the model return JSON with subject and body fields so we can parse cleanly.
6. Use Gmail Create a Draft to stage the email in the connected Gmail account. To = the lead's email. From = the connected Gmail user. Subject = the model's subject. Body = the model's body, with a signature line for the contact owner. Do not send it.
7. Use Slack Bot Send a Message to post a review ping in our sales channel (let me pick the channel when I set it up). The Slack message should include the contact's name, the company name and industry if known, the lead source, a preview of the email subject and the first 1 to 2 sentences of the body, and a link to the HubSpot contact record so the rep can open it in one click. Mention the contact owner by name in the message.
Other rules: don't retry an already-drafted lead if HubSpot redelivers the same webhook (dedupe by contact ID for the workflow run). If the Fireworks AI call fails or returns something that isn't parseable JSON, post a Slack failure note with the contact ID and stop, don't try to send anything to Gmail.
Additional information
What does this prompt do?
- Listens for new contacts in HubSpot and reads the lead's name, job title, source, recent form notes, and any linked company info.
- Uses Fireworks AI to write a tight four to six sentence outreach email that names one concrete reason for reaching out and ends with a single calendar ask.
- Drops the finished draft into Gmail so the assigned rep can give it a once-over and hit send.
- Posts a review ping in your sales Slack channel with the contact, company, a preview of the draft, and a link back to the HubSpot record.
- Skips the run when both job title and company are missing so reps never get a generic draft to clean up.
What do I need to use this?
- A HubSpot account with permission to read contacts and companies and to set up an outgoing webhook on new contact events.
- A Fireworks AI API key with access to a Llama 3.1 70B class open-source model.
- A Gmail login for the inbox where outbound drafts should land.
- A Slack workspace and a sales review channel for the bot to post into.
How can I customize it?
- Swap the model. Trade off speed and cost by pointing it at a smaller Llama or a different open-source model on Fireworks AI.
- Reshape the email. Change the tone, length, signature, or the type of ask (calendar booking, reply, demo request) by editing the writing brief.
- Change where the draft lands. Route the Gmail draft to a shared inbox, or alias it to whichever rep owns the contact in HubSpot.
- Pick the Slack channel and message format. Route hot leads to a different channel, or add buttons, owner @-mentions, or lead score lines.
- Tighten the skip rule. Add filters for lifecycle stage, lead source, or country so only leads that actually warrant outbound get a draft.
Frequently asked questions
Does this send the email automatically?
Do I need a paid HubSpot plan?
Why Fireworks AI instead of OpenAI?
Can the draft land in the assigned rep's own inbox?
What stops it from drafting a generic email?
Can I change the Slack channel or the message format?
Stop staring at blank outbound emails.
Connect HubSpot, Fireworks AI, Gmail, and Slack once, and every new lead shows up with a draft already written and waiting for a rep to send.