Add enhanced debugging for trigger matching

- Show detailed matching criteria for each trigger
- Display typeMatch, collectionMatch, operationMatch for debugging
- Help identify why triggers are not matching
- Assists in troubleshooting workflow execution issues
This commit is contained in:
2025-09-09 11:58:45 +02:00
parent 14d1ecf036
commit 1f80028042

View File

@@ -1035,11 +1035,18 @@ export class WorkflowExecutor {
triggerCount: triggers?.length || 0, triggerCount: triggers?.length || 0,
triggers: triggers?.map(t => ({ triggers: triggers?.map(t => ({
type: t.type, type: t.type,
parameters: t.parameters,
collection: t.parameters?.collection, collection: t.parameters?.collection,
collectionSlug: t.parameters?.collectionSlug, collectionSlug: t.parameters?.collectionSlug,
operation: t.parameters?.operation operation: t.parameters?.operation,
})) // Debug matching criteria
}, 'Checking workflow triggers') typeMatch: t.type === 'collection-trigger',
collectionMatch: (t.parameters?.collection === collection || t.parameters?.collectionSlug === collection),
operationMatch: t.parameters?.operation === operation
})),
targetCollection: collection,
targetOperation: operation
}, 'Checking workflow triggers with detailed matching info')
const matchingTriggers = triggers?.filter(trigger => const matchingTriggers = triggers?.filter(trigger =>
trigger.type === 'collection-trigger' && trigger.type === 'collection-trigger' &&