Skip to main content
Related agents: Lead management (HubSpot).

What it does

When the call to the lead ends, the workflow reads the transcript, decides which of three outcomes it falls into, and in all three updates the contact in HubSpot and sends them an email: It’s a post-call workflow: it runs in the background once the call has already ended, so it never adds delay to the conversation.

How it works

What you need

Getting started

1

Copy the template

From the Workflows section, open the template catalog and copy it. The workflow is created disabled. You can also create it from the Lead management (HubSpot) agent.
2

Fill in the HubSpot connections

Select your HubSpot connection in the four steps that use it: the contact lookup and the three contact updates.
3

Set which field to search the contact by

In the Find contact in HubSpot step, select “Contact Information: Email” under First Search Property Name. With that, the step looks up the contact by the email that arrives in the mail dynamic variable.That variable doesn’t set itself. You have to pass it when making the call, in the Dynamic Variables field of the Outbound call trigger (Webhook) workflow, which ships empty in the template.If your leads don’t provide an email, use phone instead and the contact’s phone number. In that case the Gmail steps are left with no recipient: remove them or replace them with another notification.
4

Choose which properties to write in HubSpot

The three Update contact steps ship with Object Properties empty: as they are, they find the contact and write nothing to it.Update each one with the properties you want to fill in.
5

Fill in the Gmail connections and the emails

Select your Gmail connection in the three email steps. Then, in each one, adapt the generic body text to your tone. In the confirmation one, keep the piece’s result: it’s what prints the agreed date exactly as it was said on the phone.
6

Publish the workflow and assign it to the agent

Publish the workflow and make sure it’s enabled. If you didn’t create it from the Lead management (HubSpot) agent, add it now from the Workflows section of the agent you want to link it to; it’ll show up with the Post-call label.
7

Test it with all three outcomes

Make three test calls: one closing an appointment, one without closing it, and one where you don’t pick up. Check that it falls into the right branch and that the matching email arrives. You can follow the run step by step in the call traces.

Before publishing

  • Without the mail variable, the workflow runs but does nothing useful. The HubSpot lookup finds no contact and the emails go out with no recipient. It’s the most likely thing to trip up when setting up this template for the first time: check the corresponding step.
  • If the contact isn’t in HubSpot, it doesn’t get created. The update steps target the search’s first result; if there isn’t one, they fail. They’re set to continue on failure, so the workflow keeps going and the email still goes out, but nothing is recorded in your CRM. If you want it created, add a contact-creation step.
  • The update steps write nothing out of the box. Until you fill in Object Properties, the workflow doesn’t change any data in HubSpot. See the corresponding step.
  • The classification is done by a language model. The two extraction steps use gpt-4 on the transcript and can get it wrong, especially if the appointment was left half-agreed or the lead said something ambiguous. Treat the result as a good approximation, not a verified fact.
  • The appointment date is free text. appointment_datetime comes in natural language (for example, Thursday March 6th at 10:00). It’s fine for reading in an email, not for dropping into a date-type property without converting it first.
  • The actual appointment lives in the calendar, not here. It’s created by the create_appointment workflow during the call. This workflow only reads the transcript to report what happened: if the agent said a time but create_appointment failed, the confirmation email still goes out.
  • The emails don’t forgive a failure. All three Gmail steps are set to stop the workflow on failure, unlike the HubSpot ones.
  • Only one branch runs. Both routers are in first-match mode, so every call falls into exactly one outcome.

Next Steps

Lead management

The agent that makes the call.

Outbound call trigger (Webhook)

Where the mail variable is defined.

Post-call workflows

How workflows that run when the call ends work.

The Diga Piece

The data the Call Finished trigger receives.