Automation for Magento 2 with KatanaPIM
Looking for Magento 2 KatanaPIM integration? View the full Magento 2 KatanaPIM integration page to explore features, configuration options, and pricing.
Set up automated synchronization between KatanaPIM and Magento using cron jobs. This guide walks you through enabling automation, configuring schedules, and tuning performance.
Overview
KatanaPIM Connect automates catalog synchronization using two cron jobs:
| Cron Job | Purpose | Default Schedule |
|---|---|---|
| Full Data Sync | Fetches all data from KatanaPIM API and detects changes | Every 8 hours |
| Incremental Sync | Syncs pending changes to Magento | Every 5 minutes |
This two-phase approach separates data fetching from Magento processing. The Full Data Sync fetches and compares data, while the Incremental Sync handles the actual Magento catalog updates.
Prerequisites
Before enabling automation, ensure:
- The module is enabled (Katana PIM → Configuration → General)
- API credentials are configured and tested
- Store language mapping is set up
- Attribute mapping is complete (Katana PIM → Attributes)
- Magento cron is running (
bin/magento cron:runor system crontab)
Step 1: Enable Automation
- Go to Stores → Configuration → Katana PIM → Automation
- Set Enable Automation to Yes
This is the master switch. When disabled, all cron jobs skip execution. CLI commands still work regardless of this setting.
Step 2: Configure Auto-Create Settings
These settings control whether cron jobs can create new entities or only update existing ones.
| Setting | Description | Recommendation |
|---|---|---|
| Auto create new products | Allow cron to create new Magento products from PIM | See below |
| Auto create new categories | Allow cron to create new Magento categories from PIM | See below |
Conservative Approach (Recommended for Initial Setup)
Set both to No. New products and categories from PIM appear in the Katana PIM grids but are not created in Magento until you manually trigger the sync via mass actions or CLI. This gives you full control over what enters your catalog.
Hands-Off Approach
Set both to Yes for fully automated catalog management. Any new product or category added in KatanaPIM will automatically appear in Magento after the next sync cycle.
Tip: Start with the conservative approach. Once you've verified the sync works correctly and your attribute mappings are complete, switch to hands-off.
Step 3: Set Sync Schedules
Full Data Sync
Fetches all data from the KatanaPIM API (attributes, categories, products, assets) and stores it in local tables. Data is compared using a hash and marked as needs_update when changes are detected.
Available frequencies:
| Schedule | Cron Expression | Best For |
|---|---|---|
| Every 4 hours | 16 */4 * * * |
Catalogs that change frequently |
| Every 6 hours | 4 */6 * * * |
Active catalogs with regular updates |
| Every 8 hours | 33 */8 * * * |
Default — good balance for most stores |
| Daily | 0 4 * * * |
Stable catalogs with few daily changes |
| Weekly | 0 4 * * MON |
Catalogs updated in batches |
| Never | — | When only using manual/CLI sync |
Incremental Sync
Fetches only changed data from the KatanaPIM API (since last sync) and processes all pending updates to Magento. This creates or updates Magento attributes, categories, products, and assets.
| Schedule | Cron Expression | Best For |
|---|---|---|
| Every 5 minutes | */5 * * * * |
Default — near real-time updates |
| Every 15 minutes | */15 * * * * |
Moderate update frequency |
| Hourly | 0 * * * * |
Lower server load |
| Every 4 hours | 16 */4 * * * |
Large catalogs with batch-style updates |
| Never | — | When only using manual/CLI sync |
Recommended Combinations
| Scenario | Full Sync | Incremental Sync |
|---|---|---|
| Small catalog (< 5,000 SKUs) | Every 8 hours | Every 5 minutes |
| Medium catalog (5,000-50,000 SKUs) | Daily | Every 15 minutes |
| Large catalog (50,000+ SKUs) | Daily or Weekly | Every 15-60 minutes |
| Infrequent PIM updates | Weekly | Every 4 hours |
Step 4: Configure Processing Limits
Processing limits prevent cron jobs from consuming too many resources. These are configured under Stores → Configuration → Katana PIM → General → Limits → Cron Limits.
| Setting | Default | Description |
|---|---|---|
| Max Products per Cron | 100 | Products processed per incremental cron run |
| Max Categories per Cron | 100 | Categories processed per incremental cron run |
| Max Attributes per Cron | 100 | Attributes processed per incremental cron run |
| Max Assets per Cron | 100 | Assets processed per incremental cron run |
Set to 0 for unlimited processing (not recommended for cron).
How Limits Work
If 500 products have pending updates and the limit is 100:
- Run 1: processes products 1-100
- Run 2: processes products 101-200
- Run 3: processes products 201-300
- ...and so on
With a 5-minute incremental schedule, all 500 products sync within approximately 25 minutes.
Tuning Tips
- Increase limits if cron runs complete quickly and you want faster sync
- Decrease limits if cron jobs overlap, cause timeouts, or impact frontend performance
- Monitor
var/log/katanapim-cron.logto see how long each run takes
Step 5: Configure Maintenance
Under the Maintenance section:
| Setting | Default | Description |
|---|---|---|
| Sync Log Retention (days) | 30 | Automatically delete sync log entries older than this. Set to 0 to keep all logs. |
The cleanup runs daily at 3:00 AM automatically.
Verify Automation is Working
Check Sync Log
Go to Katana PIM → Sync Log to see recent sync activity, including:
- Sync type (Full/Incremental)
- Items created, updated, deleted
- Errors encountered
- Execution time
Check Cron Log File
Review var/log/katanapim-cron.log for detailed timing and processing information.
Run Cron Manually
To test if cron is working:
bin/magento cron:run --group=katanapim
Combining Automation with Manual Sync
Automation and manual operations work side by side:
| Method | When to Use |
|---|---|
| Cron (automated) | Day-to-day synchronization |
| Admin grid actions | Syncing specific products or categories on demand |
| CLI commands | Initial imports, large batch operations, troubleshooting |
CLI commands ignore automation settings and always run regardless of the Enable Automation toggle.
Useful CLI Commands
# Full sync (fetch + process) — no entity limits
bin/magento katana:import:full
# Incremental sync — respects configured limits
bin/magento katana:import:incremental
# Full sync for specific entities only
bin/magento katana:import:full --products
bin/magento katana:import:full --categories --attributes
# Fetch from API without syncing to Magento (troubleshooting)
bin/magento katana:import:full --only-api
# Sync local data to Magento without fetching from API
bin/magento katana:import:incremental --skip-api
Troubleshooting
Cron Jobs Not Running
- Verify Magento cron is active:
bin/magento cron:run --group=katanapim - Check the cron schedule table (see query above)
- Ensure Enable Automation is set to Yes
- Ensure the module is Enabled in General configuration
Sync Seems Slow
- Check processing limits — increase if runs complete quickly
- Check
var/log/katanapim-cron.logfor timing breakdown - Consider adjusting batch sizes under General → Limits
- For large initial imports, use CLI instead of cron
Products Not Appearing in Magento
- Verify Auto create new products is set to Yes
- Check the product in Katana PIM → Products grid for errors or skip flags
- Ensure attribute mapping is complete
- Run a full sync to detect all changes:
bin/magento katana:import:full
Cron Jobs Overlapping
- Decrease processing limits (Max per Cron settings)
- Increase the incremental sync interval
- Check server resources (CPU, memory)
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team
For a complete overview of features and configuration options, see Magento 2 KatanaPIM integration.