{"record":{"id":"1806add6106bd533","repo":"windmill-labs/windmill","slug":"result-returned-by-input-transform-invalid-e","errorCode":null,"errorMessage":"Result returned by input transform invalid `{e:#}`","messagePattern":"Result returned by input transform invalid `(.+?)`","errorType":"exception","errorClass":"Error::ExecutionErr","httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/worker_flow.rs","lineNumber":3495,"sourceCode":"                                     Some(arc_flow_job_args.clone()),\n                                     flow_env,\n                                     None,\n                                     None,\n                                     None\n                                 )\n                                 .warn_after_seconds(3)\n                                 .await\n                                 .map_err(|e| {\n                                     Error::ExecutionErr(format!(\n                                         \"Error during isolated evaluation of expression `{expr}`:\\n{e:#}\"\n                                     ))\n                                 })?\n                                 .get(),\n                             );\n                            if eval_result.is_ok() {\n                                user_groups_required = eval_result.ok().unwrap_or(Vec::new())\n                            } else {\n                                let e = eval_result.err().unwrap();\n                                return Err(Error::ExecutionErr(format!(\n                                    \"Result returned by input transform invalid `{e:#}`\"\n                                )));\n                            }\n                        }\n                        InputTransform::Ai => {\n                            user_groups_required = Vec::new();\n                        }\n                    }\n                } else {\n                    user_groups_required = Vec::new();\n                };\n\n                let approval_conditions = ApprovalConditions {\n                    user_auth_required,\n                    user_groups_required,\n                    self_approval_disabled,\n                };","sourceCodeStart":3477,"sourceCodeEnd":3513,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/worker_flow.rs#L3477-L3513","documentation":"For a suspend step with user_groups_required given as a JavaScript (or other evaluable) input transform, the worker evaluates the expression and expects a Vec<String> of group names. If evaluation fails, the flow job is aborted with \"Result returned by input transform invalid\".","triggerScenarios":"A suspend step's user_groups_required uses InputTransform::Javascript whose expression throws or returns a non-string-array value at flow runtime.","commonSituations":"JS expression referencing 'result'/'previous_result' fields that don't exist or aren't arrays; typo in property names; returning a single string instead of an array; flow preceding step output shape changed after a refactor.","solutions":["Fix the JS transform so it returns an array of strings, e.g. [\"admins\"] or flow_input.x.groups","Ensure 'result'/'previous_result' actually contain the expected data (log via a debug step)","If the groups are fixed, use a Static transform with a proper JSON array instead"],"exampleFix":"// before\nexpr: \"result.group\"            // result.group may be a string\n// after\nexpr: \"Array.isArray(result.group) ? result.group : [result.group]\"","handlingStrategy":"try-catch","validationCode":"// In the JS transform, guard the value:\nconst groups = result?.groups;\nif (!Array.isArray(groups) || !groups.every(g => typeof g === 'string')) {\n  throw new Error('groups must be a string array, got: ' + JSON.stringify(groups));\n}\nreturn groups;","typeGuard":null,"tryCatchPattern":"let groups: Vec<String>;\nmatch eval_result {\n    Ok(g) => groups = g,\n    Err(e) => return Err(Error::ExecutionErr(format!(\"Invalid user_groups_required: {e:#}\"))),\n}","preventionTips":["Test JS input transforms against real preceding-step outputs before shipping the flow","Return arrays of strings explicitly; never a bare string","Add a debug/sleep step that logs the value feeding the transform"],"tags":["javascript","flow","input-transform","suspend"],"backgroundTag":"input-transform-eval-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}