Skip to main content

Abandoned cart reminder

This workflow alerts the e-commerce team as soon as a cart is abandoned, then publishes the follow-up on a Google Pub/Sub topic consumed by the CRM.

Loading the diagram…

The need​

The e-commerce team must be alerted as soon as a non-empty cart is abandoned, so that it can organize the customer follow-up via the CRM. Each follow-up must be published on the CRM's Google Pub/Sub topic to avoid sending several to the same customer. The workflow never addresses the end customer directly: the e-commerce team relays the follow-up through a dedicated CRM tool.

What the workflow does​

  1. Abandoned cart — the Trigger node captures the cart.abandoned event. The cart (customer address, number of items) arrives in data.
  2. Non-empty cart? — the Condition node checks that the cart contains at least one item (data.itemsCount > 0) to avoid following up on empty carts.
  3. Notify the e-commerce team — the Send an email node alerts the e-commerce team (internal team), which organizes the customer follow-up via the CRM; the workflow does not address the customer directly.
  4. Defer the tracking (J+1) — the Wait node suspends the execution for one day before tracking.
  5. Publish the follow-up (CRM) — the Send Google Pub/Sub node publishes cart_reminder_sent on the CRM's Pub/Sub topic to avoid multiple follow-ups.

What you need​

Construction​

Copy the workflow definition and paste it into the editor (the Trigger node is recreated automatically, it is not in the snippet):

[
{
"id": "cond-105",
"name": "Non-empty cart?",
"config": {
"type": "CONDITION",
"conditionCode": "return data.itemsCount > 0;",
"conditions": [
{
"value": true,
"next": "email-105"
},
{
"value": false,
"next": null
}
]
},
"parents": [
"trigger"
],
"position": {
"x": 0,
"y": 200
}
},
{
"id": "email-105",
"name": "Notify the e-commerce team",
"config": {
"type": "SEND_EMAIL",
"to": [
"ecommerce@boutique-france.fr"
],
"subject": "Abandoned cart: follow-up needed",
"content": "The cart of {{ data.customerEmail }} contains {{ data.itemsCount }} unfinished item(s) — plan a follow-up via the CRM.",
"sendAsHtml": true
},
"parents": [
"cond-105"
],
"position": {
"x": 0,
"y": 400
},
"next": "wait-105"
},
{
"id": "wait-105",
"name": "Defer the tracking (J+1)",
"config": {
"type": "WAIT",
"time": 86400000
},
"parents": [
"email-105"
],
"position": {
"x": 0,
"y": 600
},
"next": "event-105"
},
{
"id": "event-105",
"name": "Publish the follow-up (CRM)",
"config": {
"type": "SEND_EVENT",
"provider": {
"type": "GCP_PUBSUB",
"projectId": "mon-projet-crm",
"topicId": "cart-reminders"
},
"body": "{\"event\": \"cart_reminder_sent\", \"email\": \"{{ data.customerEmail }}\"}"
},
"parents": [
"wait-105"
],
"position": {
"x": 0,
"y": 800
}
}
]

Check that it works​

The trigger payload must expose customerEmail and itemsCount, otherwise the {{ data… }} fields will remain empty. Deploy the workflow, start an execution on an abandoned cart and check the traces to verify the notification to the e-commerce team and the cart_reminder_sent event published on the CRM's Pub/Sub topic.

Variations​

  • Avoid duplicate follow-ups: the event published on the topic makes it possible to know whether a follow-up has already been sent for this cart; add a condition on this marker to limit it to one follow-up per customer.
  • Internal recipient: the email goes to the e-commerce team, not to the end customer; the customer follow-up itself should be handled by a dedicated CRM tool.

See the reference


See also: Examples and integrations