{"record":{"id":"3a41b8c6fb563b10","repo":"langflow-ai/langflow","slug":"deployment-name-is-required","errorCode":null,"errorMessage":"Deployment name is required","messagePattern":"Deployment name is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/frontend/src/pages/MainPage/pages/deploymentsPage/helpers/deployment-payload-builders.ts","lineNumber":123,"sourceCode":"  selectedLlm,\n  selectedVersionByFlow,\n  toolNameByFlow,\n}: {\n  attachedConnectionByFlow: Map<string, string[]>;\n  connections: ConnectionItem[];\n  deploymentDescription: string;\n  deploymentName: string;\n  deploymentType: DeploymentType;\n  isDeploymentNameValid: boolean;\n  projectId?: string;\n  providerId: string;\n  removedFlowIds: Set<string>;\n  selectedLlm: string;\n  selectedVersionByFlow: Map<string, SelectedFlowVersion>;\n  toolNameByFlow: Map<string, string>;\n}): DeploymentCreateRequest {\n  if (!isDeploymentNameValid) {\n    throw new Error(\"Deployment name is required\");\n  }\n  const allConnectionIds = new Set<string>();\n  Array.from(attachedConnectionByFlow.values()).forEach((ids) => {\n    ids.forEach((id) => allConnectionIds.add(id));\n  });\n\n  const addFlows: DeploymentCreateRequest[\"provider_data\"][\"add_flows\"] = [];\n  for (const [attachmentKey, versionEntry] of Array.from(\n    selectedVersionByFlow,\n  )) {\n    if (removedFlowIds.has(attachmentKey)) continue;\n    const connectionIds =\n      getValueByAttachmentKeyOrFlowId(\n        attachedConnectionByFlow,\n        attachmentKey,\n        versionEntry.flowId,\n      ) ?? [];\n    const strictToolName = getScopedToolName(","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/pages/MainPage/pages/deploymentsPage/helpers/deployment-payload-builders.ts#L105-L141","documentation":"Thrown by buildDeploymentPayload (the create-path payload builder in the deployments page) when its `isDeploymentNameValid` argument is false. Langflow requires a non-empty deployment name before it can assemble a DeploymentCreateRequest, so the builder fails fast instead of sending an invalid payload to the API.","triggerScenarios":"Clicking Create/Deploy in the new-deployment modal while the name field is empty (or fails the form's name validation), which passes isDeploymentNameValid=false into buildDeploymentPayload.","commonSituations":"UI state desync where the submit button is enabled but the name input was cleared or trimmed to empty; programmatic calls to buildDeploymentPayload without deriving isDeploymentNameValid from deploymentName.trim().length > 0.","solutions":["Fill in a non-empty deployment name in the creation form before submitting","If calling buildDeploymentPayload directly, pass isDeploymentNameValid: deploymentName.trim().length > 0","Disable the submit button while the name is invalid so the throw is unreachable","Wrap the call in try/catch and surface the message as a form-field error instead of a crash"],"exampleFix":"// before\nconst payload = buildDeploymentPayload({ ...args, isDeploymentNameValid });\n\n// after\nconst isDeploymentNameValid = deploymentName.trim().length > 0;\nconst payload = isDeploymentNameValid\n  ? buildDeploymentPayload({ ...args, isDeploymentNameValid })\n  : undefined; // keep button disabled instead","handlingStrategy":"validation","validationCode":"const isDeploymentNameValid = deploymentName.trim().length > 0;\nif (!isDeploymentNameValid) {\n  // keep the submit button disabled / show field error; never call the builder\n}","typeGuard":"const hasValidDeploymentName = (name: string): boolean =>\n  typeof name === \"string\" && name.trim().length > 0;","tryCatchPattern":"try {\n  const payload = buildDeploymentPayload(args);\n} catch (e) {\n  if (e instanceof Error && e.message === \"Deployment name is required\") {\n    focusNameInput(); // recoverable form error\n  } else throw e;\n}","preventionTips":["Derive isDeploymentNameValid from the input on every change; never cache a stale boolean","Disable submit while the name is empty or whitespace","Treat this error as a form-validation signal, not an infrastructure failure"],"tags":["frontend","deployments","validation","form"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}