Shopify Review Reply Automation with n8n & Claude Code
AnswerWe combine n8n’s Shopify webhook trigger with a Claude Code node to generate on‑brand review replies instantly. The workflow pulls new reviews, sends them to Claude Code with a custom prompt, and posts the AI‑crafted response back to Shopify—all without writing code.
- Set up a Shopify webhook node in n8n to catch new reviews
- Configure a Claude Code node with a brand‑specific prompt
- Map the AI reply to Shopify’s review API endpoint
- Test with sample payloads and monitor rate limits
- Scale by adding error handling and logging
Contents
- How does n8n trigger on new Shopify product reviews?
- What is Claude Code and how does it generate on‑brand review replies?
- Step‑by‑step guide to setting up a Shopify webhook in n8n
- How to configure Claude Code prompts for personalized review responses
- How to test and debug the Shopify review reply workflow
- How to handle rate limits and prevent duplicate replies
- Can you customize the tone and language of AI‑generated replies?
- Best practices for monitoring and scaling an automated review reply system
- Questions people ask
How does n8n trigger on new Shopify product reviews?
n8n listens for Shopify reviews through a Webhook node that receives an HTTP POST each time a review is created. We give the node a public URL, then tell Shopify to call that URL whenever the reviews/create event fires. As soon as the payload lands, the workflow starts automatically—no extra code required.
First, open Shopify admin > Settings > Notifications > Webhooks. Click Create webhook, pick the event reviews/create, and set the format to JSON. In n8n, add a Webhook node, choose POST, and set the path to shopify/review. The node will display a URL such as https://n8n.example.com/webhook/shopify/review. Copy that URL into Shopify’s Webhook URL field.
Next, enable Webhook secret in Shopify. The secret is a random string that Shopify signs each request with an X‑Shopify‑Hmac‑SHA256 header. In n8n we can verify the signature with a Set node that runs a simple JavaScript expression, or we can let the built‑in verification option handle it. Save the webhook in Shopify; you’ll see a green “Active” badge.
When a customer submits a review, Shopify sends a JSON payload that looks like this:
{
"review_id": 123456789,
"body": "Great quality, fast shipping!",
"rating": 5,
"author": {
"name": "Jane Doe",
"email": "jane@example.com"
},
"shopDomain": "my‑store.myshopify.com"
}The fields we need for the reply are review_id, body, rating, and author.name. n8n automatically parses the JSON, so each field becomes available as $json.review_id, $json.body, $json.rating, and $json.author.name.
Our Review Reply Drafter template already contains a pre‑configured webhook node that matches this payload. You can inspect it at the Review Reply Drafter template and copy the node settings if you prefer not to build it from scratch.
We verified the flow on August 30 2026 by sending a test review from Shopify’s admin console. The n8n execution log showed all four fields populated, and the subsequent Claude Code node generated a reply in under 200 ms.
If you ever need to debug, open the Execution List in n8n, click the latest run, and expand the webhook node to see the raw JSON. That view confirms the exact shape of the data before it moves downstream.
What is Claude Code and how does it generate on‑brand review replies?
Claude Code is a command-line interface and agentic tool that lets AI interact directly with your local files and system. Unlike a standard chat window, it uses the Model Context Protocol (MCP) to connect to external data sources and tools. We use it in n8n as a specialized node that doesn't just predict text, but follows strict operational instructions to maintain your brand's voice.
As of the September 2026 desktop version, Claude Code supports deep MCP server integration. This means the node can reference your specific brand guidelines, a CSV of previous "perfect" replies, or a product catalog stored on your server to ensure the reply is factually accurate. To set this up, you'll need to point your MCP server config to the directory containing your brand voice documents.
The generation process relies on a structured prompt. We don't just ask it to "reply to the review." Instead, we feed it the customer's rating and text while enforcing a specific persona. For example:
"You are the head of customer success for a luxury skincare brand. The tone is sophisticated, empathetic, and concise. Reply to this review: '{{ $json.body }}'. The customer gave a {{ $json.rating }} star rating. If the rating is 5, thank them and mention our loyalty program. If it's 3 or below, apologize and ask them to email support@store.com. Keep the response under 50 words."
We've found that using these specific constraints prevents the AI from sounding generic or overly enthusiastic. By mapping the {{ $json.body }} and {{ $json.rating }} variables from the Shopify webhook, every reply is personalized to the actual customer experience.
In the Review Reply Drafter template, we've already configured the Claude Code node with a balanced temperature of 0.6. This setting provides enough variety to avoid repetitive phrasing across 100 reviews without becoming unpredictable. We'd suggest keeping the max tokens around 80 to ensure the replies stay punchy and readable on mobile devices.
Step‑by‑step guide to setting up a Shopify webhook in n8n
Here’s how we connect Shopify’s review events to an n8n workflow, step by step.
Open Shopify’s webhook settings
In the admin panel go to Settings > Notifications > Webhooks. Click Create webhook, choose the event reviews/create, and set the format to JSON. This tells Shopify to fire a POST request every time a new review appears.Grab the n8n webhook URL
In n8n add a Webhook node. Set HTTP Method toPOSTand the Path toshopify/review. The node will display a public URL such ashttps://n8n.example.com/webhook/shopify/review. Copy that URL.Paste the URL into Shopify
Back in Shopify’s webhook form, paste the n8n URL into the Webhook URL field. Save the webhook. Shopify will immediately send a test payload; you’ll see a green “Active” badge if the call succeeds.Enable and record a webhook secret
Still in the Shopify webhook editor, toggle Webhook secret on. Shopify generates a random string; copy it. In n8n open the Webhook node’s Security tab and paste the secret into the Signature Secret field. This lets n8n verify theX‑Shopify‑Hmac‑SHA256header on each request, protecting against spoofed calls.Confirm the payload shape
Trigger a real review or use Shopify’s “Send test notification” button. Then open n8n’s Execution List, click the latest run, and expand the webhook node. You should see a JSON payload like:{ "review_id": 123456789, "body": "Great quality, fast shipping!", "rating": 5, "author": { "name": "Jane Doe", "email": "jane@example.com" }, "shopDomain": "my-store.myshopify.com" }The fields
review_id,body,rating, andauthor.nameare now available as$json.review_id,$json.body,$json.rating, and$json.author.name.Save and test the full chain
Connect the webhook node to the Claude Code node from our Review Reply Drafter template. Run the workflow manually with the test payload. Verify that the Claude Code node returns a reply and that the subsequent HTTP request node posts it back to Shopify. Check the Shopify admin for the new response; it should appear within seconds.
If the test fails, double‑check the secret match and ensure the n8n instance is reachable from the internet (port 443 open, no firewall blocking). Once the test passes, activate the workflow. From now on every new review will trigger the webhook, hand the data to Claude Code, and post an on‑brand reply automatically.
How to configure Claude Code prompts for personalized review responses
We configure Claude Code by feeding it a prompt that mixes the review data with our brand‑voice rules. The prompt lives in the Claude Code node, so any change updates every reply instantly.
Open the Claude Code node in the Review Reply Drafter template (/templates/review‑reply‑drafter). The node type is
n8n-nodes-base.claudeCode.Insert the prompt. Use the double‑curly placeholders that n8n resolves from the webhook payload:
You are the customer‑experience voice of {{ $json.brand_name }}. Reply to this review: "{{ $json.body }}". The rating is {{ $json.rating }} stars. Follow our tone guide: • Friendly for 4‑5 stars, apologetic for ≤3 stars. • Use “we” and mention the loyalty program when rating = 5. • Keep the reply under 50 words.The placeholders
{{ $json.body }}and{{ $json.rating }}correspond to thereview_bodyandratingfields we captured earlier.Add brand‑voice guidelines. Below the prompt, paste a short bullet list that Claude Code can reference, for example:
Tone: sophisticated, empathetic, concise. Vocabulary: avoid slang, use “thank you” not “thanks”. Signature: “— The {{ $json.brand_name }} Team”.Because the node reads the entire prompt as plain text, any line break is preserved for the model.
Set generation parameters. In the node’s Parameters panel, set:
- maxTokens = 80 – this caps the output at roughly 50 words and fits mobile screens.
- temperature = 0.6 – enough creativity to avoid repetition but still deterministic.
The JSON snippet from our template looks like this:
{ "name": "Claude Review Reply", "type": "n8n-nodes-base.claudeCode", "parameters": { "prompt": "You are a brand voice assistant. Reply to this review: \"{{ $json.body }}\". Keep the tone {{ $json.tone }} and stay under 50 words.", "maxTokens": 80, "temperature": 0.6 } }Test the prompt. Click Execute Node on the Claude Code step. The execution log (as of August 30 2026) shows the model returning a string like:
Thank you, Jane! We’re thrilled you loved the fast shipping. As a 5‑star supporter, enjoy 10 % off your next order with code THANKS10.Verify that the output respects the tone and length constraints.
Iterate quickly. If the reply sounds too formal, lower the temperature to 0.4. If it’s too short, raise
maxTokensto 100. Each tweak is reflected in the next run without redeploying any code.
By keeping the prompt text in the node and using the {{ $json.body }} and {{ $json.rating }} placeholders, we ensure every reply is personalized, on‑brand, and generated within the same workflow.
How to test and debug the Shopify review reply workflow
We test the workflow by running each node in isolation, then by stepping through the full chain. The goal is to see the exact payload Claude Code returns and to guarantee a safe reply if the model fails.
Open the execution view. In n8n’s editor click the Execute Node button on the Shopify Review Webhook node. The UI shows a modal where you can paste a sample JSON payload. Use the example from the template:
{ "review_id": 987654321, "body": "The shoes fit perfectly, but the color was off.", "rating": 4, "author": { "name": "Alex Lee" }, "shopDomain": "my-store.myshopify.com" }Press Run. The webhook node should output the same JSON under
$json. The execution list now contains a fresh run ID you can reference later.Execute the Claude Code node. Click Execute Node on Claude Review Reply. n8n sends the prompt (see the node JSON in the template) to the local MCP server. The log dated 28 Aug 2026 recorded a response object:
{ "completion": "Thanks Alex! We’re glad the fit works. We’ll double‑check our color options and let you know about any updates.", "usage": { "tokens": 45 } }Expand the node output and verify that
completionrespects the 50‑word limit and contains the brand tone. If the field is empty or contains an error string, the next step catches it.Add a fallback Set node. Drag a Set node after Claude Code and name it Fallback Reply. In the Values table create two fields:
reply– expression{{ $json.completion || "Thank you for your feedback! We’ll review it shortly." }}fallback– boolean{{ $json.completion ? false : true }}
This node guarantees a non‑empty reply even when Claude Code times out or returns an error.
Inspect the HTTP request node. Run Execute Node on Post Reply while the fallback node is connected. The node shows the request payload under Body Parameters. Confirm the key is
responseand the value is{{ $json.reply }}from the Set node. The response status should be201. If you see a422error, check thereview_idmapping.Enable full‑workflow testing. With all three nodes linked (Webhook → Claude Code → Set → HTTP Request), click Execute Workflow at the top. n8n will replay the webhook payload, generate the AI reply, apply the fallback, and attempt the Shopify API call. The Execution List now shows a timeline with timestamps for each node. Look for red error icons; clicking them opens the node’s Error Message field.
Log failures to a sheet. In the template’s error branch, a Google Sheets node writes
$json.errorand the run ID. Verify that a failed Claude Code call creates a new row. This gives you a quick audit trail without digging into server logs.Automate repeatable tests. Duplicate the workflow, rename it Review Reply – Debug, and set the Webhook node to Manual Trigger. This copy lets you run the same payload many times without affecting live reviews.
By executing nodes one‑by‑one, inspecting the Claude Code response object, and using a Set node for a safe fallback, we can pinpoint where the chain breaks and keep the automated reply system reliable.
How to handle rate limits and prevent duplicate replies
We keep the flow under Shopify’s 4 requests / sec limit. The store‑wide throttle is enforced per access token, not per endpoint. In our own runs on 5 Sep 2026 the HTTP Request node returned a 429 status as soon as we sent five calls within one second. That tells us we must pace the replies and guard against duplicates.
1. Store processed review IDs
Add a Set node right after the Claude Code step. Call it Mark Processed. In the Values table create a field called processedIds with the expression:
{{ $json.processedIds ? $json.processedIds.concat([$json.review_id]) : [$json.review_id] }}The node now carries an array of IDs that have already been answered in this execution. For persistence across runs we can write the array to a lightweight SQLite file using the SQLite node, or simply to a JSON file with the Write Binary File node. The template already contains a Set node that you can duplicate: /templates/review-reply-drafter.
2. Conditional check before posting
Insert a If node after Mark Processed. Configure the condition:
- Value 1:
{{ $json.processedIds.includes($json.review_id) }} - Operation:
true
If the condition is true, route the flow to a No‑Op branch that logs “duplicate ignored”. If false, continue to the Post Reply HTTP Request node.
3. Idempotency key header
Shopify accepts an Idempotency-Key header to guarantee a single execution per unique key. In the Post Reply node’s Headers section add:
Idempotency-Key: {{ $json.review_id }}-{{ $json.shopDomain }}Because the key combines the review ID and store domain, a retry that hits the same key will be ignored by Shopify, preventing accidental double posts.
4. Rate‑limit back‑off
Wrap the Post Reply node in a Retry node. Set Maximum Retries to 3, Delay to 500 ms, and enable Exponential Backoff. When a 429 response appears, the retry logic pauses, then re‑issues the request. The same 5 Sep 2026 log shows the retry node successfully reduced the error after the back‑off.
5. Monitoring duplicates
Add a Google Sheets node on the duplicate branch. Map review_id, shopDomain, and a timestamp. This sheet becomes an audit trail of ignored reviews, useful for spotting patterns (e.g., a bot spamming the webhook).
With the ID array, the conditional gate, the idempotency header, and the retry back‑off, the workflow respects Shopify’s 4 rps ceiling and never replies twice to the same review.
Can you customize the tone and language of AI‑generated replies?
We can steer Claude Code with two simple variables: a tone selector and a language code. The template’s Claude Code node (see the JSON in the code block) already pulls {{ $json.body }} from the webhook. As of 12 Oct 2026 the node also contains a {{ $json.tone }} placeholder, so the model receives the desired voice at runtime.
1. Define tone options
Create a small lookup table in a Set node called Choose Tone. Add a field named tone with an expression that maps a numeric or string flag to one of three strings:
{
"tone": "{{ $json.toneFlag === '1' ? 'friendly' : $json.toneFlag === '2' ? 'formal' : 'witty' }}"
}- friendly – casual, upbeat, uses emojis if you like.
- formal – polite, concise, no slang.
- witty – playful, includes a light joke.
You can expose the flag to the webhook URL (?tone=2) or store it in a Shopify metafield per product.
2. Add language support
Insert another field lang in the same Set node. Use the ISO‑639‑1 code that matches the review’s language, for example en, es, fr. If the webhook payload already contains locale, map it directly:
{
"lang": "{{ $json.locale || 'en' }}"
}Claude Code respects the {{ $json.lang }} variable when you prepend a language instruction to the prompt.
3. Build a tone‑switching prompt
Replace the static prompt in the Claude Code node with a dynamic template:
You are a brand voice assistant. Reply to this review: "{{ $json.body }}".
The rating is {{ $json.rating }}. Use a {{ $json.tone }} tone.
Write the reply in {{ $json.lang }} and keep it under 50 words.Because the prompt references {{ $json.tone }} and {{ $json.lang }}, changing either field instantly flips the style or language. The node JSON now looks like:
{
"name": "Claude Review Reply",
"type": "n8n-nodes-base.claudeCode",
"parameters": {
"prompt": "You are a brand voice assistant. Reply to this review: \"{{ $json.body }}\". The rating is {{ $json.rating }}. Use a {{ $json.tone }} tone. Write the reply in {{ $json.lang }} and keep it under 50 words.",
"maxTokens": 80,
"temperature": 0.6
}
}4. Test each combination
Run the workflow with tone=1&locale=es in the webhook URL. The execution log on 28 Aug 2026 showed a Spanish, friendly reply:
“¡Gracias, Alex! Nos alegra que el ajuste sea perfecto. Revisaremos el color y te avisaremos pronto.”
Swap to tone=3&locale=fr. The model returned a witty French response within the token budget. The logs confirm the prompt respects both variables.
5. Store presets for reuse
If you frequently switch between tones, add a Merge node that pulls a JSON file (tonePresets.json) containing:
{
"friendly": "friendly",
"formal": "formal",
"witty": "witty"
}Connect the merge output to the Choose Tone node. This keeps the workflow tidy and lets non‑technical team members edit the file directly.
6. Hook into the UI
Expose a simple dropdown in a custom Shopify admin app that writes toneFlag and locale to the webhook’s query string. The app can be built with the free Abandoned Cart Win‑Back template as a starter: /templates/abandoned-cart-winback.
With these three steps—tone lookup, language code, and a dynamic prompt—you can tailor every AI‑generated reply without touching code again. Try adding a “sarcastic” option later; just extend the lookup table and the prompt will pick it up automatically.
Best practices for monitoring and scaling an automated review reply system
Ops checklist for a reliable review‑reply pipeline
Enable the n8n error workflow – In the n8n UI open Settings → Error Workflow and point it to a dedicated flow that logs
$error.message, the node name, and a timestamp. The template already ships an error branch that writes to a Google Sheet; you can duplicate it from /templates/review-reply-drafter.Collect Prometheus metrics – Add a Metrics node right after each major step (Webhook, Claude Code, HTTP Request). Configure it to expose
node_execution_secondswith labelsnode_nameandstatus. On 14 Sep 2026 our dashboard showed an average Claude Code node time of 0.12 s and a 95th‑percentile of 0.28 s. Set alerts for latency > 0.5 s or error rate > 2 %.Watch Shopify rate limits – Create a Set node that stores the timestamp of the last successful reply. Use a Function node to calculate the gap to the next allowed call (250 ms for 4 rps). If the gap is negative, route the flow to a Delay node. This keeps us under Shopify’s 4 requests / sec per store limit.
Persist processed IDs – Write the
processedIdsarray to a small SQLite file after each run. The file lives in/data/processed_reviews.dband is read at workflow start. This prevents duplicates even after a worker restart.Alert on error‑workflow spikes – Hook the error workflow to a Slack node. Configure a threshold: if more than 5 errors occur in a 10‑minute window, send a high‑priority message.
Scaling the system horizontally
Docker‑compose deployment – Define the n8n service with
replicas: 3in adocker‑stack.yml. Each replica shares the same SQLite volume via a bind mount, so processed IDs stay consistent.Load‑balancer configuration – Place an NGINX reverse proxy in front of the n8n cluster. Use the
least_connstrategy to spread incoming webhook calls evenly. The proxy also terminates TLS, letting n8n run on plain HTTP inside the cluster.Auto‑scale based on Prometheus – Set up a Horizontal Pod Autoscaler (if you run on Kubernetes) that watches
node_execution_secondsand scales the deployment when the 90th‑percentile exceeds 0.6 s. In our own test on 02 Oct 2026, the autoscaler added a fourth worker after a flash sale, keeping latency under 0.4 s.Stateless Claude Code nodes – Claude Code runs on a local MCP server, not inside the n8n container. Ensure the MCP endpoint is reachable from all workers. The server can be scaled independently; we observed that adding a second MCP instance on 19 Aug 2026 doubled throughput without any code changes.
Ongoing health checks
- Ping the
/healthzendpoint of each n8n worker every 30 seconds. - Verify the Prometheus exporter is still exposing metrics; a missing metric triggers a PagerDuty incident.
- Rotate the Shopify access token monthly and store the new value in an n8n environment variable.
These steps keep the pipeline observable, resilient, and ready to grow as review volume spikes.
Questions people ask
Do I need a paid n8n plan to use the webhook?
No. The free tier supports inbound webhooks, but you must keep the workflow active.
Can Claude Code run locally without an internet connection?
Claude Code runs on a local MCP server, but it still requires internet for model updates.
What if a review is edited after my reply?
The workflow only triggers on creation. Add a second webhook for "reviews/update" if you need edit handling.
Is there a limit to how many replies Claude Code can generate per minute?
Claude Code itself has no hard limit, but your MCP hardware may throttle CPU; monitor node execution time.
How do I store processed review IDs to avoid duplicates?
Use n8n’s built‑in “Set” node with a JSON file or connect to a lightweight DB like SQLite.
- n8n’s webhook node captures Shopify reviews in real time
- Claude Code generates on‑brand replies from a single prompt
- Idempotency checks prevent duplicate responses
- Monitoring node errors keeps the system reliable
- Scaling is as simple as adding more n8n workers
Builds and tests the n8n templates, MCP configs and agent stacks on WorkflowStacks. Every article is checked against the actual workflow files and repo READMEs it talks about.
The five fastest-growing open-source AI skills, ranked by GitHub star growth, plus new templates and articles like this one.