windmill-labs/windmill · error

got value: {other} for field `type`, expected value: `static

Error message

got value: {other} for field `type`, expected value: `static` or `javascript`

What it means

Raised when converting an UntaggedInputTransform into an InputTransform: the `type` field held a value other than `static`, `javascript`, or `ai`. This TryFrom is strict, so any typo or new/unknown type fails instead of defaulting.

Source

Thrown at backend/windmill-types/src/flows.rs:812

impl InputTransform {
    pub fn new_static_value(value: Box<RawValue>) -> InputTransform {
        InputTransform::Static { value }
    }

    pub fn new_javascript_expr(expr: &str) -> InputTransform {
        InputTransform::Javascript { expr: expr.to_owned() }
    }
}

impl TryFrom<UntaggedInputTransform> for InputTransform {
    type Error = anyhow::Error;
    fn try_from(value: UntaggedInputTransform) -> Result<Self, Self::Error> {
        let input_transform = match value.type_.as_str() {
            "static" => InputTransform::new_static_value(value.value.unwrap_or_else(default_null)),
            "javascript" => InputTransform::new_javascript_expr(&value.expr.unwrap_or_default()),
            "ai" => InputTransform::Ai,
            other => {
                return Err(anyhow::anyhow!(
                    "got value: {other} for field `type`, expected value: `static` or `javascript`"
                ))
            }
        };

        Ok(input_transform)
    }
}

#[derive(Deserialize)]
#[serde(untagged)]
enum RawValueOrFormatted<T> {
    RawValue(T),
    Formatted { r#type: String, value: Option<T>, expr: Option<String> },
}

fn raw_value_to_input_transform<'de, D, T>(
    deserializer: D,

View on GitHub (pinned to e474e8803c)

Solutions

  1. Set the input transform `type` to one of `static`, `javascript`, or `ai`
  2. Fix casing/typos in the JSON (values are lowercase, exact)
  3. If importing from a newer version, upgrade windmill or strip unknown transform types
  4. If a `static`/`javascript` transform, also ensure `value`/`expr` fields are present

Example fix

// before
{"type": "static_value", "value": 42}
// after
{"type": "static", "value": 42}
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED = new Set(["static", "javascript", "ai"]);
function validateTransform(t) {
  if (!ALLOWED.has(t.type)) throw new Error(`bad transform type: ${t.type}`);
}
transforms.forEach(validateTransform);

Type guard

function isInputTransformType(v: string): v is "static" | "javascript" | "ai" {
  return v === "static" || v === "javascript" || v === "ai";
}

Try / catch

try {
  deployFlow(flow);
} catch (e) {
  if (String(e).includes("expected value: `static` or `javascript`")) {
    console.error("Fix input transform `type` field:", e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Deserializing input transforms (e.g. from a flow JSON or API payload) where input.type is misspelled or uses a type not handled by this conversion.

Common situations: Typo like `Static` or `statc` in hand-edited flow JSON; flows exported from a newer windmill with an added transform type being imported into an older one; programmatic generators emitting wrong type strings.

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 windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/daf2662abdf71a49. Report an issue: GitHub.