Drafts an introduction email to each new HubSpot contact, written from what your CRM already knows about them.

UsesClaudeGmailHubSpot

Introduce yourself to new CRM contacts

ScheduleRun every day.Run every day.
ValuesSet aboutYou to blank.Set aboutYou to blank.
ValuesSet senderName to blank.Set senderName to blank.
ValuesSet lookBackDays to 3.Set lookBackDays to 3.
ValuesSet maxContacts to 10.Set maxContacts to 10.
ValuesSet sendAutomatically to blank.Set sendAutomatically to blank.
Dates & TimesMove the current date and time by 0 minus lookBackDays days and save it as windowStart.Move the current date and time by 0 minus lookBackDays days and save it as windowStart.
HubSpotHubSpotFind contacts created since windowStart. Save it as newContacts.Find contacts created since windowStart. Save it as newContacts.
ValuesSet contacts to newContacts.results.Set contacts to newContacts.results.
Decisions & LoopsIf contacts is emptyIf contacts is empty
Yes
Decisions & LoopsStop and report a problem: HubSpot's answer had no list of contacts in it, so nobody could be checked this run. Check that the HubSpot connection is still working, then run it again.Stop and report a problem: HubSpot's answer had no list of contacts in it, so nobody could be checked this run. Check that the HubSpot connection is still working, then run it again.
No
No steps
ListsReverse the order of contacts and save it as oldestFirst.Reverse the order of contacts and save it as oldestFirst.
ValuesSet waitingCount to 0.Set waitingCount to 0.
ValuesSet introductionProblems to an empty list.Set introductionProblems to an empty list.
ListsStart an empty list and save it as introducedThisRun.Start an empty list and save it as introducedThisRun.
Decisions & LoopsFor each contact in oldestFirst:For each contact in oldestFirst:
ValuesSet crm to contact.properties.Set crm to contact.properties.
ValuesSet rawEmail to crm.email.Set rawEmail to crm.email.
Decisions & LoopsIf rawEmail is emptyIf rawEmail is empty
Yes
ValuesShow in the output: Skipped a new HubSpot contact: the record has no email address on it..Show in the output: Skipped a new HubSpot contact: the record has no email address on it..
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
TextMake rawEmail lowercase and save it as emailAddress.Make rawEmail lowercase and save it as emailAddress.
Decisions & LoopsIf not emailAddress is a valid email addressIf not emailAddress is a valid email address
Yes
ValuesShow in the output: Skipped a new HubSpot contact: '@emailAddress' is not a valid email address.Show in the output: Skipped a new HubSpot contact: '@emailAddress' is not a valid email address.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf introducedThisRun contains emailAddressIf introducedThisRun contains emailAddress
Yes
ValuesShow in the output: Skipped emailAddress: that address appears more than once in this batch of new contacts and has already been handled.Show in the output: Skipped emailAddress: that address appears more than once in this batch of new contacts and has already been handled.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
GmailGmailFind email matching 'from:emailAddress OR to:emailAddress'. Save it as previousMail.Find email matching 'from:emailAddress OR to:emailAddress'. Save it as previousMail.
Decisions & LoopsIf previousMail.email isn't emptyIf previousMail.email isn't empty
Yes
ValuesShow in the output: Skipped emailAddress: your mailbox already holds a message to or from this address, so they are not somebody to introduce yourself to.Show in the output: Skipped emailAddress: your mailbox already holds a message to or from this address, so they are not somebody to introduce yourself to.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf the length of introducedThisRun is greater than or equal to maxContactsIf the length of introducedThisRun is greater than or equal to maxContacts
Yes
ValuesAdd 1 to waitingCount.Add 1 to waitingCount.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
ListsAdd emailAddress to the end of introducedThisRun and save it as introducedThisRun.Add emailAddress to the end of introducedThisRun and save it as introducedThisRun.
ListsAdd Email address: emailAddress to the end of a list of [] and save it as crmFacts.Add Email address: emailAddress to the end of a list of [] and save it as crmFacts.
Decisions & LoopsIf crm.firstname isn't empty and crm.firstname isn't blankIf crm.firstname isn't empty and crm.firstname isn't blank
Yes
ListsAdd First name: crm.firstname to the end of crmFacts and save it as crmFacts.Add First name: crm.firstname to the end of crmFacts and save it as crmFacts.
No
No steps
Decisions & LoopsIf crm.lastname isn't empty and crm.lastname isn't blankIf crm.lastname isn't empty and crm.lastname isn't blank
Yes
ListsAdd Last name: crm.lastname to the end of crmFacts and save it as crmFacts.Add Last name: crm.lastname to the end of crmFacts and save it as crmFacts.
No
No steps
Decisions & LoopsIf crm.jobtitle isn't empty and crm.jobtitle isn't blankIf crm.jobtitle isn't empty and crm.jobtitle isn't blank
Yes
ListsAdd Job title: crm.jobtitle to the end of crmFacts and save it as crmFacts.Add Job title: crm.jobtitle to the end of crmFacts and save it as crmFacts.
No
No steps
Decisions & LoopsIf crm.company isn't empty and crm.company isn't blankIf crm.company isn't empty and crm.company isn't blank
Yes
ListsAdd Company: crm.company to the end of crmFacts and save it as crmFacts.Add Company: crm.company to the end of crmFacts and save it as crmFacts.
No
No steps
Decisions & LoopsIf crm.website isn't empty and crm.website isn't blankIf crm.website isn't empty and crm.website isn't blank
Yes
ListsAdd Website: crm.website to the end of crmFacts and save it as crmFacts.Add Website: crm.website to the end of crmFacts and save it as crmFacts.
No
No steps
Decisions & LoopsIf crm.lifecyclestage isn't empty and crm.lifecyclestage isn't blankIf crm.lifecyclestage isn't empty and crm.lifecyclestage isn't blank
Yes
ListsAdd Lifecycle stage in our CRM: crm.lifecyclestage to the end of crmFacts and save it as crmFacts.Add Lifecycle stage in our CRM: crm.lifecyclestage to the end of crmFacts and save it as crmFacts.
No
No steps
Decisions & LoopsIf crm.hs_analytics_source isn't empty and crm.hs_analytics_source isn't blankIf crm.hs_analytics_source isn't empty and crm.hs_analytics_source isn't blank
Yes
ListsAdd How they first found us: crm.hs_analytics_source to the end of crmFacts and save it as crmFacts.Add How they first found us: crm.hs_analytics_source to the end of crmFacts and save it as crmFacts.
No
No steps
TextJoin crmFacts with a new line and save it as crmSummary.Join crmFacts with a new line and save it as crmSummary.
Decisions & LoopsIf a step below fails, save the error as introductionErrorIf a step below fails, save the error as introductionError
Try
ClaudeClaudeAsk Claude: 'You are writing the subject line of a first introduction email to somebody who has just been added to our CRM. They have never heard from us before.Ask Claude: 'You are writing the subject line of a first introduction email to somebody who has just been added to our CRM. They have never heard from us before. Who the email is from, in their own words: aboutYou Everything our CRM records about this contact: crmSummary Write one subject line of at most nine words. Use only the facts above - never imply a meeting, a past conversation, a referral or a shared contact that is not stated there. Reply with the subject line and nothing else: no quotation marks, no explanation.'. Save it as subjectResponse. Maximum response length: 60
TextReplace with " in subjectResponse.response_text and save it as subject.Replace with " in subjectResponse.response_text and save it as subject.
ClaudeClaudeAsk Claude: 'You are writing a short first introduction email to somebody who has just been added to our CRM. They have never heard from us before, so this is a genuine introduction and not a follow-up.Ask Claude: 'You are writing a short first introduction email to somebody who has just been added to our CRM. They have never heard from us before, so this is a genuine introduction and not a follow-up. Who the email is from, in their own words: aboutYou Everything our CRM records about this contact: crmSummary Write the body of the email: - Open with their first name if the CRM gives one, and with 'Hello,' if it does not. - Say who you are and what you do, in the sender's own terms. - Draw on what the CRM already knows about them - their role, their company, or how they first came to us - where it is genuinely relevant. Use at most one such detail; reciting everything we hold on somebody reads as surveillance rather than interest. - Never invent a meeting, a referral, a shared contact or anything else the facts above do not state. If the CRM knows almost nothing about them, write a short honest introduction rather than guessing. - Close with one low-pressure question or offer. - Keep it under 150 words and sign off as senderName. Reply with the body of the email and nothing else - no subject line, no explanation.'. Save it as bodyResponse. Maximum response length: 700
TextTrim bodyResponse.response_text and save it as introduction.Trim bodyResponse.response_text and save it as introduction.
Decisions & LoopsIf subject is blank or introduction is emptyIf subject is blank or introduction is empty
Yes
ListsAdd emailAddress: the AI's introduction came back empty, so nothing was drafted to the end of introductionProblems and save it as introductionProblems.Add emailAddress: the AI's introduction came back empty, so nothing was drafted to the end of introductionProblems and save it as introductionProblems.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf sendAutomatically in lowercase is yesIf sendAutomatically in lowercase is yes
Yes
GmailGmailSend an email to emailAddress.Send an email to emailAddress. Subject: subjectintroduction
ValuesShow in the output: Sent an introduction to emailAddress.Show in the output: Sent an introduction to emailAddress.
No
GmailGmailDraft an email to emailAddress.Draft an email to emailAddress. Subject: subjectintroduction
ValuesShow in the output: Left a draft introduction to emailAddress in Gmail for you to read and send.Show in the output: Left a draft introduction to emailAddress in Gmail for you to read and send.
On error
ListsAdd emailAddress: introductionError.message to the end of introductionProblems and save it as introductionProblems.Add emailAddress: introductionError.message to the end of introductionProblems and save it as introductionProblems.
ListsCount the items in introducedThisRun and save it as preparedCount.Count the items in introducedThisRun and save it as preparedCount.
Decisions & LoopsIf introductionProblems isn't emptyIf introductionProblems isn't empty
Yes
TextJoin introductionProblems with a new line and save it as problemList.Join introductionProblems with a new line and save it as problemList.
Decisions & LoopsStop and report a problem: Some introductions could not be prepared. Each one is tried again on the next run while the contact is less than 'lookBackDays' old:Stop and report a problem: Some introductions could not be prepared. Each one is tried again on the next run while the contact is less than 'lookBackDays' old: problemList.
No
No steps
Decisions & LoopsIf waitingCount is greater than 0If waitingCount is greater than 0
Yes
Decisions & LoopsFinish the run: Introductions prepared: preparedCount. New contacts still waiting: waitingCount - they are picked up on the next run; raise 'maxContacts' to handle more in a day.Finish the run: Introductions prepared: preparedCount. New contacts still waiting: waitingCount - they are picked up on the next run; raise 'maxContacts' to handle more in a day.
No
No steps
Decisions & LoopsFinish the run: Introductions prepared: preparedCount.Finish the run: Introductions prepared: preparedCount.