{"record":{"id":"ef612a19b7b3e88c","repo":"kestra-io/kestra","slug":"unknown-value-element-type","errorCode":null,"errorMessage":"Unknown value element type: {}","messagePattern":"Unknown value element type: (.+?)","errorType":"exception","errorClass":"IllegalVariableEvaluationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/FlowableUtils.java","lineNumber":482,"sourceCode":"                List<Pair<String, String>> resolvedValues = new ArrayList<>();\n                for (var entry : ((Map<String, Object>) mapValue).entrySet()) {\n                    resolvedValues.add(Pair.of(entry.getKey(), valueAsString(runContext, values, entry.getValue())));\n                }\n                return Either.right(resolvedValues);\n            }\n            default -> throw new IllegalVariableEvaluationException(\"Unknown value type: \" + values.getClass());\n        }\n    }\n\n    private static String valueAsString(RunContext runContext, Object values, Object value) throws IllegalVariableEvaluationException {\n        return switch (value) {\n            case String stringObj -> runContext.render(stringObj);\n            case Number number -> runContext.render(number.toString());\n            case Map<?, ?> mapObj -> serializeAsString(runContext.render((Map<String, Object>) mapObj)); //JSON or YAML map\n            case null -> throw new IllegalVariableEvaluationException(\n                \"Found a null value inside the iteration values=\" + serializeAsString(values)\n            );\n            default -> throw new IllegalVariableEvaluationException(\"Unknown value element type: \" + value.getClass());\n        };\n    }\n\n    private static String serializeAsString(Object obj) throws IllegalVariableEvaluationException {\n        try {\n            return MAPPER.writeValueAsString(obj);\n        } catch (JsonProcessingException e) {\n            throw new IllegalVariableEvaluationException(e);\n        }\n    }\n\n    /**\n     * Returns the index of the given {@code lastTerminated} task run within {@code currentTasks},\n     * matching by task ID (and optionally by parent/value via {@link #isTaskRunFor}).\n     * Using this index instead of the position in the raw task-run list avoids off-by-N skipping\n     * when a task produces multiple task runs (e.g. WaitFor creates one per iteration).\n     *\n     * @return the 0-based index, or {@code -1} if not found","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/FlowableUtils.java#L464-L500","documentation":"Thrown by the `valueAsString` helper when an individual iteration element is a Java type that is not String, Number, Map, or null — e.g. a `Boolean`, a nested `List`, a `java.net.URI`, or an arbitrary domain object. The placeholder is `value.getClass()`. The helper only knows how to render scalars and maps; nested collections and booleans are unsupported.","triggerScenarios":"An iteration `values` list/map whose elements are booleans, nested lists, URIs, or custom objects — e.g. `values: [true, false]` or a list containing sub-lists. Reached via both the List branch (line 456-461) and the JSON-object branch of `resolveValues`.","commonSituations":"Boolean flags in iteration data; arrays-of-arrays; plugin outputs that emit typed records rather than primitives; YAML literals that parse to booleans (`true`/`false`/`yes`/`no`).","solutions":["Flatten or stringify unsupported elements before iteration: render booleans/objects to strings (`{{ v | json }}`).","Restructure the data so each element is a String, Number, or Map.","If iterating nested collections, iterate one level deeper or use a map transform to serialize each element to JSON."],"exampleFix":"# before — booleans are unsupported element types\nvalues:\n  - true\n  - false\n\n# after — stringify\nvalues: \"[true, false]\"  # rendered as JSON array of... still fails; instead:\nvalues:\n  - \"true\"\n  - \"false\"","handlingStrategy":"validation","validationCode":"// Stringify non-scalar/non-map elements\nif (values instanceof List<?> list) {\n    values = list.stream().map(v ->\n        (v instanceof String || v instanceof Number || v instanceof Map<?,?>)\n            ? v : MAPPER.writeValueAsString(v)\n    ).toList();\n}","typeGuard":"static boolean isSupportedElement(Object v) {\n    return v instanceof String || v instanceof Number || v instanceof Map<?, ?>;\n}","tryCatchPattern":null,"preventionTips":["Avoid booleans and nested lists as direct iteration elements; serialize them to JSON strings first.","Be careful with YAML literals that parse `yes/no/true/false` to booleans — quote them.","Flatten arrays-of-arrays before iteration."],"tags":["iteration","type-mismatch","boolean","flowable"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}