Shopware 6 plugin that connects a Shopware instance to SyncEngine and dispatches mapped automation endpoints when entities change.
- SyncEngine API connection via host + token (+ optional custom auth header)
- Trigger discovery + mapping from SyncEngine automations/connections to Shopware trigger blueprints
- Entity event dispatching for Product, Order, and Customer create/update/delete operations
- Shopware Flow Builder integration with action
Trigger SyncEngine Endpoint(endpoint picker, optional trigger-event override, optional custom JSON payload) - Connector action routes for status, cache refresh, trigger-map inspection, and Flow endpoint listing
- Shopware Administration tools to inspect and refresh the current trigger map
- Refresh trust + throttling to protect refresh endpoint from request storms
- Local development support (localhost/DDEV/docker host TLS handling)
- Shopware 6 (plugin-compatible version)
- Reachable SyncEngine installation
- SyncEngine API token with read access to:
- automations
- connections
- endpoints (for endpoint picker/dispatch behavior)
- For automatic trigger discovery, corresponding SyncEngine module blueprints must exist (for example
SyncEngine/ShopwareAdminV1:*trigger blueprints)
- Install/activate the plugin in Shopware.
- Go to Settings -> Extensions -> SyncEngine (plugin config card).
- Fill in:
- SyncEngine Host (for example
https://syncengine.example.com) - SyncEngine Token
- Auth Header (optional; defaults to
Authorization: Bearer <token>when empty)
- SyncEngine Host (for example
- Ensure Enable trigger dispatching is on.
The plugin uses Shopware SystemConfig keys under SyncEngineConnector.config.*.
| Setting | Key | Description |
|---|---|---|
| SyncEngine Host | apiHost |
Base URL of SyncEngine |
| SyncEngine Token | apiToken |
API token used by the connector |
| Auth Header (optional) | apiAuthHeader |
Custom auth header name |
| Enable trigger dispatching | triggersEnabled |
Global dispatch on/off switch |
- Trigger endpoint map cache and timestamp
- Refresh throttle state (trusted/untrusted buckets)
- Known trusted connection references
- SyncEngine API status/endpoints cache
When user-managed settings change, caches are invalidated automatically.
The plugin subscribes to Shopware DAL written events and maps operations to SyncEngine triggers:
| Entity | Insert | Update | Delete |
|---|---|---|---|
| Product | new_product |
updated_product |
deleted_product |
| Order | new_order |
updated_order |
deleted_order |
| Customer | new_customer |
updated_customer |
deleted_customer |
Dispatch event names in payload:
shopware_new_productshopware_updated_productshopware_deleted_productshopware_new_ordershopware_updated_ordershopware_deleted_ordershopware_new_customershopware_updated_customershopware_deleted_customer
Trigger map construction flow:
- Load automations from SyncEngine
- Load connections from SyncEngine
- Filter to local Shopware connection(s) by normalized host match
- Match automation blueprint class to trigger key
- Cache resulting trigger -> endpoints map for 5 minutes
Supported blueprint class mapping includes:
SyncEngine/ShopwareAdminV1:NewProductSyncEngine/ShopwareAdminV1:UpdatedProductSyncEngine/ShopwareAdminV1:DeletedProductSyncEngine/ShopwareAdminV1:NewOrderSyncEngine/ShopwareAdminV1:UpdatedOrderSyncEngine/ShopwareAdminV1:DeletedOrderSyncEngine/ShopwareAdminV1:NewCustomerSyncEngine/ShopwareAdminV1:UpdatedCustomerSyncEngine/ShopwareAdminV1:DeletedCustomer
Outgoing trigger payload uses JSON:API-like envelope for entity data:
{
"id": "<entity-id>",
"event": "shopware_updated_product",
"data": {
"data": {
"id": "<entity-id>",
"type": "product",
"attributes": { ... },
"relationships": { ... },
"meta": null
},
"included": [],
"_handler": "syncengine"
},
"request": {
"id": "<entity-id>"
}
}For delete events, attributes/relationships are empty but envelope remains stable.
The Flow Builder action Trigger SyncEngine Endpoint dispatches to a selected SyncEngine endpoint.
Config fields in the modal:
- Endpoint (required): selected from
/api/_action/syncengine/endpoints - Trigger event name (optional): overrides event name sent to SyncEngine
- Custom payload JSON (optional): validated JSON merged as custom payload input
When trigger event name is empty, the plugin derives a default event name from the Flow/action context.
The action also forwards selected entity context when available (for example order/customer/product references), and sanitizes payload content for safe transport.
The plugin exposes these Shopware API action routes:
| Method | Route | Description |
|---|---|---|
GET |
/api/_action/syncengine/status |
Fast local status check (online) |
POST |
/api/_action/syncengine/refresh |
Clears trigger map cache (throttled) |
GET |
/api/_action/syncengine/trigger-map |
Returns current cached/rebuilt trigger map |
GET |
/api/_action/syncengine/endpoints |
Returns endpoint options for Flow Builder endpoint picker |
{
"success": true,
"status": "online"
}{
"success": true,
"refreshed": true,
"trusted": false,
"timestamp": 1712345678
}{
"success": true,
"refreshed": false,
"reason": "throttled",
"trusted": false
}{
"success": true,
"updatedAt": 1712345678,
"triggerMap": {
"new_product": ["endpoint-a"],
"updated_product": [],
"deleted_product": []
}
}{
"success": true,
"endpoints": [
{
"value": "endpoint-a",
"label": "endpoint-a"
}
]
}Refresh requests can provide X-SyncEngine-Connection header.
The plugin tracks trusted connection refs discovered during trigger-map resolution and applies different throttle windows:
| Request type | Window |
|---|---|
| Trusted ref | 1 second |
| Untrusted/anonymous | 10 seconds |
This keeps endpoint responsive while preventing invalidation storms.
The plugin registers a settings module entry:
- Settings -> Plugins -> SyncEngine Trigger Map
- Flow Builder action -> Trigger SyncEngine Endpoint
Capabilities:
- View all trigger keys and resolved endpoint mappings
- Inspect endpoint counts
- Manual refresh action (calls connector refresh endpoint)
- In Flow Builder: select endpoint, optionally override trigger event name, optionally provide custom JSON payload
The internal SyncEngine API client disables TLS peer/host verification for local development hosts:
localhost,127.0.0.1,::1host.docker.internal,gateway.docker.internal*.ddev.site,*.localhost,*.local,*.test
This improves local DDEV/docker interoperability.
After changing files under src/Resources/app/administration/, rebuild administration assets in Shopware.
Typical workflow:
- Rebuild administration bundle
- Clear cache if needed
- Reload admin and test trigger map module
- API routes:
src/Controller/SyncEngineController.php - Trigger map logic:
src/Service/TriggerService.php - Payload shaping:
src/Service/ShopwarePayloadService.php - Dispatch:
src/Service/EndpointDispatcherService.php - Event subscription:
src/Subscriber/EntityTriggerSubscriber.php - Admin module:
src/Resources/app/administration/src/module/syncengine/
Check:
- SyncEngine Host/Token are configured
- SyncEngine is reachable from Shopware runtime
- Automations use Shopware trigger blueprints
- Local host normalization matches the configured Shopware connection host in SyncEngine
Expected behavior under rapid repeated calls. Wait for the throttle window (1s trusted, 10s untrusted).
Check:
triggersEnabledis true- Trigger map contains endpoints for the emitted trigger
- Endpoint execution errors in SyncEngine response payload/result logs
Ensure your host matches supported local-dev patterns listed above.