{"record":{"id":"fb8d548870099163","repo":"twentyhq/twenty","slug":"standard-application-is-missing-workflow-field-cor","errorCode":null,"errorMessage":"Standard application is missing workflow field coreWorkflowId","messagePattern":"Standard application is missing workflow field coreWorkflowId","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-23/2-23-workspace-command-1784286706000-add-workflow-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_ID_FIELD_UNIVERSAL_IDENTIFIER,\n      },\n    );\n\n    if (!isDefined(standardField)) {\n      throw new Error(\n        'Standard application is missing workflow field coreWorkflowId',\n      );\n    }\n\n    if (isDryRun) {\n      this.logger.log(\n        `[DRY RUN] Would add coreWorkflowId 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-23/2-23-workspace-command-1784286706000-add-workflow-core-soft-ref-field.command.ts#L75-L111","documentation":"Thrown by the 2.23 command that adds the coreWorkflowId soft-ref field to the workflow object. After confirming the workspace has a workflow object but lacks coreWorkflowId, the command looks up the standard field via findFlatEntityByUniversalIdentifier in the computed standard flat field metadata maps. If STANDARD_OBJECTS.workflow.fields.coreWorkflowId is absent from the standard definitions, the lookup returns undefined and the command throws.","triggerScenarios":"Running 'upgrade:2-23:add-workflow-core-soft-ref-field' when twenty-shared/metadata does not define STANDARD_OBJECTS.workflow.fields.coreWorkflowId.universalIdentifier. Caused by version skew between twenty-server and twenty-shared, or the field was removed/renamed.","commonSituations":"Forked twenty-shared where workflow fields were customized; running against an older twenty-shared build that predates coreWorkflowId; a regression in standard definitions.","solutions":["Verify STANDARD_OBJECTS.workflow.fields.coreWorkflowId 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.workflow?.fields?.coreWorkflowId?.universalIdentifier;\n\nif (!fieldUid) {\n  throw new Error('twenty-shared does not define workflow.fields.coreWorkflowId — 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","Run with --dryRun first to confirm the standard field resolves","Keep twenty-server and twenty-shared at the same release version","Add integration tests verifying standard field identifiers"],"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"}