Validate existing fields on creation (#12057)

Fixes https://github.com/twentyhq/twenty/issues/12040

When fields are deleted but still used in workflows we do not update
create record action settings.
It breaks all following workflow execution and the user cannot update
the settings anymore.

This PR fixes the bug by filtering on existing fields.

Next step will be to clean settings on field deletion. Adding it to fast
follows.

Also lowering throttle limit because some infinite loops are not
catched.
This commit is contained in:
Thomas Trompette
2025-05-15 13:24:57 +02:00
committed by GitHub
parent 9e00a67b25
commit 6a40ec604c
2 changed files with 8 additions and 2 deletions

View File

@ -987,7 +987,7 @@ export class ConfigVariables {
type: ConfigVariableType.NUMBER,
})
@CastToPositiveNumber()
WORKFLOW_EXEC_THROTTLE_LIMIT = 500;
WORKFLOW_EXEC_THROTTLE_LIMIT = 100;
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.RateLimiting,

View File

@ -105,9 +105,15 @@ export class CreateRecordWorkflowAction implements WorkflowExecutor {
workspaceId,
);
const validObjectRecord = Object.fromEntries(
Object.entries(workflowActionInput.objectRecord).filter(
([key]) => objectMetadataItemWithFieldsMaps.fieldsByName[key],
),
);
const transformedObjectRecord =
await this.recordInputTransformerService.process({
recordInput: workflowActionInput.objectRecord,
recordInput: validObjectRecord,
objectMetadataMapItem: objectMetadataItemWithFieldsMaps,
});