Troubleshooting
This chapter provides solutions for common issues encountered when running the n8n workflow for SFCC to Fredhopper integration.
Common Issues
Authentication Errors
SFCC OAuth2 Token Failure
Symptoms:
Node "Get auth token" fails
Error:
401 Unauthorizedorinvalid_client
Causes & Solutions:
Invalid client credentials
Verify Client ID and Secret in Account Manager
Expired credentials
Regenerate credentials in Account Manager
Wrong credential type
Ensure HTTP Basic Auth is configured, not Bearer
Organization access
Verify client has access to your organization
Verification Steps:
Test credentials manually with curl:
curl -X POST https://account.demandware.com/dw/oauth2/access_token \ -u "CLIENT_ID:CLIENT_SECRET" \ -d "grant_type=client_credentials"Check Account Manager for client status
Verify organization membership
Fredhopper Authentication Failure
Symptoms:
Node "Get authentication token" fails
Error:
401orInvalid credentials
Causes & Solutions:
Invalid API credentials
Check Fredhopper credentials in n8n
Wrong tenant/environment
Verify tenant ID and environment
Expired API key
Request new credentials from Crownpeak
SFCC API Errors
403 Forbidden on API Calls
Symptoms:
Category or product API calls fail with
403Error:
Access deniedorInsufficient permissions
Causes & Solutions:
Missing OCAPI Configuration:
Go to Business Manager → Administration → Site Development → Open Commerce API Settings
Add configuration for your client ID
Shop API Permissions:
Data API Permissions:
404 Not Found
Symptoms:
API calls return
404Error:
Category not foundorProduct not found
Causes & Solutions:
Catalog
Invalid catalog ID
Verify catalog exists in Business Manager
Category
Category deleted/renamed
Check catalog category list
Product
Product not online
Ensure products are orderable/online
Site
Invalid site ID
Verify site ID in configuration
429 Rate Limited
Symptoms:
API calls sporadically fail
Error:
429 Too Many Requests
Solutions:
Increase pagination interval:
In HTTP Request nodes, change
requestIntervalfrom500to1000or higher
Reduce batch size:
Change
countparameter from50to25
Schedule off-peak:
Run the workflow during low-traffic hours
Request limit increase:
Contact Salesforce support for higher rate limits
Fredhopper API Errors
Schema Already Exists
Symptoms:
"Create an item schema" fails
Error contains:
already exists
Expected Behavior: This is handled automatically by the workflow. The "Item schema exists?" node routes to "Update existing item schema".
If still failing:
Check if the error message differs from expected
Verify schema name matches configuration
Manually delete schema in Fredhopper if corrupted
Category Tree Already Exists
Symptoms:
"Create a category tree" fails
Error contains:
The category tree already exists
Expected Behavior: Handled by the workflow routing to "Update existing category tree".
If still failing:
Verify category tree name in configuration
Check for naming conflicts in Fredhopper
Invalid Attribute Type
Symptoms:
Schema creation/update fails
Error:
Invalid attribute type
Causes & Solutions:
string
TEXT
Mapping incorrect
enum-of-string
TEXT
Unsupported type
set-of-string
(not supported)
Needs custom handling
int
INTEGER
Check for decimals
Custom Type Handling: If SFCC uses types not in the default mapping, modify the "Collect attributes" node:
Catalog Activation Failure
Symptoms:
"Activate inactive catalog" fails
Error:
Cannot activate catalogorValidation failed
Causes & Solutions:
No items in catalog
Verify item ingestion succeeded
Invalid item references
Check category IDs in items match tree
Schema version mismatch
Ensure catalog references correct schema version
Missing required attributes
Add missing attributes to items
Debugging:
Check catalog state in Fredhopper dashboard
Use Fredhopper Feedback API to view ingestion errors
Verify item counts match expected
Data Transformation Issues
Missing Products in Fredhopper
Symptoms:
Product count in Fredhopper lower than SFCC
Some products not searchable
Causes & Solutions:
Products not master type:
Workflow filters for
htype=masterVariants without masters won't be included
Products not in root category:
Workflow uses
cgid=rootrefinementEnsure products have category assignments
Products not online:
Check product online/orderable status in SFCC
Transformation errors:
Check n8n execution logs for failed items
Verify attribute values are valid
Incorrect Category Assignments
Symptoms:
Products show in wrong categories
Category navigation doesn't work
Causes & Solutions:
Category ID sanitization:
IDs like
mens-clothingbecomemensclothingEnsure consistency between tree and item categories
Primary category mismatch:
Workflow uses
primary_category_idSecondary categories are not included
Category not in tree:
Ensure all categories exist in category tree
Check for orphan categories
Missing Images
Symptoms:
Products show without images
Wrong images for variants
Causes & Solutions:
Image group structure:
Verify SFCC image groups have
variation_attributesCheck image group
view_typematches expectations
Color matching:
Image extraction matches by
colorattributeVerify color values are consistent
Missing fallback:
If no color match, uses first image in first group
Ensure at least one image exists
Custom Image Logic: Modify the getVariantImageUrl function if your image structure differs:
Workflow Debugging
Enable Detailed Logging
In n8n Settings, enable Save Execution Progress
Set log level to Debug
Check execution history for detailed step output
Test Individual Nodes
Click on any node
Select "Execute Node" to run just that step
Check input/output data in the panel
Common Debug Points
Auth
Get auth token
access_token in output
Categories
Get all categories
Category count, IDs
Attributes
Collect attributes
attributes and nestedAttributes arrays
Products
Get all products
Product count, IDs
Items
Create/update items
JSON payload structure
Performance Optimization
Large Catalogs
For catalogs with 10,000+ products:
Increase batch processing:
Adjust Loop node batch size based on memory
Use incremental sync:
Modify workflow to only sync changed products
Track last sync timestamp
Parallel processing:
Split into multiple workflows by category
Merge results at the end
Memory Issues
If n8n runs out of memory:
Reduce
countparameter in API callsProcess in smaller batches
Increase n8n memory allocation
Use n8n's streaming mode for large datasets
Frequently Asked Questions
Q: How often should I run the sync?
A: Depends on your catalog change frequency:
Real-time changes: Use incremental sync with webhooks
Daily updates: Schedule workflow once per day
Occasional updates: Run manually when needed
Q: Can I sync multiple sites/catalogs?
A: Yes, options include:
Duplicate workflow with different configurations
Use workflow variables for site-specific settings
Create a parent workflow that calls the sync workflow for each site
Q: How do I handle localization?
A: The current workflow uses en_GB locale. To support multiple locales:
Fetch localized category names from SFCC
Modify category tree structure for multiple
localizedNamesAdd localized attributes to item schema
Q: What happens if the workflow fails mid-execution?
A: The catalog remains inactive until activation succeeds. You can:
Fix the issue and re-run
Delete the incomplete inactive catalog
Previous active catalog remains unaffected
Q: How do I add custom attributes?
A: Modify the "Collect attributes" node:
Add attributes to the
attributesornestedAttributesarrayEnsure the attribute exists in the item data
Re-run the workflow to update schema and items
Support Resources
SFCC Documentation: OCAPI Reference
Fredhopper Documentation: Product Discovery Developer Guide
n8n Documentation: n8n Docs
Crownpeak PD Node: npm Package
Last updated

