invoke-ai/InvokeAI · error

Invalid workflow meta version: {version}

Error message

Invalid workflow meta version: {version}

What it means

WorkflowMeta requires a 'version' field that parses as a valid semver string (semver.Version.parse). The pydantic field_validator raises ValueError when the supplied version string is not valid semantic versioning, e.g. '1.0', 'v1.0.0', or 'abc'.

Source

Thrown at invokeai/app/services/workflow_records/workflow_records_common.py:51

    IsPublic = "is_public"


class WorkflowCategory(str, Enum, metaclass=MetaEnum):
    User = "user"
    Default = "default"


class WorkflowMeta(BaseModel):
    version: str = Field(description="The version of the workflow schema.")
    category: WorkflowCategory = Field(description="The category of the workflow (user or default).")

    @field_validator("version")
    def validate_version(cls, version: str):
        try:
            semver.Version.parse(version)
            return version
        except Exception:
            raise ValueError(f"Invalid workflow meta version: {version}")

    def to_semver(self) -> semver.Version:
        return semver.Version.parse(self.version)


class WorkflowWithoutID(BaseModel):
    name: str = Field(description="The name of the workflow.")
    author: str = Field(description="The author of the workflow.")
    description: str = Field(description="The description of the workflow.")
    version: str = Field(description="The version of the workflow.")
    contact: str = Field(description="The contact of the workflow.")
    tags: str = Field(description="The tags of the workflow.")
    notes: str = Field(description="The notes of the workflow.")
    exposedFields: list[ExposedField] = Field(description="The exposed fields of the workflow.")
    meta: WorkflowMeta = Field(description="The meta of the workflow.")
    # TODO(psyche): nodes, edges and form are very loosely typed - they are strictly modeled and checked on the frontend.
    nodes: list[dict[str, JsonValue]] = Field(description="The nodes of the workflow.")
    edges: list[dict[str, JsonValue]] = Field(description="The edges of the workflow.")

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Change meta.version to a valid semver string like '1.0.0'
  2. Use to_semver-compatible formatting: MAJOR.MINOR.PATCH with optional -prerelease
  3. If importing many workflows, run a bulk fixer that rewrites invalid versions to '1.0.0'

Example fix

// before
{"meta": {"version": "1.0"}}
// after
{"meta": {"version": "1.0.0"}}
Defensive patterns

Strategy: validation

Validate before calling

import semver
def valid_workflow_version(v: str) -> bool:
    try:
        semver.Version.parse(v)
        return True
    except Exception:
        return False

Type guard

def is_semver_string(v: object) -> bool:
    return isinstance(v, str) and valid_workflow_version(v)

Try / catch

try:
    wf = WorkflowWithoutID.model_validate(data)
except ValueError as e:
    if str(e).startswith("Invalid workflow meta version"):
        data["meta"]["version"] = "1.0.0"
        wf = WorkflowWithoutID.model_validate(data)
    else:
        raise

Prevention

When it happens

Trigger: Creating or importing a workflow whose meta.version is missing/None, uses a 'v' prefix, has fewer than 3 components, or contains non-numeric prerelease parts.

Common situations: Hand-authored workflow JSON files, exports from other tools or older InvokeAI versions with non-semver version fields, templates copied with placeholder versions.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/6469410624c08656. Report an issue: GitHub.