Support for Short-Circuit Logic in Expressions (||)

The idea is:

Enable || (short-circuit logic) in expressions so that only the first valid, executed node is evaluated. Right now, using expressions like:

{{$node[“OpenAI”].json[“message”][“content”] || $node[“OpenAI1”].json[“message”][“content”]}}

fails when one of the referenced nodes wasn’t executed, even if the other one is perfectly valid.


My use case:

In conditional workflows, only one node is executed. We want the output node to reference whichever node ran, using fallback logic (||). This avoids duplicating downstream nodes like separate output responses.


I think it would be beneficial to add this because:

  • Simplifies complex branching flows
  • Prevents error-prone workarounds
  • Reduces node duplication
  • Aligns with standard JavaScript logic expectations
  • Boosts productivity for developers and non-developers alike

Any resources to support this?

No official docs needed—this aligns with how logical operators work in almost every language and template engine. It would be a natural enhancement to n8n’s expression engine.


Are you willing to work on this?

I’d love to support testing or feedback, but I’m not equipped to develop it directly.