Guides

How to Build a Return Request Handler for Your Shopify Store

date-icon
Mar 12, 2026
clock-icon
3 min read

This workflow automatically receives customer return requests, uses AI to classify the reason and decide whether to approve or reject it, then sends the customer a personalised email with the decision and next steps — all without any manual review for the most common cases.

What You Will Build

A 5-node no-code automation that receives return submissions from a Tally form, classifies them with AI, and sends the correct email response to the customer automatically.

Prerequisites

  • CogniAgent account with a blank workflow open
  • Tally.so account (free plan works)
  • Tally return form embedded on your Shopify store page
  • Email account connected to CogniAgent

Workflow Architecture

[Webhook]

[LLM] ← Classifies reason + decides APPROVED or REJECTED

[Condition] ← Checks the decision
↓ TRUE ↓ FALSE
[Action in App] [Action in App]
Approval Email Rejection Email

Open your CogniAgent account and let’s start building!

Step 1 — Create Your Return Form in Tally

Go to tally.so and create a new form with the following fields:

  • Full name
  • Email address
  • Order number
  • Return reason
  • Description of the issue

Once the form is ready, click Publish in the top right corner. The form must be published before you can connect a webhook.

Step 2 — Webhook Node

Add a Webhook node in CogniAgent and copy the URL it generates.

Now go back to Tally, open your published form, and click the Integrations tab. Find Webhooks and click Connect. Paste your CogniAgent webhook URL and save.

From this point on, every return form submission will instantly send data to your workflow.

Step 3 — LLM Node: Classify and Decide

Add an LLM node connected after the Webhook. This node reads the customer’s message, classifies the return reason, and decides whether to approve or reject it based on your rules.

Step 4 — Condition Node

Add a Condition node connected after the LLM. This node routes the workflow to the correct email based on the AI decision.

Set the Mode to AI and type the following in the Condition field:

The decision is APPROVED
  • TRUE branch → connects to the Approval Email node
  • FALSE branch → connects to the Rejection Email node

Step 5 — Action in App: Approval Email (TRUE branch)

Add an Action in App node connected to the TRUE branch. Select Send Email and fill in the fields, mapping out the data:

  • To: {{tally_request.body.email}} (your webhook data)

  • Subject: Your Return Request — Approved ✅
  • Email content:

Step 6 — Action in App: Rejection Email (FALSE branch)

Add a second Action in App node connected to the FALSE branch. Select Send Email and fill in the fields:

  • To: {{tally_request.body.email}} (your webhook data)
  • Subject: Your Return Request — Update
  • Email content:

Testing

Submit a test entry in your Tally form using the description “I received the wrong item” and check that:

  1. Webhook node receives the form data
  2. LLM node returns structured output decision
  3. Condition node routes to the TRUE branch
  4. Approval email is delivered to the test email address

Then test a rejection by submitting “I changed my mind” and verify the FALSE branch fires correctly.

Debug common issues:

  • Webhook not receiving data → make sure the form is published and the URL is saved in Tally integrations
  • LLM returns wrong decision → check that the system instructions field with the variables is mapped correctly
  • Email not delivered → re-authenticate your email connection in CogniAgent

Check out our other guides and follow the step-by-step instructions to recreate the automations for your e-commerce business.