{"record":{"id":"e1a555c791b6cf07","repo":"vitessio/vitess","slug":"unknown-workflow-type-d","errorCode":null,"errorMessage":"unknown workflow type %d","messagePattern":"unknown workflow type (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/workflow.go","lineNumber":255,"sourceCode":"\t}\n\tif vrw.CachedState() != WorkflowStateNotCreated {\n\t\treturn fmt.Errorf(\"workflow has already been created, state is %s\", vrw.CachedState())\n\t}\n\tswitch vrw.workflowType {\n\tcase MoveTablesWorkflow, MigrateWorkflow:\n\t\terr = vrw.initMoveTables()\n\tcase ReshardWorkflow:\n\t\texcludeTables := strings.Split(vrw.params.ExcludeTables, \",\")\n\t\tkeyspace := vrw.params.SourceKeyspace\n\n\t\tvschmErr := vrw.wr.ValidateVSchema(ctx, keyspace, vrw.params.SourceShards, excludeTables, true /*includeViews*/)\n\t\tif vschmErr != nil {\n\t\t\treturn fmt.Errorf(\"Create ReshardWorkflow failed: %v\", vschmErr)\n\t\t}\n\n\t\terr = vrw.initReshard()\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown workflow type %d\", vrw.workflowType)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// WorkflowError has per stream errors if present in a workflow\ntype WorkflowError struct {\n\tTablet      string\n\tID          int32\n\tDescription string\n}\n\n// NewWorkflowError returns a new WorkflowError object\nfunc NewWorkflowError(tablet string, id int32, description string) *WorkflowError {\n\twfErr := &WorkflowError{\n\t\tTablet:      tablet,","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/workflow.go#L237-L273","documentation":"VReplicationWorkflow.Create only knows how to initialize MoveTables, Migrate, and Reshard workflow types. A VReplicationWorkflow constructed with any other workflowType falls through to the default case and is rejected.","triggerScenarios":"Calling Create() on a VReplicationWorkflow whose workflowType is not one of MoveTablesWorkflow, MigrateWorkflow, or ReshardWorkflow (e.g. a type that must be created through a different API).","commonSituations":"Constructing the generic VReplicationWorkflow wrapper for a workflow type (like LookupVindex or materialization flows) that has its own dedicated creation path.","solutions":["Use the correct workflow type constant (MoveTablesWorkflow, MigrateWorkflow, ReshardWorkflow) when constructing the VReplicationWorkflow","Use the type-specific API for other workflow kinds instead of the generic Create","Check the numeric type printed in the error against the wrangler's workflow type constants"],"exampleFix":"// before\nwf := wr.NewVReplicationWorkflow(ctx, ..., wrangler.MaterializationWorkflow, params)\nwf.Create(ctx)\n// after (materialize has its own path)\nwr.Materialize(ctx, ...)\n\nwf := wr.NewVReplicationWorkflow(ctx, ..., wrangler.MoveTablesWorkflow, params)\nwf.Create(ctx)","handlingStrategy":"validation","validationCode":"switch wfType {\ncase wrangler.MoveTablesWorkflow, wrangler.MigrateWorkflow, wrangler.ReshardWorkflow:\n    // supported\ndefault:\n    return fmt.Errorf(\"workflow type %d has no generic Create path\", wfType)\n}","typeGuard":"func creatableViaGenericCreate(t int) bool {\n    switch t {\n    case int(wrangler.MoveTablesWorkflow), int(wrangler.MigrateWorkflow), int(wrangler.ReshardWorkflow):\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Only construct generic VReplicationWorkflow with supported type constants","Use type-specific APIs for other workflow kinds","Never pass raw numeric workflow types; use named constants"],"tags":["vreplication","workflow","invalid-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}