I updated to version 1.80.5 and according to the recommendation in the logs I set N8N_RUNNERS_ENABLED=true.
After that the Handlebars templating engine enabled via NODE_FUNCTION_ALLOW_EXTERNAL=handlebars variable stopped working.
Having rolled back the settings, the templating worked again.
Stack trace:
EvalError: Code generation from strings disallowed for this context at JavaScriptCompiler.Function (<anonymous>) at JavaScriptCompiler.createFunctionContext (/usr/local/lib/node_modules/n8n/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23) at JavaScriptCompiler.compile (/usr/local/lib/node_modules/n8n/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:144:19) at compileInput (/usr/local/lib/node_modules/n8n/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:510:53) at ret (/usr/local/lib/node_modules/n8n/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:517:18) at VmCodeWrapper (evalmachine.<anonymous>:12:21) at evalmachine.<anonymous>:15:2 at Script.runInContext (node:vm:149:12) at runInContext (node:vm:301:6) at result (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/dist/js-task-runner/js-task-runner.js:162:63)
JS Function v1:
const Handlebars = require('handlebars');
let source = $node["FindTemplate"].json["json_message"];
let template = Handlebars.compile(source);
let template_values = $node["FindEvent"].json["data"];
template_values.updated_at = $node["Date_Time"].json["date_time"];
var result = {};
result["message"] = template(template_values);
return result;
Very handy templating that I wouldn’t want to change, but in future versions task runners will be the default.
I would like to know if there is any alternative or recommendation to replace Handlebars if it is not supported by task runners…
In fact, these are not backwards-compatible changes, which I didn’t see described in the release versions…
Information on your n8n setup
- n8n version: 1.80.5
- Database (default: SQLite): PostgreSQL
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system: Ubuntu 24.04