-
|
I have a template with 11 transforms of which, at present has 7 transform that are basically the same except that the output is different for each of them. The questions I have are:
Thank you for your help |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 5 replies
-
|
Hello again.
If you want to write a Code transform that takes parameters, configure it like this:
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you for responding to my questions |
Beta Was this translation helpful? Give feedback.
-
|
I have a template that has 14 pages 11 of which are the same each of those 11 pages hits one of the transforms 44 times. With 7 pages it runs fine but with all 11 pages i get Multi Error and in the log I get Out of Memory (see details below. What should the n8n Server be set too especially if we are going to process templates using N8N? Is there a better, more efficient way, to process a data table (11 rows [max], and 7 columns). Repeated over 11 pages? I have also enclosed the code used in the transformer that gets hit const docname = query.input?.trim();
const outType = query.args[0];
if (!docname) return "";
const variants = {
type: "PCS",
weight: "N/A",
words: "CARGO IS: PAPER-VESSEL, WORDS"
};
return variants[outType] || "";DetailsJul 07 22:37:10 2025-07-07T10:37:10Z Jul 07 22:37:10 <--- Last few GCs ---> Jul 07 22:37:10 2025-07-07T10:37:10Z Jul 07 22:37:10 [1:0x2409b000] 1188984 ms: Mark-Compact 245.2 (258.6) -> 244.3 (258.6) MB, pooled: 1 MB, 157.54 / 0.01 ms (average mu = 0.885, current mu = 0.109) allocation failure; scavenge might not succeed Jul 07 22:37:10 [1:0x2409b000] 1189246 ms: Mark-Compact 245.5 (258.8) -> 244.8 (259.1) MB, pooled: 0 MB, 237.40 / 0.01 ms (average mu = 0.766, current mu = 0.095) allocation failure; GC in old space requested Jul 07 22:37:10 2025-07-07T10:37:10Z Jul 07 22:37:10 2025-07-07T10:37:10Z Jul 07 22:37:10 <--- JS stacktrace ---> Jul 07 22:37:10 2025-07-07T10:37:10Z Jul 07 22:37:10 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory Jul 07 22:37:10 ----- Native stack trace ----- Jul 07 22:37:10 2025-07-07T10:37:10Z Jul 07 22:37:10 1: 0xe13fde node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node] Jul 07 22:37:10 2: 0x11d5070 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node] Jul 07 22:37:10 3: 0x11d5347 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node] Jul 07 22:37:10 4: 0x1402c05 [node] Thank you |
Beta Was this translation helpful? Give feedback.
-
|
The transformer code looks fine to me, it doesn't look like it accidentally eats too much memory. For those "JavaScript heap out of memory" errors, N8N recommends increasing old memory, which can be done by setting the Are you running N8N on a personal computer or on a server? If on a computer, you could also check that it's indeed consuming memory using the OS's task manager (Task Manager on Windows, the System Monitor on Ubuntu, I don't know how it's called on MacOS). See if you can spot a large increase in memory usage over time as the workflow runs. |
Beta Was this translation helpful? Give feedback.
-
|
No it is being run on a server. Would using {{rows}} {{/rows}} be a more efficient way, to process a data table (11 rows [max], and 7 columns on each of the 11 pages? Like {{rows}} {{att1}} {{att2}} {{att3}} {{att4}} {{att5}} {{att6}} {{att7}} {{/rows}} on one line with the appropriate data structure to populate the lines Regards, |
Beta Was this translation helpful? Give feedback.
-
|
Each row has the following data Coll1 Coll 2 Coll 3 Coll 4 Coll 5 Coll 6 Coll 7 The above is repeated for each row and only the number at the end of Qty and DocName changes for each row. The whole process is repeated for each of the 11 pages. |
Beta Was this translation helpful? Give feedback.
-
|
Regarding your question Do you use n8n start or npx n8n or something along those lines, or Docker/Docker Compose? Have you tried to set the --max-old-space-size config TBH I have no idea as I am not the administrator. The info I do have is App Title and Version n8n 1.97.1 I found this in the log |
Beta Was this translation helpful? Give feedback.
-
|
A question on tables in Word It runs nicely and add the desired row. However It adds the rows not overwriting the existing row. Is there an option to stop it adding or do I need to create empty data elements? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the answers to my question. I have initially bumped the ram up to 1.25GiB and process runs like a dream. Also what I have found is that using the {row} {/row} processes faster than having replacements and as a bonus the template looks cleaner. |
Beta Was this translation helpful? Give feedback.
-
|
This is the completed flow |
Beta Was this translation helpful? Give feedback.
-
|
Are you able to tell me how DocxTemplater handles inline Carriage Returns in a specific field? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the info. I managed to get it to function by adding \n were the soft return is supposed to be in the code node. Now I need to replace that node by generating it from our WordPress host and hopefully that will function. It functioned when we used mailmerge so it should in here. |
Beta Was this translation helpful? Give feedback.
-
|
Another question: I am attempting to place a bulleted list in the document and I am using
It produces What I like to see is this
/ const bulletItems = [];
let counter = 2;
if (json.EDP) {
bulletItems.push({ name: "Ecclesiastical Deed Poll" });
bulletItems.push({ name: "Addendum to Ecclesiastical Deed Poll" });
}
if (json.MONCWrits) {
bulletItems.push({ name: "Mandate of Non-Consent" });
bulletItems.push({ name: "Writ of Habeas Corpus" });
bulletItems.push({ name: "Writ of Prohibito" });
}
if (json.CourtesyAdvice) {
bulletItems.push({ name: "courtesy advisory" });
}
json.AppendBulletItems = bulletItems;Where am I going wrong? Regards, |
Beta Was this translation helpful? Give feedback.
-
|
@jreyesr thank yo so much for your help and assistance. I /we really appreciate it |
Beta Was this translation helpful? Give feedback.








Hello again.
| sumbytransform takes a string parameter:If you want to write a Code transform that takes parameters, configure it like this:
Enable the Specify Input Schema switch, choose