Fix manual trigger variables + workflow not found in sentry (#14509)
- Error in [sentry](https://twenty-v7.sentry.io/issues/6677390012/?environment=prod&environment=prod-eu&project=4507072499810304&query=is%3Aunresolved%20%21issue.type%3A%5Bperformance_consecutive_db_queries%2Cperformance_consecutive_http%2Cperformance_file_io_main_thread%2Cperformance_db_main_thread%2Cperformance_n_plus_one_db_queries%2Cperformance_n_plus_one_api_calls%2Cperformance_p95_endpoint_regression%2Cperformance_slow_db_query%2Cperformance_render_blocking_asset_span%2Cperformance_uncompressed_assets%2Cperformance_http_overhead%2Cperformance_large_http_payload%5D%20timesSeen%3A%3E10&referrer=issue-stream) : due to workflow being deleted, so not found - Error with Manual Trigger variable fixed Before <img width="1020" height="359" alt="Capture d’écran 2025-09-15 à 16 24 34" src="https://github.com/user-attachments/assets/0d4b5185-18b5-415f-afbc-8bb63e403c01" /> After <img width="1020" height="359" alt="Capture d’écran 2025-09-15 à 16 24 02" src="https://github.com/user-attachments/assets/c5b589f8-7abd-40d0-8473-69eab7e1a277" />
This commit is contained in:
+2
-2
@@ -9,14 +9,14 @@ import { isCodeOutputSchema } from './isCodeOutputSchema';
|
||||
import { isDatabaseEventTriggerOutputSchema } from './isDatabaseEventTriggerOutputSchema';
|
||||
import { isFindRecordsOutputSchema } from './isFindRecordsOutputSchema';
|
||||
import { isFormOutputSchema } from './isFormOutputSchema';
|
||||
import { isRecordActionOutputSchema } from './isRecordActionOutputSchema';
|
||||
import { isRecordStepOutputSchema } from './isRecordStepOutputSchema';
|
||||
|
||||
export const isOpenStepOutputSchema = (
|
||||
stepType: WorkflowActionType | WorkflowTriggerType,
|
||||
schema: OutputSchemaV2,
|
||||
): schema is OpenStepOutputSchema => {
|
||||
return (
|
||||
!isRecordActionOutputSchema(stepType, schema) &&
|
||||
!isRecordStepOutputSchema(stepType, schema) &&
|
||||
!isDatabaseEventTriggerOutputSchema(stepType, schema) &&
|
||||
!isFindRecordsOutputSchema(stepType, schema) &&
|
||||
!isFormOutputSchema(stepType, schema) &&
|
||||
|
||||
+8
-3
@@ -5,11 +5,16 @@ import {
|
||||
import { type RecordActionOutputSchema } from '@/workflow/workflow-variables/types/RecordActionOutputSchema';
|
||||
import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
|
||||
|
||||
const RECORD_ACTION_TYPES = ['CREATE_RECORD', 'UPDATE_RECORD', 'DELETE_RECORD'];
|
||||
const RECORD_STEP_TYPES = [
|
||||
'CREATE_RECORD',
|
||||
'UPDATE_RECORD',
|
||||
'DELETE_RECORD',
|
||||
'MANUAL',
|
||||
];
|
||||
|
||||
export const isRecordActionOutputSchema = (
|
||||
export const isRecordStepOutputSchema = (
|
||||
stepType: WorkflowActionType | WorkflowTriggerType,
|
||||
schema: OutputSchemaV2,
|
||||
): schema is RecordActionOutputSchema => {
|
||||
return RECORD_ACTION_TYPES.includes(stepType);
|
||||
return RECORD_STEP_TYPES.includes(stepType);
|
||||
};
|
||||
+2
-2
@@ -6,7 +6,7 @@ import { isCodeOutputSchema } from '@/workflow/workflow-variables/types/guards/i
|
||||
import { isDatabaseEventTriggerOutputSchema } from '@/workflow/workflow-variables/types/guards/isDatabaseEventTriggerOutputSchema';
|
||||
import { isFindRecordsOutputSchema } from '@/workflow/workflow-variables/types/guards/isFindRecordsOutputSchema';
|
||||
import { isFormOutputSchema } from '@/workflow/workflow-variables/types/guards/isFormOutputSchema';
|
||||
import { isRecordActionOutputSchema } from '@/workflow/workflow-variables/types/guards/isRecordActionOutputSchema';
|
||||
import { isRecordStepOutputSchema } from '@/workflow/workflow-variables/types/guards/isRecordStepOutputSchema';
|
||||
import { type StepOutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
|
||||
|
||||
import { searchVariableThroughBaseOutputSchema } from '@/workflow/workflow-variables/utils/searchVariableThroughBaseOutputSchema';
|
||||
@@ -27,7 +27,7 @@ export const searchVariableThroughOutputSchemaV2 = ({
|
||||
rawVariableName: string;
|
||||
isFullRecord: boolean;
|
||||
}) => {
|
||||
if (isRecordActionOutputSchema(stepType, stepOutputSchema.outputSchema)) {
|
||||
if (isRecordStepOutputSchema(stepType, stepOutputSchema.outputSchema)) {
|
||||
return searchVariableThroughRecordOutputSchema({
|
||||
stepName: stepOutputSchema.name,
|
||||
recordOutputSchema: stepOutputSchema.outputSchema,
|
||||
|
||||
+1
@@ -128,6 +128,7 @@ export class WorkflowStatusesUpdateJob {
|
||||
where: {
|
||||
id: workflowId,
|
||||
},
|
||||
withDeleted: true,
|
||||
});
|
||||
|
||||
if (isEqual(newWorkflowStatuses, previousWorkflow.statuses)) {
|
||||
|
||||
Reference in New Issue
Block a user