langflow-ai/langflow · error · HTTPException

Created snapshot binding has non-UUID source_ref={source_ref

Error message

Created snapshot binding has non-UUID source_ref={source_ref!r} for tool_id={tool_id!r}.

What it means

Companion to the empty-binding check: when mapping adapter created snapshot bindings to WatsonxApiCreatedTool, the source_ref (flow_version_id) must be a UUID. Constructing WatsonxApiCreatedTool with a non-UUID source_ref fails pydantic validation, which the mapper converts to HTTP 500. The adapter returned a binding whose source reference is not a Langflow flow-version UUID.

Source

Thrown at src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/mapper.py:1807

        """Map adapter created snapshot bindings to API ``created_tools``."""
        created_tools: list[WatsonxApiCreatedTool] = []
        for binding in adapter_created_snapshot_bindings:
            tool_id = str(binding.tool_id or "").strip()
            source_ref = str(binding.source_ref or "").strip()
            if not tool_id or not source_ref:
                msg = (
                    f"Created snapshot binding has empty tool_id={binding.tool_id!r} or "
                    f"source_ref={binding.source_ref!r}; cannot map tool binding."
                )
                raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=msg)
            try:
                created_tool = WatsonxApiCreatedTool(
                    flow_version_id=source_ref,
                    tool_id=tool_id,
                )
            except ValidationError as exc:
                msg = f"Created snapshot binding has non-UUID source_ref={source_ref!r} for tool_id={tool_id!r}."
                raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=msg) from exc
            created_tools.append(created_tool)
        return created_tools

    def _dump_key_value_connection_payloads(self, key_value_payloads: list[Any] | None) -> list[dict[str, Any]] | None:
        if not key_value_payloads:
            return None
        normalized: list[dict[str, Any]] = []
        for payload in key_value_payloads:
            item: dict[str, Any] = {"app_id": payload.app_id}
            environment_variables = self._to_adapter_environment_variables(payload.credentials)
            if environment_variables is not None:
                item["environment_variables"] = environment_variables
            normalized.append(item)
        return normalized

    def _to_adapter_environment_variables(self, credentials: list[Any] | None) -> dict[str, dict[str, Any]] | None:
        if not credentials:
            return None

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Inspect the adapter response (server logs) for the created bindings and check what source_ref contains — it must equal the flow_version_id Langflow sent.
  2. Update or align the adapter so created bindings echo back the client flow_version_id unchanged.
  3. If wxO returns its own reference, add the id translation in the adapter before returning bindings to the mapper.
  4. Retry after fixing the adapter; the wxO-side snapshot may need manual cleanup if the tool was created.
Defensive patterns

Strategy: try-catch

Type guard

def has_uuid_source_ref(binding) -> bool:
    try:
        UUID(str(binding.source_ref))
        return True
    except (ValueError, AttributeError, TypeError):
        return False

Try / catch

try:
    created = await client.patch(f"/api/v1/deployments/{id}", json=body)
except HTTPError as e:
    if e.response.status_code == 500 and "non-UUID source_ref" in e.response.text:
        log.error("adapter source_ref drift; bindings must echo flow_version_id")
    raise

Prevention

When it happens

Trigger: Adapter returns a created-snapshot binding whose source_ref is e.g. a provider-internal id, a name, or a string in an unexpected format instead of the Langflow flow_version_id that was sent in the create request.

Common situations: Adapter version drift where source_ref semantics changed; a custom adapter implementation echoing provider ids instead of the client-supplied flow_version_id; log/mapping refactor in the adapter layer.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/5044cc60bee77410. Report an issue: GitHub.