Log Aircall tags to Salesforce and draft the follow-up email in Gmail
When a rep tags an Aircall call demo-booked, follow-up, or not-interested, log the call in Salesforce and drop a ready-to-send follow-up into their Gmail Drafts.
Trigger: an Aircall webhook fires whenever a sales rep adds a tag to a call (for example "demo-booked", "follow-up", "contract-sent", or "not-interested"). The webhook payload carries the call id, the rep who owns the call, the tag name, and the caller's phone number.
Goal: turn each tagged call into (1) a logged Salesforce task with a clean recap, (2) an opportunity stage update when the tag maps to a pipeline move, and (3) a ready-to-send follow-up email sitting in the rep's Gmail Drafts folder. Do not send the email — leave the review-and-send step to the rep.
Step 1 — Pull the call context from Aircall. Use Retrieve Call Summary and Retrieve Call Transcription on the call id from the webhook. These come from Aircall's Conversation Intelligence add-on. If either returns 403 or empty, fall back to what's in the call record and note in the recap that the transcript wasn't available.
Step 2 — Find the matching Salesforce record by phone number. Normalize the caller's phone to E.164, then run Get Many Contacts with a SOQL filter on Phone / MobilePhone / OtherPhone / HomePhone. If nothing matches, run Get Many Leads with the same phone-number filter. If both come back empty, still create the Salesforce task and Gmail draft, but flag in the task body that no matching CRM record was found so the rep can create one.
Step 3 — Log a Salesforce task. Use Create Task with Subject set to the Aircall tag (verbatim, so a rep skimming the activity feed sees "demo-booked" or "not-interested" as the headline). WhoId points at the matched contact or lead. OwnerId is the rep who owned the Aircall call. Description contains a short recap: caller, phone number, call direction and duration, the Aircall summary, and 3-5 bullet takeaways drawn from the transcript. Status should be "Completed" since the call already happened; ActivityDate is today.
Step 4 — Advance the opportunity stage when the tag calls for it. Read the tag-to-stage mapping (this is a customization knob on the prompt page, so keep it configurable). Suggested defaults: demo-booked -> Discovery, demo-completed -> Qualification, proposal-sent or contract-sent -> Proposal/Price Quote, closed-won -> Closed Won, not-interested or unqualified -> Closed Lost. If the tag is in the mapping, use Get Many Opportunities to find the open opportunity linked to the matched contact/lead (filter by AccountId or ContactId, IsClosed = false, ordered by most recent). Then call Update Opportunity with the new StageName. If there is no open opportunity, skip the stage change and note this in the task recap.
Step 5 — Draft the follow-up email in the rep's Gmail. Use Gmail Create a Draft on behalf of the rep who owned the Aircall call (their Gmail account, not a shared inbox). Address it to the contact/lead's email if one is on the Salesforce record; if no email is available, still create the draft but leave the To field blank and mention that in the task recap. Subject line should reflect the tag: for demo-booked, something like "Great talking — here's the demo recap"; for follow-up, "Following up on our call"; for contract-sent, "Contract on its way"; for not-interested, a graceful "Thanks for your time" note. Body should be a warm, personalized message: a one-line thank-you, 2-3 bullet points of what was discussed pulled from the transcript, the specific next steps the rep committed to on the call, and the rep's normal sign-off. Keep it tight — 120-180 words. Encode the RFC 2822 message as base64url per the Gmail API's Create a Draft contract. Do not call Send a Draft; leave the message sitting in Drafts so the rep can review, edit, and send.
Guardrails: never send email automatically — always stop at draft. If the tag isn't recognized in the mapping, still do steps 1-3 and 5, just skip step 4. Log a one-line summary of what happened (task id, whether an opportunity was moved, draft id) so the rep can trace the automation.
Additional information
What does this prompt do?
- Listens for Aircall tag events so every disposition tag triggers the same rep-facing follow-through automatically.
- Pulls the Aircall call summary and transcription and matches the caller to a Salesforce contact or lead by phone number.
- Logs a Salesforce task with the tag as the subject and a clean recap in the body, and advances the linked opportunity's stage when the tag maps to a pipeline move like demo-booked or contract-sent.
- Writes a personalized follow-up email to the caller straight into the rep's Gmail Drafts folder so they only have to review and hit send.
What do I need to use this?
- An Aircall account with Conversation Intelligence enabled so calls come with a summary and transcript.
- A Salesforce account where the rep works contacts, leads, and opportunities.
- A Gmail account for the sales rep whose drafts folder should hold the follow-up email.
How can I customize it?
- Change which Aircall tags map to which Salesforce opportunity stages (demo-booked to Discovery, contract-sent to Proposal, and so on).
- Adjust the tone, length, or signature of the drafted follow-up email to match how your reps normally write.
- Decide whether unmatched callers should be skipped, logged against a fallback record, or created as a new Salesforce lead.
Frequently asked questions
Does the follow-up email get sent automatically?
What if the caller isn't already in Salesforce?
Which Aircall tags trigger it?
Do I need Aircall's Conversation Intelligence add-on?
Which rep's Gmail account gets the draft?
Related templates
Turn every tagged call into a logged Salesforce task and a drafted email.
Give your reps back the ten minutes after every call that they spend writing recaps and typing follow-ups.