Skip to content

Migration

Workflow types evolve. Fields get added, renamed, removed; the data interface gains an output; the configuration shape changes shape. Existing workflows that were configured against the old workflow type version need a path forward — that path is migration.

Two adjacent surfaces, easy to confuse:

Block What it declares Lives on
migrationRoutes { } "Workflow type version A can be migrated to workflow type version B." Workflow type
migrationRuleSet { } The transformation: how an A-shape configuration becomes a B-shape configuration. Workflow type

A route says this migration exists. A rule set says this is how it works.

Routes

A migration route is a directed pair of workflow type versions. They're declared on the target version's workflow type:

workflowType {
    metadata {
        reference = "<your-namespace>:my-workflow:2.0.0"
        // …
    }

    migrationRoutes {
        from("<your-namespace>:my-workflow:1.0.0")
        from("<your-namespace>:my-workflow:1.5.0")
    }

    // …
}

This says: workflows currently at 1.0.0 or 1.5.0 can be migrated to 2.0.0. Multiple routes converge on a single new version.

The source versions named in migrationRoutes are resolved automatically — you do not also list them in dependencies { }. That block declares only the components the workflow nests at runtime. The registry records the sources as migration-source dependencies of the new version; they never count as runtime dependencies and do not keep the older version from being archived.

Patch upgrades are implicit

You never declare routes between patches of the same minor (for example 1.0.0 → 1.0.3). A patch bump keeps the configuration shape unchanged, so migrating between patches of one minor is always available and carries the configuration over as-is — no route and no rule set are needed. These implicit upgrades appear in the migration route listing alongside the declared routes. Only upgrades to a higher patch are offered; migrating to a lower patch of the same minor is not listed as a route.

The listing names snapshots and release candidates in full (for example 1.0.1-SNAPSHOT-2026-09-01-2 or 1.0.1-RC-1), and every version sharing one version number is connected to that number's current versions: the released one once the number is released, otherwise its latest release candidate and its newest snapshot. Such a hop carries the configuration over unchanged, exactly like a patch upgrade. The listing only contains versions you are allowed to use, so snapshots and release candidates need the TEST permission to show up.

Rule sets

The rule set is the actual transformation:

migrationRuleSet {
    // return a MigrationRuleSet that transforms 1.0.0-shape into 2.0.0-shape
}

Rules describe value-level transformations: copy this field, rename that field, derive a new field from existing ones, drop a deprecated field. The framework's migration types (in framework/values/migration/) are the building blocks.

If you have multiple routes converging, the rule set covers all of them — the framework selects the right rule based on the source version at run time.

When migration runs

Migration is a workflow operation, not a workflow type operation. A workflow's user (in SimScale Workbench, or via simkit workflow migrate) explicitly migrates their workflow from version A to version B. The framework looks up the route and applies the rule set; the resulting configuration is the new workflow version attached to workflow type B.

Migration never modifies the registered workflow types (those are immutable when released); it transforms a workflow's configuration data so it can target a new workflow type version.

Data migration

Data types evolve too, and every uploaded data item is pinned to the exact data type version it was uploaded with. Without migration, even a patch-level bump of a data type (a label correction, a translated description) would force users to upload the same file again to use it with workflows that reference the newer version.

Data migration moves a data item between versions of its data type, with the same mechanics as workflow migration: it is explicit and opt-in (simkit data migrate <data-id> <data-type-version>), and it never modifies anything in place — a new data item pinned to the target version is created, carrying everything over from the original, including the stored file content, which the two items share. The original item stays untouched on its old version.

Which steps need a rule follows the version-bump rule for data types (see Choosing the next version):

  • Within one major version — any patch or minor step — migration is implicit. A minor bump is by definition a non-breaking schema change, so the domain-specific metadata is carried over as-is and re-validated against the target version's metadata schema, with the target's defaults filling in new fields. No route, no rule. As for workflow types, the listing names snapshots and release candidates in full, offers a version number's current versions as targets (the released one once released, otherwise the latest release candidate and the newest snapshot), and only contains versions you are allowed to use.
  • Across major versions a route and a rule are required, and the registry enforces it: a new major version must declare a route covering the latest released version before it, both when it is registered and again when it is released. A route declared within one major is rejected.

Across major version bumps, data types declare migration routes and rule sets exactly like workflow types do — on the target version:

dataType {
    metadata {
        reference = "<your-namespace>:mesh:2.0.0"
        // …
    }

    metadataSchema {
        integer("numberOfCells")
    }

    migrationRoutes {
        from("1.1.0")
    }

    migrationRuleSet {
        MigrationRuleSet(
            listOf(
                migrationFrom1_1_0 {
                    newMetadata.numberOfCells = oldMetadata.cellCount
                },
            ),
        )
    }
}

A data type migration rule transforms only the domain-specific metadata — the migrationFrom<version> adapters are generated per declared route, exposing the source version's metadata value model as oldMetadata and this version's as newMetadata. The stored content is carried over unchanged, so until content migration exists it is the author's responsibility that data migrated across a route still fits the target version's data schema. A route's source version must be registered (released) before the target version declaring the route can be built and registered.

Workflow migration migrates the data it references

A new workflow type version may pin a newer version of an input's data type. Migrating a workflow version to it (simkit workflow version migrate) migrates the referenced input data along: for every input whose data is pinned to an older version of the data type the target pins, the data is migrated as described above and the new workflow version references the migrated item. Where no migration route exists, the workflow migration fails with the data migration's error.

What this is not

  • Transformation of data content. Data migration re-pins a data item to another data type version and carries the stored content over unchanged; it never converts the bytes themselves. A change to the actual content format is a new data type, not a new version.
  • Re-running an old workflow. Old workflows can keep running on their old workflow type version indefinitely. Migration is opt-in.
  • A snapshot fixup. Snapshots are mutable — you don't need migration to evolve a snapshot in place. Moving a workflow from one snapshot of a version to a newer one is a plain re-pin, not a transformation; rules and routes are for the released → released path.

Cross-references