Guides

How to Build an Abandoned Cart Recovery Workflow (E-Commerce Example: Part 2)

date-icon
Feb 26, 2026
clock-icon
4 min read

Welcome to the second part of our e-commerce workflow. In the previous guide, we learned how to create an automated workflow from your Shopify account that triggers the moment a customer adds an item to the cart and leaves it abandoned. In this part, we will enrich the workflow by monitoring the abandoned cart and sending 2 tailored offers to reactivate the customer and complete the purchase.

Let’s start building! Before we start, be sure to complete the previous steps in our previous guide.

Step 7 (continue): Set the Merge Node — Bring All Paths Together

After the Google Sheets branches, add a Merge node to rejoin into a single flow. Name this node “Merge — After Log_in.” The Merge node will unite all of the branches and continue the workflow once the previous nodes have successfully executed.

Step 8: Set the Variable Node — Increment the Attempt Counter

Click “Add Step” and select Set Variable. Select recovery_attempt and set the value to:

{{recovery_attempt + 1}}

Name this node “Set Variable — Increment Attempt.”

Step 9: Set the Condition Node — Attempts Remaining?

Add a Condition node in Expression mode:

completed_at == null && recovery_attempt < 3

  • True Branch → Sleep 24 hours → back to the LLM node to generate the next email with a stronger offer. On attempt 2, include a 10% discount; on attempt 3, include a 15% discount with a 48-hour deadline.
  • False Branch → The cart has either been recovered or all 3 attempts have been exhausted. Proceed to log the final outcome to Google Sheets.

You can also describe the logic in AI mode using simple language.

Step 10: Set the Action in App Node — Log to Google Sheets

Connect the False Branch to an Action in App node and choose where you want to log the information. The False Branch is reached when either the cart was recovered or all 3 attempts have been exhausted. You can log the information in any CRM of your preference, be it Google Sheets or HubSpot CRM. Choose the appropriate action such as “Batch Update” or “Add a New Row” in the Google Sheets integration. Or simply check these guides to learn how to log the information in Google Sheets and in HubSpot.

Step 11: Set LLM Node — Generate your Recovery Emails

To put it simply — the logic is the following. In your Condition node, you check the number of abandoned cart recovery attempts and log the information in your CRM if the cart is recovered and there is no need to follow up. Let 24 hours pass if the cart is still abandoned and start generating the email. We will not go into this in detail, because you can easily customize it to your preferences. All you need to know is:

  • User Instructions: Name the role of the LLM.
  • System Instructions: Give the role its direction — how should it act? Write the details of the offer you want to present to the customers.
  • Structured Output: Map out the necessary fields such as email address, email body, and email subject to receive a clear output.

Check these guides to learn how you can tune your LLM node.

Step 12: Send your Recovery Emails & Log the Information

This step is the same as what we already covered in the previous part. Once your emails with the special offer are generated, send them and log the information! Check this guide to reproduce the steps!

Push start! You now have a fully automated workflow connected to your Shopify account. The moment a customer abandons their cart, you automatically follow up with tailored offers, guiding them toward completing their purchase.

In the next guides, we will explore how you can automate your e-commerce processes with CogniAgent and start benefiting from day one!