{"record":{"id":"6ac7869ff30caa16","repo":"twentyhq/twenty","slug":"standard-application-is-missing-workflowversion-fi","errorCode":null,"errorMessage":"Standard application is missing workflowVersion field coreWorkflowVersionId","messagePattern":"Standard application is missing workflowVersion field coreWorkflowVersionId","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-22/2-22-workspace-command-1784193206000-add-workflow-version-core-soft-ref-field.command.ts","lineNumber":93,"sourceCode":"        { workspaceId },\n      );\n\n    const { allFlatEntityMaps: standardAllFlatEntityMaps } =\n      computeTwentyStandardApplicationAllFlatEntityMaps({\n        now: new Date().toISOString(),\n        workspaceId,\n        twentyStandardApplicationId: twentyStandardFlatApplication.id,\n      });\n\n    const standardField = findFlatEntityByUniversalIdentifier<FlatFieldMetadata>(\n      {\n        flatEntityMaps: standardAllFlatEntityMaps.flatFieldMetadataMaps,\n        universalIdentifier: CORE_WORKFLOW_VERSION_ID_FIELD_UNIVERSAL_IDENTIFIER,\n      },\n    );\n\n    if (!isDefined(standardField)) {\n      throw new Error(\n        'Standard application is missing workflowVersion field coreWorkflowVersionId',\n      );\n    }\n\n    if (isDryRun) {\n      this.logger.log(\n        `[DRY RUN] Would add coreWorkflowVersionId field for workspace ${workspaceId}`,\n      );\n\n      return;\n    }\n\n    const flatFieldMetadataToCreate: FlatFieldMetadata = {\n      ...standardField,\n      viewFieldIds: [],\n      viewFieldUniversalIdentifiers: [],\n    };\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-22/2-22-workspace-command-1784193206000-add-workflow-version-core-soft-ref-field.command.ts#L75-L111","documentation":"Thrown by the 2.22 command that adds the coreWorkflowVersionId soft-ref field to workflowVersion. After confirming the workspace has a workflowVersion object but lacks the coreWorkflowVersionId field, the command looks up the standard field definition via findFlatEntityByUniversalIdentifier in the computed standard flat field metadata maps. If STANDARD_OBJECTS.workflowVersion.fields.coreWorkflowVersionId is absent from the standard definitions, the lookup returns undefined and the command throws.","triggerScenarios":"Running 'upgrade:2-22:add-workflow-version-core-soft-ref-field' when twenty-shared/metadata does not define STANDARD_OBJECTS.workflowVersion.fields.coreWorkflowVersionId.universalIdentifier. Caused by version skew between twenty-server and twenty-shared, or the field was removed/renamed in a fork.","commonSituations":"Forked twenty-shared where workflowVersion fields were customized; running the command against an older twenty-shared build that predates the coreWorkflowVersionId field; a regression that removed the field from standard definitions.","solutions":["Verify STANDARD_OBJECTS.workflowVersion.fields.coreWorkflowVersionId exists in the installed twenty-shared package","Rebuild twenty-shared: npx nx build twenty-shared","Ensure twenty-server and twenty-shared are at the same release tag","Run with --dryRun first to confirm the standard field resolves"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before running, verify the standard field exists in the installed definitions\nimport { STANDARD_OBJECTS } from 'twenty-shared/metadata';\n\nconst fieldUid = STANDARD_OBJECTS.workflowVersion?.fields?.coreWorkflowVersionId?.universalIdentifier;\n\nif (!fieldUid) {\n  throw new Error('twenty-shared does not define workflowVersion.fields.coreWorkflowVersionId — rebuild twenty-shared');\n}","typeGuard":"import { isDefined } from 'twenty-shared/utils';\n\nconst hasStandardField = (uid: string | undefined): uid is string =>\n  isDefined(uid) && uid.length > 0;","tryCatchPattern":null,"preventionTips":["Rebuild twenty-shared before running upgrade commands: npx nx build twenty-shared","Run with --dryRun first to confirm the standard field resolves","Keep twenty-server and twenty-shared at the same release version","Add integration tests that verify standard field identifiers resolve"],"tags":["metadata","upgrade-command","standard-application","workspace-migration","flat-field-metadata","workflow"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}