Quick overview
This workflow automates return merchandise authorizations (RMAs) for Shopify and WooCommerce by ingesting return requests, fetching order details, classifying return reasons with Google Gemini, checking prior return history in Google Sheets, then either auto-approving with customer/warehouse emails or routing to Slack for human approval.
How it works
- Receives a return request via a webhook, runs hourly to pull Shopify orders tagged
return-requested, or starts from a manual test trigger.
- Normalizes the intake payload and fetches the matching order from Shopify or WooCommerce to calculate order value, fulfillment status, and order age.
- Sends the customer’s reason text and item details to Google Gemini to classify the return reason into a predefined category with a confidence score.
- Reads the RMALog tab in Google Sheets to count the customer’s recent returns and flags the request for potential fraud review.
- Generates a unique RMA ID, assigns an inventory disposition (restock/quarantine/damaged) per item, and decides whether the return can be auto-approved based on value, category, fulfillment, time window, and fraud signals.
- If auto-approved (or later approved via the decision webhook), creates the return/refund in Shopify or WooCommerce, emails a shipping-label request to the warehouse via Gmail, emails the approval to the customer via Gmail, and appends the RMA record to Google Sheets.
- If human review is required, posts the RMA summary to Slack and logs a pending row in Google Sheets, then a separate approval webhook accepts an approved/rejected decision to either proceed with platform return creation or email the customer a rejection.
Setup
- Add credentials for Shopify (Admin API access token) and/or WooCommerce (REST API consumer key/secret) and fill in your store URL/domain values in the workflow configuration.
- Provide a Google Gemini API key in the workflow configuration to enable return-reason classification.
- Connect Google Sheets credentials, set the RMA spreadsheet ID, and ensure the document has an
RMALog sheet with columns matching the workflow’s appended fields (including date and customer_email).
- Connect Gmail credentials and set the warehouse email address and customer email sending permissions for your mailbox.
- Connect Slack credentials and set the target channel ID for ops review notifications.
- Copy the two webhook URLs (
/return-request and /return-decision) and configure your return form/helpdesk and approval source to POST the expected fields (including order_id, platform, and rma_id/decision).