Parallel execution with error handling and aggregated result email in n8n

Parallel execution with error handling and aggregated result email in n8n

Background: I am trying to run log rotation tasks on multiple remote servers via SSH, collects statistics from each server (disk space before/after, space saved, duration, status), and sends a single aggregated HTML email report at the end.

Current setup: I am using a Split in Batches node (batch size 1) to loop over a list of remote servers, executing SSH commands sequentially for each server. After all servers complete, I aggregate the results and send an HTML email.

Problem 1 — Sequential execution instead of concurrent: The Split in Batches node processes agents one at a time sequentially. Ideally, I would like n8n to process each agent concurrently rather than waiting for one to finish before starting the next. Is there a recommended way to achieve true parallel/concurrent execution in n8n for this use case?

Problem 2 — Single servers failure stops entire workflow: Currently if any SSH node inside the loop fails (after retries are exhausted), the entire workflow stops. This means if server 1 fails, server 2 never runs at all. Ideally, even if one server’s stage fails, the other servers continue running independently and all results are still collected for the final report. I need a way to allow each server’s execution to fail independently without stopping other servers.

Problem 3 — Single aggregated HTML email at the end: After all servers complete (success or fail), I need to send a single HTML email containing a summary table with one row per server showing hostname, IP, log path, status, disk space before, disk space after, space saved percentage, error message, and Dynatrace ingestion status. The email should always send regardless of individual server outcomes. Currently the only way I can think to handle failures is using an Error Workflow, but that sends a separate failure email and stops remaining servers from running.

Question: What is the recommended pattern in n8n to achieve concurrent execution of independent server chains, where each chain can fail independently, and all results are aggregated into a single report at the end?

Any guidance or example workflow structure would be greatly appreciated. Thank you.

Hi, thanks for the guidance. I use the split in batches with batch size = 2 (since there are 2 servers) and have consolidated all SSH execution into a single “Run Agent” Code node. After this node, each agent item goes through one of 3 possible paths based on if-else criteria:

  1. Status failed → directly to Merge

  2. Status success + monitoring enabled → Ingest to Dynatrace → Set Ingestion Status → Merge

  3. Status success + monitoring disabled → Set Ingestion Disabled → Merge

I have 2 servers, so there will always be exactly 2 items total. My Merge node has 3 inputs connected (one from each path), but since I only have 2 items, only 2 of the 3 inputs will ever receive data in any single execution — and in some cases both items may arrive on the same input (e.g. both agents fail, both arrive on input 1).

My question is: is connecting 3 inputs to the Merge node the correct approach here, given that only 2 actual items will ever arrive and they may both come from the same input? Or will the Merge node hang waiting for data on the inputs that never fire? I have tried using this approach, apparently it is working fine, but just to confirm it.

Thanks

Merge node in Append mode is fine. It doesn’t rely on execution of all inputs