{"record":{"id":"475b9056f566b60e","repo":"langflow-ai/langflow","slug":"flow-version-id-must-be-a-valid-uuid","errorCode":null,"errorMessage":"flow_version_id must be a valid UUID.","messagePattern":"flow_version_id must be a valid UUID\\.","errorType":"validation","errorClass":"ValueError","httpStatus":422,"severity":"error","filePath":"src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/payloads.py","lineNumber":425,"sourceCode":"\n    model_config = {\"extra\": \"forbid\"}\n\n    flow_version_id: UUID\n    tool_id: NonEmptyString = Field(description=\"Provider-owned tool identifier.\")\n\n    @field_validator(\"flow_version_id\", mode=\"before\")\n    @classmethod\n    def normalize_flow_version_id(cls, value: Any) -> UUID:\n        if isinstance(value, UUID):\n            return value\n        if not isinstance(value, str):\n            msg = \"flow_version_id must be provided as a UUID string or UUID object.\"\n            raise ValueError(msg)  # noqa: TRY004\n        try:\n            return UUID(value)\n        except ValueError as exc:\n            msg = \"flow_version_id must be a valid UUID.\"\n            raise ValueError(msg) from exc\n\n\nclass WatsonxApiDeploymentCreateResultData(BaseModel):\n    \"\"\"Provider-result payload used by Watsonx mapper create shapers.\"\"\"\n\n    model_config = {\"extra\": \"ignore\"}\n\n    name: NonEmptyString = Field(description=\"Provider technical agent name.\")\n    display_name: NonEmptyString\n    created_app_ids: list[NonEmptyString] = Field(default_factory=list)\n    created_tools: list[WatsonxApiCreatedTool] = Field(default_factory=list)\n\n    @classmethod\n    def from_provider_result(cls, provider_result: Any) -> WatsonxApiDeploymentCreateResultData:\n        return cls.model_validate(provider_result)\n\n\nclass WatsonxApiDeploymentUpdateResultData(BaseModel):","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/payloads.py#L407-L443","documentation":"The same WatsonxApiCreatedTool validator accepted a string but UUID(value) raised ValueError, meaning the string is not parseable as a UUID. Pydantic UUID fields normally report this as 'value is not a valid uuid'; this custom validator replaces that with an explicit message naming flow_version_id. It fires only for strings (UUID objects and non-strings are handled by the earlier branches).","triggerScenarios":"Sending flow_version_id as a malformed string: '12345', 'v1.2.3', a version number like '1', a UUID missing dashes/characters, or with surrounding whitespace/copy-paste artifacts.","commonSituations":"Confusing the flow's semantic version ('1.0.0') or an integer version number with the UUID version id; truncating the UUID during logging/copy; building the payload from user-typed input without validation.","solutions":["Use the actual UUID returned when the flow version was created (flow_version.id), not a version number.","Validate client-side with uuid.UUID(value) (Python) or a UUID regex before sending.","Strip whitespace and verify the string has the 8-4-4-4-12 hex format.","If you store version ids in config, copy the full UUID from the Langflow API response or DB."],"exampleFix":"# before\npayload = {\"tool_id\": \"my-tool\", \"flow_version_id\": \"1.2\"}  # semantic version, not UUID\n\n# after\nimport uuid\nvid = str(flow_version.id)  # e.g. '550e8400-e29b-41d4-a716-446655440000'\nuuid.UUID(vid)  # client-side assertion before sending\npayload = {\"tool_id\": \"my-tool\", \"flow_version_id\": vid}","handlingStrategy":"validation","validationCode":"from uuid import UUID\n\ndef valid_uuid_string(s: str) -> bool:\n    try:\n        UUID(s)\n        return True\n    except (ValueError, AttributeError, TypeError):\n        return False\n\nassert valid_uuid_string(flow_version_id) before request","typeGuard":"import re\nUUID_RE = re.compile(r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\ndef is_uuid_string(v: str) -> bool: return bool(UUID_RE.match(v))","tryCatchPattern":"try: UUID(value) except ValueError: report which field and show the received value in your own validation layer, so the mapper never sees it.","preventionTips":["Never hand-type version ids; copy them from API responses.","Distinguish semantic versions ('1.2') from UUID version ids in your data model."],"tags":["pydantic","validation","watsonx","uuid","bad-request"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}