Develop a beginner-friendly guide, focusing on a practical application achievable within 2-3 days. The project should be clearly explained, broken down into manageable steps, and easy to understand for someone new to n8n. The project should have a clear goal, such as automating a simple task or integrating two different services. The explanation should include the necessary steps, from setting up the n8n workflow to testing and troubleshooting. The project should be designed to be completed within the given timeframe, considering the user's limited experience with n8n.
Goal: Build an automated returns processing system that handles customer returns from start to finish - from initial return request to inventory update and customer notification.
Time Required: 2-3 days Difficulty: Beginner-friendly What You'll Learn: n8n basics, webhook triggers, conditional logic, email automation, and data management
By the end of this guide, you'll have created a system that:
Option A: n8n Cloud (Recommended for beginners)
Option B: Local Installation
npm install n8n -g
n8n start
Then open http://localhost:5678
in your browser.
When you first open n8n, you'll see:
Key Concepts:
Let's start with a simple workflow that receives a return request and sends a confirmation email.
Create a New Workflow
Add a Webhook Trigger
Configure the Webhook
In the webhook settings:
POST
returns
(you can choose any name)Test the Webhook
Create this HTML file and save it as return-form.html
:
<!DOCTYPE html>
<html>
<head>
<title>Return Request Form</title>
<style>
body { font-family: Arial, sans-serif; max-width: 500px; margin: 50px auto; padding: 20px; }
input, select, textarea { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; }
button { background: #007cba; color: white; padding: 15px 30px; border: none; cursor: pointer; }
</style>
</head>
<body>
<h2>Return Request Form</h2>
<form id="returnForm">
<input type="text" name="customerName" placeholder="Your Name" required>
<input type="email" name="customerEmail" placeholder="Your Email" required>
<input type="text" name="orderNumber" placeholder="Order Number" required>
<select name="returnReason" required>
<option value="">Select Return Reason</option>
<option value="defective">Defective Item</option>
<option value="wrong-size">Wrong Size</option>
<option value="not-as-described">Not as Described</option>
<option value="changed-mind">Changed Mind</option>
</select>
<textarea name="description" placeholder="Describe the issue" rows="4"></textarea>
<button type="submit">Submit Return Request</button>
</form>
<script>
document.getElementById('returnForm').addEventListener('submit', async function(e) {
e.preventDefault();
const formData = new FormData(this);
const data = Object.fromEntries(formData);
try {
const response = await fetch('YOUR_WEBHOOK_URL_HERE', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
if (response.ok) {
alert('Return request submitted successfully!');
this.reset();
} else {
alert('Error submitting request. Please try again.');
}
} catch (error) {
alert('Error submitting request. Please try again.');
}
});
</script>
</body>
</html>
Replace YOUR_WEBHOOK_URL_HERE
with the webhook URL you copied from n8n.
Test the Connection
Now let's add an email node to send confirmation to customers.
Add Gmail Node
Configure Gmail Authentication
Configure Email Content
{{ $node["Webhook"].json["customerEmail"] }}
Return Request Confirmation - Order #{{ $node["Webhook"].json["orderNumber"] }}
Text
Dear {{ $node["Webhook"].json["customerName"] }},
We've received your return request for Order #{{ $node["Webhook"].json["orderNumber"] }}.
Return Details:
- Reason: {{ $node["Webhook"].json["returnReason"] }}
- Description: {{ $node["Webhook"].json["description"] }}
We'll process your request within 24-48 hours and send you return instructions.
Thank you for your business!
Customer Service Team
Test the Workflow
🎉 Congratulations! You've built your first automated workflow!
Let's store all return requests in a Google Sheet for tracking.
Create a Google Sheet
Date
, Customer Name
, Email
, Order Number
, Return Reason
, Description
, Status
Add Google Sheets Node
Configure the Sheets Node
Sheet1
(or whatever you named it)Columns to match data:
{{ new Date().toISOString().split('T')[0] }}
{{ $node["Webhook"].json["customerName"] }}
{{ $node["Webhook"].json["customerEmail"] }}
{{ $node["Webhook"].json["orderNumber"] }}
{{ $node["Webhook"].json["returnReason"] }}
{{ $node["Webhook"].json["description"] }}
Pending Review
Now let's add different processing based on return reason.
Add IF Node
Configure Conditions
{{ $node["Webhook"].json["returnReason"] === "defective" }}
Add Different Actions for Each Path
For Defective Items (True path):
URGENT: Defective Item Return - Order #{{ $node["Webhook"].json["orderNumber"] }}
For Other Returns (False path):
Standard Return Request - Order #{{ $node["Webhook"].json["orderNumber"] }}
Let's add a follow-up email after 24 hours.
Add Wait Node
Add Follow-up Email
Sample Follow-up Email:
Dear {{ $node["Webhook"].json["customerName"] }},
Your return request for Order #{{ $node["Webhook"].json["orderNumber"] }} has been processed.
Please follow these steps:
1. Package the item securely
2. Print the attached return label
3. Drop off at any authorized shipping location
Your refund will be processed within 5-7 business days after we receive the item.
Tracking: [Return tracking number would go here]
Best regards,
Returns Team
Let's notify your team via Slack when returns come in.
Set up Slack Integration
Configure Slack Message
🔄 New Return Request
Customer: {{ $node["Webhook"].json["customerName"] }}
Order: #{{ $node["Webhook"].json["orderNumber"] }}
Reason: {{ $node["Webhook"].json["returnReason"] }}
{{ $node["Webhook"].json["returnReason"] === "defective" ? "⚠️ PRIORITY: Defective item!" : "📦 Standard return" }}
Let's add proper error handling to make our workflow robust.
Add Error Handling to Email Nodes
Add Error Notification
Comprehensive Testing
Common Issues and Solutions
Issue: Webhook not receiving data
Issue: Gmail authentication fails
Issue: Google Sheets not updating
Issue: Conditional logic not working
Add Data Validation
Improve Performance
Add Logging
Your completed workflow should look like this:
Webhook → Gmail (Confirmation) → Google Sheets → IF (Return Reason)
↓ ↓
Slack Notification True: Priority Email to Support
False: Standard Email to Returns
↓ ↓
Wait (24 hours) → Gmail (Follow-up Instructions)
End-to-End Test
Edge Case Testing
Once you've mastered this basic system, consider adding:
Return Label Generation
Inventory Management
Customer Portal
Analytics Dashboard
AI Integration
Error: "Webhook timeout"
Error: "Gmail quota exceeded"
Error: "Google Sheets permission denied"
Error: "Slack message failed"
Use the Execute Node Feature
Check Node Outputs
Use Function Nodes for Debugging
console.log()
statementsYou've successfully built a complete automated returns processing system! This workflow demonstrates key n8n concepts:
You now have the foundation to build more complex automations and integrate different services to solve real business problems.
now do the entire txt file
Modern e-commerce and manufacturing businesses face critical inefficiencies in their returns processes:
These gaps result in lost revenue, bloated operational costs, and missed sustainability goals—exactly the strategic challenges that require intelligent automation.
We'll build a comprehensive n8n automation system that transforms returns from a cost center into a revenue-generating, sustainability-focused operation.
Time Required: 2-3 days for core implementation Difficulty: Intermediate (building on automation fundamentals) Business Impact: Revenue recovery, cost reduction, ESG compliance
A complete orchestration platform featuring:
Let's start with a sophisticated return intake system that goes beyond basic forms.
Now let's build the n8n workflow that processes these returns intelligently.
Workflow Structure:
Webhook (Return Request) → AI Image Analysis → Condition Classification → Airtable Storage → Customer Notification → Team Alerts
n8n Workflow Configuration:
Webhook Trigger Node
returns-intake
POST
OpenAI Vision Node (AI Image Analysis)
// Function Node - Prepare Images for AI Analysis
const images = $node["Webhook"].json["images"] || [];
const returnReason = $node["Webhook"].json["returnReason"];
const productCondition = $node["Webhook"].json["productCondition"];
return [{
json: {
prompt: `Analyze these product return images.
Customer reported reason: ${returnReason}
Customer reported condition: ${productCondition}
Please assess:
1. Actual product condition (like-new, good, fair, poor, damaged)
2. Refurbishment potential (high, medium, low, none)
3. Resale value estimate (high, medium, low)
4. Recommended action (resell, refurbish, recycle, dispose)
Respond in JSON format.`,
images: images,
model: "gpt-4-vision-preview"
}
}];
Condition Classification Node (Function)
// Process AI analysis and create classification
const aiAnalysis = $node["OpenAI"].json;
const customerData = $node["Webhook"].json;
// Parse AI response
let analysis;
try {
analysis = JSON.parse(aiAnalysis.choices[0].message.content);
} catch (e) {
// Fallback to customer-reported condition
analysis = {
actualCondition: customerData.productCondition,
refurbishmentPotential: "medium",
resaleValue: "medium",
recommendedAction: "review"
};
}
// Calculate priority score
let priorityScore = 0;
if (customerData.returnReason === "defective") priorityScore += 3;
if (analysis.actualCondition === "damaged") priorityScore += 2;
if (analysis.resaleValue === "high") priorityScore += 2;
return [{
json: {
...customerData,
aiAnalysis: analysis,
priorityScore: priorityScore,
returnId: `RET-${Date.now()}`,
status: "intake-complete",
processedAt: new Date().toISOString()
}
}];
Airtable Storage Node
Fields mapping:
Return ID: {{ $node["Classification"].json["returnId"] }}
Customer Name: {{ $node["Webhook"].json["customerName"] }}
Email: {{ $node["Webhook"].json["customerEmail"] }}
Order Number: {{ $node["Webhook"].json["orderNumber"] }}
Return Reason: {{ $node["Webhook"].json["returnReason"] }}
Customer Condition: {{ $node["Webhook"].json["productCondition"] }}
AI Condition: {{ $node["Classification"].json["aiAnalysis"]["actualCondition"] }}
Refurbishment Potential: {{ $node["Classification"].json["aiAnalysis"]["refurbishmentPotential"] }}
Resale Value: {{ $node["Classification"].json["aiAnalysis"]["resaleValue"] }}
Recommended Action: {{ $node["Classification"].json["aiAnalysis"]["recommendedAction"] }}
Priority Score: {{ $node["Classification"].json["priorityScore"] }}
Status: {{ $node["Classification"].json["status"] }}
Created: {{ $node["Classification"].json["processedAt"] }}
Customer Notification Email
Subject: Return Request Confirmed - {{ $node["Classification"].json["returnId"] }}
Dear {{ $node["Webhook"].json["customerName"] }},
Your return request has been received and processed using our AI-powered system.
Return Details:
- Return ID: {{ $node["Classification"].json["returnId"] }}
- Order: {{ $node["Webhook"].json["orderNumber"] }}
- Status: Under Review
- Estimated Processing: 24-48 hours
Our system has analyzed your return and determined the next steps. You'll receive return shipping instructions within 24 hours.
Track your return: [Return Portal Link]
Thank you for choosing sustainable returns!
Team Slack Notification
🔄 New Return - Priority {{ $node["Classification"].json["priorityScore"] }}/5
📦 Return ID: {{ $node["Classification"].json["returnId"] }}
👤 Customer: {{ $node["Webhook"].json["customerName"] }}
📋 Order: {{ $node["Webhook"].json["orderNumber"] }}
🤖 AI Analysis:
• Condition: {{ $node["Classification"].json["aiAnalysis"]["actualCondition"] }}
• Refurb Potential: {{ $node["Classification"].json["aiAnalysis"]["refurbishmentPotential"] }}
• Resale Value: {{ $node["Classification"].json["aiAnalysis"]["resaleValue"] }}
• Action: {{ $node["Classification"].json["aiAnalysis"]["recommendedAction"] }}
{{ $node["Classification"].json["priorityScore"] >= 4 ? "⚠️ HIGH PRIORITY" : "📋 Standard Processing" }}
This workflow triggers when items are physically received at your facility.
Workflow Structure:
Webhook (Item Received) → Update Airtable → Conditional Routing → QC Assignment → Refurbishment Workflow → Inventory Update
n8n Workflow Configuration:
Item Received Webhook
returnId
, actualCondition
, photos
, qcNotes
Airtable Update Node
// Update return record with physical inspection data
{
"Status": "Physical Inspection Complete",
"Actual Condition": "{{ $node['Webhook'].json['actualCondition'] }}",
"QC Notes": "{{ $node['Webhook'].json['qcNotes'] }}",
"Received Date": "{{ new Date().toISOString() }}",
"QC Photos": "{{ $node['Webhook'].json['photos'].join(', ') }}"
}
Conditional Routing (IF Node)
// Route based on condition and AI recommendation
const condition = $node["Webhook"].json["actualCondition"];
const aiRecommendation = $node["Airtable"].json["Recommended Action"];
// Route to different workflows
if (condition === "like-new" && aiRecommendation === "resell") {
return [{ json: { route: "direct-resale" } }];
} else if (condition === "good" || condition === "fair") {
return [{ json: { route: "refurbishment" } }];
} else if (condition === "poor" || condition === "damaged") {
return [{ json: { route: "recycling" } }];
}
Refurbishment Assignment (Trello/Asana)
// Create refurbishment task
{
"name": "Refurbish Item - {{ $node['Webhook'].json['returnId'] }}",
"description": `
Product: {{ $node['Airtable'].json['Product Name'] }}
Condition: {{ $node['Webhook'].json['actualCondition'] }}
Issues: {{ $node['Webhook'].json['qcNotes'] }}
Refurbishment Plan:
- Clean and sanitize
- Repair identified issues
- Quality test
- Repackage for resale
Target Completion: 3-5 business days
`,
"due_date": "{{ new Date(Date.now() + 5*24*60*60*1000).toISOString() }}",
"labels": ["refurbishment", "{{ $node['Webhook'].json['actualCondition'] }}"],
"assignee": "refurbishment-team"
}
Inventory Management Update
// Update inventory system
const returnData = $node["Airtable"].json;
return [{
json: {
action: "inventory-update",
productSku: returnData["Product SKU"],
location: "refurbishment-queue",
status: "in-refurbishment",
estimatedCompletion: new Date(Date.now() + 5*24*60*60*1000).toISOString(),
refurbishmentCost: calculateRefurbishmentCost(returnData["Actual Condition"]),
expectedResaleValue: calculateResaleValue(returnData["AI Analysis"])
}
}];
function calculateRefurbishmentCost(condition) {
const costs = {
"good": 25,
"fair": 50,
"poor": 100
};
return costs[condition] || 75;
}
function calculateResaleValue(aiAnalysis) {
const baseValue = 100; // Base product value
const multipliers = {
"high": 0.8,
"medium": 0.6,
"low": 0.4
};
return baseValue * (multipliers[aiAnalysis.resaleValue] || 0.5);
}
When refurbishment is complete, automatically list items for resale.
Workflow Structure:
Webhook (Refurbishment Complete) → Photo Processing → Listing Creation → Multi-Platform Publishing → Price Optimization
Refurbishment Complete Webhook
returnId
, refurbishmentCost
, finalCondition
, newPhotos
Photo Processing & Enhancement
// Function Node - Prepare listing photos
const photos = $node["Webhook"].json["newPhotos"];
const returnId = $node["Webhook"].json["returnId"];
// In real implementation, integrate with image enhancement API
return [{
json: {
processedPhotos: photos.map(photo => ({
url: photo,
enhanced: true,
watermarked: true
})),
mainPhoto: photos[0],
galleryPhotos: photos.slice(1)
}
}];
Dynamic Pricing Calculation
// Function Node - Calculate optimal pricing
const originalPrice = $node["Airtable"].json["Original Price"];
const condition = $node["Webhook"].json["finalCondition"];
const refurbishmentCost = $node["Webhook"].json["refurbishmentCost"];
const marketData = await getMarketPricing($node["Airtable"].json["Product SKU"]);
const conditionMultipliers = {
"like-new": 0.85,
"excellent": 0.75,
"good": 0.65,
"fair": 0.50
};
const basePrice = originalPrice * conditionMultipliers[condition];
const minPrice = refurbishmentCost * 1.3; // 30% markup minimum
const marketPrice = marketData.averagePrice * 0.95; // 5% below market
const finalPrice = Math.max(minPrice, Math.min(basePrice, marketPrice));
return [{
json: {
listingPrice: finalPrice,
minAcceptablePrice: minPrice,
marketPosition: "competitive",
profitMargin: ((finalPrice - refurbishmentCost) / finalPrice * 100).toFixed(1)
}
}];
Multi-Platform Listing Creation
eBay Listing:
{
"title": "{{ $node['Airtable'].json['Product Name'] }} - Refurbished {{ $node['Webhook'].json['finalCondition'] }}",
"description": `
🌱 SUSTAINABLY REFURBISHED ITEM 🌱
This {{ $node['Airtable'].json['Product Name'] }} has been professionally refurbished to {{ $node['Webhook'].json['finalCondition'] }} condition.
✅ What we did:
- Professional cleaning and sanitization
- Quality inspection and testing
- {{ $node['Webhook'].json['refurbishmentNotes'] }}
🌍 Environmental Impact:
By purchasing this refurbished item, you're helping save {{ calculateCarbonSaved() }}kg of CO2 compared to buying new!
📦 Includes: Original packaging (when available), 30-day warranty
🚚 Fast shipping with tracking
♻️ Part of our circular economy initiative
`,
"price": "{{ $node['Pricing'].json['listingPrice'] }}",
"condition": "{{ $node['Webhook'].json['finalCondition'] }}",
"category": "{{ $node['Airtable'].json['Category'] }}",
"photos": "{{ $node['PhotoProcessing'].json['processedPhotos'] }}",
"shipping": {
"free": true,
"expedited": true
},
"tags": ["refurbished", "sustainable", "eco-friendly", "circular-economy"]
}
Internal Store Listing:
{
"sku": "REF-{{ $node['Webhook'].json['returnId'] }}",
"title": "{{ $node['Airtable'].json['Product Name'] }} (Refurbished)",
"price": "{{ $node['Pricing'].json['listingPrice'] }}",
"compareAtPrice": "{{ $node['Airtable'].json['Original Price'] }}",
"inventory": 1,
"tags": ["refurbished", "sustainable", "returns"],
"metafields": {
"refurbishment_cost": "{{ $node['Webhook'].json['refurbishmentCost'] }}",
"carbon_saved": "{{ calculateCarbonSaved() }}",
"original_return_reason": "{{ $node['Airtable'].json['Return Reason'] }}"
}
}
Workflow Structure:
Product Lifecycle Events → Carbon Calculation → Sustainability Database → ESG Reporting → Carbon Offset Purchase
Carbon Impact Calculation Function
// Function Node - Calculate environmental impact
function calculateCarbonImpact(productData, lifecycle) {
const carbonFactors = {
manufacturing: {
electronics: 50, // kg CO2 per unit
clothing: 15,
furniture: 100,
default: 25
},
shipping: {
domestic: 2,
international: 8
},
disposal: {
landfill: 5,
incineration: 3,
recycling: -2 // negative = carbon saved
}
};
const category = productData.category.toLowerCase();
const manufacturingCarbon = carbonFactors.manufacturing[category] || carbonFactors.manufacturing.default;
let totalImpact = 0;
switch(lifecycle.stage) {
case 'return_processed':
// Carbon saved by not manufacturing new item
totalImpact = -manufacturingCarbon * 0.8; // 80% of manufacturing carbon saved
break;
case 'refurbished':
// Additional carbon from refurbishment process
totalImpact = manufacturingCarbon * 0.1; // 10% of manufacturing carbon
break;
case 'resold':
// Net positive impact
totalImpact = -manufacturingCarbon * 0.7; // 70% carbon savings realized
break;
case 'recycled':
totalImpact = carbonFactors.disposal.recycling;
break;
}
return {
carbonImpact: totalImpact,
stage: lifecycle.stage,
calculatedAt: new Date().toISOString(),
methodology: "Circular Economy LCA v2.1"
};
}
const productData = $node["Airtable"].json;
const lifecycle = $node["Webhook"].json;
return [{
json: calculateCarbonImpact(productData, lifecycle)
}];
Sustainability Database Update (Google Sheets)
// Sustainability tracking spreadsheet
{
"Date": "{{ new Date().toISOString().split('T')[0] }}",
"Return ID": "{{ $node['Webhook'].json['returnId'] }}",
"Product Category": "{{ $node['Airtable'].json['Category'] }}",
"Lifecycle Stage": "{{ $node['CarbonCalc'].json['stage'] }}",
"Carbon Impact (kg CO2)": "{{ $node['CarbonCalc'].json['carbonImpact'] }}",
"Cumulative Savings": "=SUM(E:E)", // Excel formula for running total
"Revenue Recovery": "{{ $node['Pricing'].json['listingPrice'] || 0 }}",
"Refurbishment Cost": "{{ $node['Webhook'].json['refurbishmentCost'] || 0 }}",
"Net Profit": "={{ $node['Pricing'].json['listingPrice'] }} - {{ $node['Webhook'].json['refurbishmentCost'] }}",
"ESG Score": "{{ calculateESGScore() }}"
}
Monthly ESG Report Generation
// Function Node - Generate monthly sustainability report
async function generateESGReport(month, year) {
const data = await getMonthlyData(month, year);
const report = {
reportPeriod: `${month}/${year}`,
metrics: {
totalReturns: data.returns.length,
itemsRefurbished: data.returns.filter(r => r.status === 'refurbished').length,
itemsResold: data.returns.filter(r => r.status === 'resold').length,
itemsRecycled: data.returns.filter(r => r.status === 'recycled').length,
carbonSaved: data.returns.reduce((sum, r) => sum + (r.carbonImpact || 0), 0),
revenueRecovered: data.returns.reduce((sum, r) => sum + (r.resaleValue || 0), 0),
wasteReduced: data.returns.length * 0.5, // kg per item average
circularityRate: (data.returns.filter(r => r.status === 'resold').length / data.returns.length * 100).toFixed(1)
},
goals: {
carbonReduction: {
target: 1000, // kg CO2 per month
actual: data.returns.reduce((sum, r) => sum + Math.abs(r.carbonImpact || 0), 0),
achievement: "{{ (actual/target*100).toFixed(1) }}%"
},
circularityRate: {
target: 75, // percentage
actual: "{{ metrics.circularityRate }}",
achievement: "{{ (actual/target*100).toFixed(1) }}%"
}
}
};
return report;
}
return [{
json: await generateESGReport(new Date().getMonth() + 1, new Date().getFullYear())
}];
Carbon Offset Purchase Workflow
// Function Node - Calculate required offsets
const monthlyCarbon = $node["ESGReport"].json.metrics.carbonSaved;
const offsetRequired = Math.max(0, -monthlyCarbon); // Only offset positive emissions
if (offsetRequired > 0) {
return [{
json: {
offsetAmount: offsetRequired,
offsetCost: offsetRequired * 0.02, // $0.02 per kg CO2
provider: "verified-carbon-standard",
projectType: "reforestation",
purchaseDate: new Date().toISOString()
}
}];
}
return [{ json: { offsetRequired: false } }];
Carbon Offset API Integration
// HTTP Request Node - Purchase carbon offsets
{
"method": "POST",
"url": "https://api.carbonoffsetprovider.com/v1/purchases",
"headers": {
"Authorization": "Bearer {{ $env.CARBON_OFFSET_API_KEY }}",
"Content-Type": "application/json"
},
"body": {
"amount_kg": "{{ $node['OffsetCalc'].json['offsetAmount'] }}",
"project_type": "reforestation",
"metadata": {
"company": "Your Company",
"period": "{{ $node['ESGReport'].json['reportPeriod'] }}",
"source": "circular-economy-returns"
}
}
}
Complete Workflow Test Sequence
1. Submit return request → Verify AI analysis
2. Mark item received → Check QC assignment
3. Complete refurbishment → Verify listing creation
4. Simulate sale → Check financial integration
5. Review sustainability metrics → Verify carbon calculations
Performance Monitoring Setup
// Function Node - Workflow Performance Tracking
const startTime = $node["Webhook"].json["timestamp"];
const currentTime = new Date().toISOString();
const processingTime = new Date(currentTime) - new Date(startTime);
return [{
json: {
workflowId: $workflow.id,
executionTime: processingTime,
stage: "{{ $node.name }}",
performance: {
fast: processingTime < 30000, // 30 seconds
acceptable: processingTime < 120000, // 2 minutes
slow: processingTime >= 120000
}
}
}];
Batch Processing for High Volume
// Function Node - Batch Processing Logic
const batchSize = 50;
const items = $node["Webhook"].json["items"];
const batches = [];
for (let i = 0; i < items.length; i += batchSize) {
batches.push(items.slice(i, i + batchSize));
}
return batches.map((batch, index) => ({
json: {
batchId: `BATCH-${Date.now()}-${index}`,
items: batch,
batchSize: batch.length,
totalBatches: batches.length
}
}));
Error Recovery & Retry Logic
// Function Node - Retry Logic
const maxRetries = 3;
const currentRetry = $node["Webhook"].json["retryCount"] || 0;
if (currentRetry < maxRetries) {
return [{
json: {
...($node["Webhook"].json),
retryCount: currentRetry + 1,
retryDelay: Math.pow(2, currentRetry) * 1000 // Exponential backoff
}
}];
} else {
// Send to manual review queue
return [{
json: {
status: "manual_review_required",
reason: "max_retries_exceeded",
originalData: $node["Webhook"].json
}
}];
}
Revenue Recovery:
Cost Reduction:
Sustainability Impact:
Operational Efficiency:
Financial KPIs:
Operational KPIs:
Sustainability KPIs:
You've now built a comprehensive Circular Economy Returns & Sustainability Orchestrator that transforms returns from a cost center into a strategic advantage. This system demonstrates:
This platform positions your business as a leader in sustainable commerce while delivering measurable ROI and competitive advantage.