Overview
Many abandoned cart emails run on a fixed timer without checking whether the order completed. That can send reminders for purchases already finished, which hurts customer experience and sender reputation.
This workflow checks Magento first. One hour after abandonment, it asks whether the cart is still active. If the customer returned and completed checkout, the workflow exits. If not, Resend sends a recovery email with cart items and a checkout link.
The flow
The trigger provides email, name, cart ID, items, and total. A script formats items as an HTML list for the email body, then the workflow waits one hour.
After the wait, it authenticates with Magento, fetches the cart by ID, and checks three conditions:
API 404, is_active false, or items_count zero. Any of those means the cart is done and the
workflow exits. Otherwise Resend sends the recovery email.
Steps
- JavaScript (map_input): Validates the payload and pre-renders cart items as HTML for the email step.
- Wait (wait_1_hour): One hour delay before follow-up.
- HTTP (get_magento_token): Authenticates with the Magento admin API.
- HTTP (check_cart_status): Fetches the cart by ID with
includeFullResponseStringenabled so status codes are available. - JavaScript (evaluate_cart_state): Treats non-200 responses,
is_active: false, oritems_count: 0as recovered/completed. - Switch (cart_recovery_branch): Recovered carts exit. Abandoned carts continue to email.
- Resend (resend_abandoned_cart_1): Recovery email with items, total, and checkout button.
Why the Magento check matters
Sending after one hour without a status check is simpler, but a meaningful share of customers may already have checked out. Those customers receive unnecessary "you left items behind" emails.
The extra API calls reduce mistaken sends and help protect unsubscribe rates and sender reputation.
Setup
- Set
magento_base_urlin workflow variables (e.g.https://yourstore.com). - Add
magento_admin_usernameandmagento_admin_passwordto secrets. - Connect Resend and replace the
fromaddress with your verified sender. - Wire the trigger to your cart abandonment event. Most stores expose a JS hook or backend event.
Payload needs
email,firstName,cartId,cartTotal,cartCurrency,cartUrl, andcartItems(array of{name, qty, price}).
Worth knowing
Magento API behavior for completed carts can vary by version and configuration. This evaluator covers common cases. For custom setups, verify what your install returns after order conversion and adjust conditions if needed.