kestra-io/kestra · error · PebbleException
The 'render' function expects an argument 'toRender'.
Error message
The 'render' function expects an argument 'toRender'.
What it means
The render() function requires at least one named argument 'toRender'. When Pebble resolves the arguments map and the key 'toRender' is absent, the function throws immediately. This happens when the function is invoked with positional syntax, an empty call, or a misspelled argument name.
Source
Thrown at core/src/main/java/io/kestra/core/runners/pebble/functions/RenderFunction.java:58
"recursive", "true"
);
}
@Override
public Object execute(Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) {
int depth = context.getVariable(VariableRenderer.RENDER_DEPTH_VAR) instanceof Number n ? n.intValue() : 0;
int maxDepth = variableConfiguration.getMaxRenderDepth();
if (depth >= maxDepth) {
throw new PebbleException(
null,
"Maximum render() nesting depth (" + maxDepth + ") exceeded at line " + lineNumber +
" — check for circular render() calls in your template.",
lineNumber, self.getName()
);
}
if (!args.containsKey("toRender")) {
throw new PebbleException(null, "The 'render' function expects an argument 'toRender'.", lineNumber, self.getName());
}
Object toRender = args.get("toRender");
Object recursiveArg = args.get("recursive");
if (recursiveArg == null) {
recursiveArg = true;
}
if (!(recursiveArg instanceof Boolean recursive)) {
throw new PebbleException(null, "The 'render' function expects an optional argument 'recursive' with type boolean.", lineNumber, self.getName());
}
EvaluationContextImpl evaluationContext = (EvaluationContextImpl) context;
Map<String, Object> variables = evaluationContext.getScopeChain().getGlobalScopes().stream()
.flatMap(scope -> scope.getKeys().stream())
.distinct()
.collect(HashMap::new, (m, v) -> m.put(v, context.getVariable(v)), HashMap::putAll);
View on GitHub (pinned to 823fada927)
Solutions
- Always use the named argument: {{ render(toRender=inputs.myInput) }}.
- Verify the argument name is exactly 'toRender' (camelCase).
- If using the default argument values from getArgumentDefaults(), ensure the Pebble template passes through the argument explicitly.
Example fix
# before
{{ render(inputs.x) }}
# after
{{ render(toRender=inputs.x) }} Defensive patterns
Strategy: validation
Validate before calling
# Always include the 'toRender' named argument when calling render().
# Correct: {{ render(toRender=inputs.x) }}
# The argument name is case-sensitive: 'toRender' (camelCase). Prevention
- Always use named arguments: render(toRender=...).
- Double-check argument names against the function's getArgumentNames() documentation.
- Use the Kestra IDE/editor autocomplete to verify argument names.
When it happens
Trigger: Calling {{ render() }} with no arguments. Using positional arguments like {{ render(inputs.x) }} instead of named arguments like {{ render(toRender=inputs.x) }}. Misspelling the argument as torender, to_render, or value.
Common situations: Copy-pasting from documentation that used shorthand without explaining the named-argument requirement. Auto-completion inserting a wrong argument name. Refactoring an expression and accidentally dropping the argument.
Related errors
- The 'render' function expects an optional argument 'recursiv
- The 'secret' function expects an argument 'key'.
- The 'subflow' function expects the arguments 'namespace' and
- The 'encrypt' function expects two arguments 'key' and 'plai
- The 'env' function expects an argument 'name'.
AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14).
Data as JSON: /api/errors/78ec4b7672a308a3.
Report an issue: GitHub.