How to Automate Shopify Order Status, Returns & Refunds Without Paying Per-Ticket Fees
The Verdict Up Front
At 1,200 support resolutions a month, the per-ticket helpdesk model is the most expensive line in your Shopify stack. Gorgias Pro with AI overages runs about $1,200/mo, and Intercom Fin lands at $1,188/mo plus $29/seat.
A self-hosted n8n workflow wired straight into the Shopify GraphQL API does the same order-status, return, and refund work for about $25-$28/mo flat - a $10/mo VPS plus $12-$18/mo of LLM API tokens, or roughly $0.02 per resolved ticket. That is a 97% cost reduction at 1,200 monthly tickets, and the resolution data stays in your database.
Self-Hosted n8n + Shopify GraphQL API
Best for: Shopify operators at 1,000+ support tickets/mo who want per-ticket fees gone
At 1,200 order-status, return and refund resolutions a month, a self-hosted n8n workflow on the Shopify GraphQL Admin API costs ~$25-$28/mo - a $10/mo VPS plus $12-$18/mo of LLM tokens, or ~$0.02 per resolved ticket. Gorgias Pro with AI overages runs ~$1,200/mo and Intercom Fin runs $1,188/mo plus $29/seat, both billing per resolution on top of a tier or a seat. The self-hosted stack is a 97% cost reduction and keeps the resolution data, at the price of running your own VPS and hardening the refund mutations for idempotency.
Run n8n Cloud InsteadWhat This Builds
This blueprint is an 11-node n8n workflow that answers "where is my order," opens return labels, and issues refunds without a human touching the ticket. It reads live order and fulfillment data from the Shopify GraphQL Admin API, classifies each inbound message, then either replies with tracking or fires the matching mutation.
Tested & Verified: December 2026.
The outcome is a support queue that resolves the three highest-volume Shopify tickets - WISMO, returns, and refunds - on its own. At 1,200 tickets a month and roughly 4 minutes of manual triage per ticket, that is about 80 hours of operator time returned to the business.
- VPS (2 vCPU, 4 GB, self-hosted n8n): $10/mo
- LLM API tokens (classification + reply drafting): ~$12-$18/mo
- Shopify GraphQL Admin API: included with your Shopify plan
- Total: ~$25-$28/mo flat = ~$0.02 per resolved ticket
- Compare: Gorgias Pro + AI overages ~$1,200/mo; Intercom Fin $1,188/mo + $29/seat
The Architecture
The workflow runs as one n8n pipeline. A Shopify webhook plus a support-form webhook start it, a GraphQL node pulls the order, a classifier labels intent, a switch fires the right action, and a reply node answers the customer while a logger writes the outcome.
Node-by-node, this is what runs on every ticket:
- Webhook (Shopify + support form): receives the customer message and the order reference.
- Normalize (Set): extracts order ID, customer email, and message body.
- Shopify Order Query: fetches fulfillment status, tracking, and line items.
- Shopify Returns Query: checks for an existing return so you never double-open one.
- LLM Classifier: labels the ticket WISMO / return / refund.
- Switch (3 outputs): routes to the matching branch.
- Policy Guardrail (IF): checks the order is paid and inside the return window.
- Shopify Refund Mutation: creates the return, generates the label, or issues the refund.
- Merge: collects the result from every branch.
- Reply (Gmail/Slack/helpdesk): sends tracking or the refund confirmation.
- Log Outcome (Postgres): stores ticket type, action, and cost.
Per-Run Cost Math
The bill is dominated by tokens, not infrastructure, and token spend scales linearly with ticket volume. The table below is the real math at 1,200 tickets a month.
| Stack | Monthly cost | Per resolved ticket | Per-ticket fees | Data ownership |
|---|---|---|---|---|
| Self-hosted n8n + Shopify GraphQL | ~$25-$28 | ~$0.02 | None | You own it |
| Gorgias Pro + AI overages | ~$1,200 | ~$1.00 | Yes - per AI resolution | Vendor |
| Intercom Fin | $1,188 + $29/seat | ~$0.99 | Yes - per resolution + seats | Vendor |
At 1,200 tickets the $10 VPS is roughly 36-40% of the self-hosted bill and the $12-$18 token spend is the rest. The Gorgias and Intercom columns are about 43x higher because you pay per resolution on top of a ticket tier or a seat.
- Self-hosted: $25-$28 / 1,200 = ~$0.02 per ticket
- Gorgias Pro + AI: ~$1,200 / 1,200 = ~$1.00 per ticket
- Intercom Fin: $1,188 / 1,200 = ~$0.99 per resolution, plus $29/seat
- Savings vs Gorgias at 1,200/mo: ~$1,172-$1,175 = ~97% reduction
The Hidden Limit Nobody Mentions
The self-hosted route has no per-ticket fee, but it has two ceilings the per-ticket vendors hide inside their bill. Both live in the mutation path, so design for them before you switch the webhook to live.
The Shopify GraphQL Admin API is leaky-bucket rate-limited - a cost budget that refills over time - and a burst of 1,200 tickets can exhaust it. The sharper trap: refund and return mutations are not idempotent. If a node times out and n8n retries, you can issue the same refund twice. Every mutation branch needs an idempotency key (order ID plus an action hash) and a check-before-write query - that is exactly what the Returns Query and Policy Guardrail nodes are for.
The per-ticket model you are replacing also hid the classification cost. Once you own the pipeline, a refund request misread as WISMO sends the wrong reply and reopens the ticket. Budget for a human-review queue: route anything the classifier scores below your confidence threshold to a person instead of auto-resolving it, or the 97% figure quietly becomes a 90% one once you count rework.
Step-by-Step Setup
- Provision a 2 vCPU / 4 GB VPS and install n8n with Docker. Point a subdomain at it and enable HTTPS.
- In Shopify admin, create a custom app with read_orders, read_fulfillments, write_returns, and write_refunds scopes. Copy the Admin API token into an n8n credential.
- Import the workflow.json from The Blueprint section below.
- Add credentials: Shopify GraphQL, your LLM provider, and a reply channel (Gmail, Slack, or your helpdesk).
- Point the Shopify webhook at your n8n webhook URL for order-fulfillment events, and wire your support form to the same webhook.
- Set the return window and refund threshold in the Policy Guardrail node to match your store policy.
- Run 20 test tickets in staging, confirm the idempotency key blocks double refunds, then switch the webhook to live.
Edge Cases & Error Handling
- Partial fulfillments: the order query returns line-item-level fulfillment; only mark an order delivered when every line item is fulfilled.
- Guest checkout: match on email plus order number, never on customer ID alone.
- Refund over threshold: route to a human-approval node instead of auto-issuing.
- API 429: add exponential-backoff retry on the Shopify GraphQL nodes and a dead-letter log for anything that fails three times.
The Blueprint
There is no pre-built download for this one - the workflow ships inline so you can paste it straight into n8n. Copy the JSON below, then use Import from Clipboard in the n8n editor.
{
"name": "Shopify Order Status, Returns & Refunds",
"nodes": [
{"parameters":{"httpMethod":"POST","path":"shopify-support"},"name":"Webhook","type":"n8n-nodes-base.webhook","typeVersion":2,"position":[220,300]},
{"parameters":{"keepOnlySet":true,"values":{"string":[{"name":"orderId","value":"={{ $json.body.order_id }}"},{"name":"email","value":"={{ $json.body.email }}"},{"name":"message","value":"={{ $json.body.message }}"}]}},"name":"Normalize","type":"n8n-nodes-base.set","typeVersion":3,"position":[440,300]},
{"parameters":{"query":"query($id:ID!){ order(id:$id){ id name displayFulfillmentStatus fulfillments{ trackingInfo{ number url } } lineItems(first:50){ nodes{ id quantity } } } }","variables":"={\"id\":\"gid://shopify/Order/{{ $json.orderId }}\"}"},"name":"Shopify Order Query","type":"n8n-nodes-base.graphql","typeVersion":1,"position":[660,300]},
{"parameters":{"query":"query($id:ID!){ order(id:$id){ returns(first:5){ nodes{ id status } } } }","variables":"={\"id\":\"gid://shopify/Order/{{ $json.orderId }}\"}"},"name":"Shopify Returns Query","type":"n8n-nodes-base.graphql","typeVersion":1,"position":[880,300]},
{"parameters":{"model":"gpt-4o-mini","messages":{"values":[{"role":"system","content":"Classify the Shopify support ticket as WISMO, return, or refund. Reply with one word."},{"role":"user","content":"={{ $json.message }}"}]}},"name":"LLM Classifier","type":"@n8n/n8n-nodes-langchain.openAi","typeVersion":1.8,"position":[1100,300]},
{"parameters":{"rules":{"values":[{"conditions":{"conditions":[{"leftValue":"={{ $json.classification }}","rightValue":"WISMO","operator":{"type":"string","operation":"equals"}}]},"renameOutput":true,"outputKey":"wismo"},{"conditions":{"conditions":[{"leftValue":"={{ $json.classification }}","rightValue":"return","operator":{"type":"string","operation":"equals"}}]},"renameOutput":true,"outputKey":"return"},{"conditions":{"conditions":[{"leftValue":"={{ $json.classification }}","rightValue":"refund","operator":{"type":"string","operation":"equals"}}]},"renameOutput":true,"outputKey":"refund"}]}},"name":"Switch Intent","type":"n8n-nodes-base.switch","typeVersion":3,"position":[1320,300]},
{"parameters":{"conditions":{"conditions":[{"leftValue":"={{ $json.daysSinceOrder }}","rightValue":30,"operator":{"type":"number","operation":"lte"}},{"leftValue":"={{ $json.paid }}","rightValue":true,"operator":{"type":"boolean","operation":"equal"}}]}},"name":"Policy Guardrail","type":"n8n-nodes-base.if","typeVersion":2,"position":[1540,300]},
{"parameters":{"query":"mutation($orderId:ID!,$key:String!){ refundCreate(input:{orderId:$orderId, idempotencyKey:$key}){ refund{ id } } }","variables":"={\"orderId\":\"gid://shopify/Order/{{ $json.orderId }}\",\"key\":\"{{ $json.idempotencyKey }}\"}"},"name":"Shopify Refund Mutation","type":"n8n-nodes-base.graphql","typeVersion":1,"position":[1760,300]},
{"parameters":{"mode":"combine","combineBy":"combineAll"},"name":"Merge","type":"n8n-nodes-base.merge","typeVersion":3,"position":[1980,300]},
{"parameters":{"sendTo":"={{ $json.email }}","subject":"Your order update","message":"={{ $json.reply }}"},"name":"Reply","type":"n8n-nodes-base.gmail","typeVersion":2.1,"position":[2200,300]},
{"parameters":{"operation":"insert","schema":"public","table":"support_log"},"name":"Log Outcome","type":"n8n-nodes-base.postgres","typeVersion":2.5,"position":[2420,300]}
],
"connections": {
"Webhook":{"main":[[{"node":"Normalize","type":"main","index":0}]]},
"Normalize":{"main":[[{"node":"Shopify Order Query","type":"main","index":0}]]},
"Shopify Order Query":{"main":[[{"node":"Shopify Returns Query","type":"main","index":0}]]},
"Shopify Returns Query":{"main":[[{"node":"LLM Classifier","type":"main","index":0}]]},
"LLM Classifier":{"main":[[{"node":"Switch Intent","type":"main","index":0}]]},
"Switch Intent":{"main":[[{"node":"Policy Guardrail","type":"main","index":0}],[{"node":"Policy Guardrail","type":"main","index":0}],[{"node":"Policy Guardrail","type":"main","index":0}]]},
"Policy Guardrail":{"main":[[{"node":"Shopify Refund Mutation","type":"main","index":0}],[{"node":"Reply","type":"main","index":0}]]},
"Shopify Refund Mutation":{"main":[[{"node":"Merge","type":"main","index":0}]]},
"Merge":{"main":[[{"node":"Reply","type":"main","index":0}]]},
"Reply":{"main":[[{"node":"Log Outcome","type":"main","index":0}]]}
},
"settings": {"executionOrder":"v1"},
"active": false
}If you would rather not run the VPS, the same workflow runs on managed n8n.
Managed n8n - skip the VPS and the uptime maintenance · Affiliate link — we may earn a commission.
Related Reading
- n8n - the fair-code engine this blueprint is built on, and the only self-hostable option in this stack.
- Gorgias - the per-resolution model you are replacing, priced at ~$1.00 per AI resolution.
- Intercom Fin - the usage-based alternative at ~$0.99 per resolution plus $29/seat.
- Gorgias vs. Intercom Fin for Shopify: Real Cost per Resolved WISMO & Refund Ticket - the head-to-head this blueprint is the third option to.
- Zapier vs Make vs n8n cost calculator - model your own ticket volume before you commit.
Frequently asked questions
Q: Can I really replace Gorgias with a self-hosted n8n workflow? For WISMO, returns, and refunds, yes. Those three tickets are data lookups and API mutations, which is exactly what n8n and the Shopify GraphQL API do. Gorgias still wins on multi-channel social inboxes and a support-team UI; you trade that for ~97% lower cost at 1,200 tickets/mo.
Q: What does this cost per ticket compared to Gorgias? About $0.02 per resolved ticket on the self-hosted stack ($25-$28/mo at 1,200 tickets) versus ~$1.00 per ticket on Gorgias Pro with AI overages. Intercom Fin is ~$0.99 per resolution plus $29/seat.
Q: How many nodes does the workflow have, and how long does setup take? Eleven nodes. Provisioning the VPS and the Shopify custom app is the slow part - plan a half-day; importing the JSON and wiring credentials is under an hour.
Q: What stops a retry from issuing a double refund? An idempotency key on every mutation branch (order ID plus an action hash) and a check-before-write query. Without those two, a node timeout plus an n8n retry can refund the same order twice.
Q: Do I need an LLM to run this? Only for the classifier that sorts WISMO / return / refund and drafts the reply. You can swap it for keyword rules to cut the $12-$18/mo token spend, at the cost of accuracy on messy messages.
Q: Is the Shopify GraphQL API included in my Shopify plan? Yes. The Admin API is included with your Shopify plan; the only infrastructure cost is the $10/mo VPS plus the LLM tokens.
Written by
Marcus ChenLead Automation Architect
Marcus builds and benchmarks AI operations workflows for e-commerce and agency teams. He previously ran a 12-person ops team and has shipped 400+ production Make and n8n scenarios.