How to Build a Return Request Handler for Your Shopify Store

banner 19

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.

34CE0F6F EA3F 4805 B1DC C5340F4E2FE6

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.

313CAB61 D28F 4D8E 8FDA 59F2BFBD80AC 1 201 a

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.

9023764A F9B9 4E8C AF60 108F77F3B9BD 1 201 a

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.

E2344F40 A06D 4A13 8A2E AA1C8DFDC94B

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


34BB9937 8D27 4EB7 A6B8 D0ADE2A480ED
  • 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)
8A919D06 7E22 471C 99B2 BE5E7F5A8C06
  • Subject: Your Return Request — Approved ✅
  • Email content:
524DA406 B51F 4ECB A388 06EC36F4CD34

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:
8065A394 14C8 4A49 976B E15FFEAE9F74

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.

Other Guides

cogniagentvoice

How to Use the Phone Channel in CogniAgent for Voice Calls

Sep 30, 2026
5 min read
feature image 3.9MB

How to Build a Candidate Screening Application in CogniAgent: From Job Application to Qualification Conversation

Aug 17, 2026
9 min read
how-to-build-an-ai-receptionist-agent-in-cogniagent

How to Build an AI Receptionist Agent in CogniAgent

Jul 31, 2026
10 min read