Skip to content

The open alternative to Salesforce, designed for AI.

fix(workflow): stop reconciling workflows to core on the created event (#26648)

Thomas Trompette4a8ef5571a87
diff --git a/packages/twenty-server/src/modules/workflow/workflow-core-sync/listeners/workflow-core-dual-write.listener.ts b/packages/twenty-server/src/modules/workflow/workflow-core-sync/listeners/workflow-core-dual-write.listener.ts
index 715014e8119..0c081ba1b7f 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-core-sync/listeners/workflow-core-dual-write.listener.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-core-sync/listeners/workflow-core-dual-write.listener.ts
@@ -1,7 +1,6 @@
import { Injectable } from '@nestjs/common';
import {
- type ObjectRecordCreateEvent,
type ObjectRecordDeleteEvent,
type ObjectRecordDestroyEvent,
type ObjectRecordRestoreEvent,
@@ -23,18 +22,6 @@ export class WorkflowCoreDualWriteListener {
private readonly workflowCoreSyncService: WorkflowCoreSyncService,
) {}
- @OnDatabaseBatchEvent('workflow', DatabaseEventAction.CREATED)
- async handleCreated(
- batchEvent: CustomWorkspaceEventBatch<
- ObjectRecordCreateEvent<WorkflowWorkspaceEntity>
- >,
- ): Promise<void> {
- await this.upsertToCore(
- batchEvent.workspaceId,
- batchEvent.events.map((event) => event.properties.after.id),
- );
- }
-
@OnDatabaseBatchEvent('workflow', DatabaseEventAction.UPDATED)
async handleUpdated(
batchEvent: CustomWorkspaceEventBatch<