kestra-io/kestra · error · PebbleException
The 'substringAfter' filter expects an argument 'separator'.
Error message
The 'substringAfter' filter expects an argument 'separator'.
What it means
The 'substringAfter' Pebble filter returns the portion of a string that comes AFTER the first occurrence of a separator (delegating to Apache Commons StringUtils.substringAfter). The filter registers 'separator' as a required named argument and throws when apply() is invoked with no 'separator' entry in args. This is a template-authoring error: the filter was applied without its argument.
Source
Thrown at core/src/main/java/io/kestra/core/runners/pebble/filters/SubstringAfterFilter.java:33
private final List<String> argumentNames = new ArrayList<>();
public SubstringAfterFilter() {
this.argumentNames.add("separator");
}
@Override
public List<String> getArgumentNames() {
return this.argumentNames;
}
@Override
public Object apply(Object input, Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) throws PebbleException {
if (input == null) {
return null;
}
if (!args.containsKey("separator")) {
throw new PebbleException(null, "The 'substringAfter' filter expects an argument 'separator'.", lineNumber, self.getName());
}
String separator = (String) args.get("separator");
;
return StringUtils.substringAfter(input.toString(), separator);
}
}
View on GitHub (pinned to 823fada927)
Solutions
- Add the separator argument: {{ myVar | substringAfter(separator="-") }}.
- If the separator comes from a variable, ensure that variable is defined and non-null before the filter runs (guard with a default: {{ myVar | substringAfter(separator=mySep ?? "-") }}).
- Confirm the filter name spelling matches the installed Kestra version; older/newer versions may differ.
Example fix
// before
{{ outputs.url | substringAfter }}
// after
{{ outputs.url | substringAfter(separator="/") }} Defensive patterns
Strategy: validation
Validate before calling
// Pebble: ensure separator is bound before applying
{{ myVar is empty ? '' : myVar | substringAfter(separator=(mySep ?? "-")) }} Prevention
- Always pass the separator as a named argument; never rely on it being optional.
- Use the Kestra expression editor to validate the filter before saving the flow.
- Keep a snippet library of correctly-formed filter calls.
When it happens
Trigger: Writing a Pebble expression as {{ myVar | substringAfter }} instead of {{ myVar | substringAfter(separator="-") }} (or the positional form {{ myVar | substringAfter("-") }}). Also occurs if the separator expression evaluates to an absent variable so Pebble never binds the named argument.
Common situations: Copying a filter name from docs but omitting the separator; passing a separator that resolves to null via an undefined output (e.g. separator=outputs.missing.value); refactoring a template and renaming the variable that feeds separator.
Related errors
- The 'substringAfterLast' filter expects an argument 'separat
- The 'substringBefore' filter expects an argument 'separator'
- The 'substringBeforeLast' filter expects an argument 'separa
- Unable to transform to ion value '{input}' with type '{input
- Unable to transform to json value '{input}' with type '{inpu
AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14).
Data as JSON: /api/errors/ebf9939693d07f0d.
Report an issue: GitHub.