Function not working when connected to If node true port

I’m working on a workflow to split out messages into structured data. Since not all email messages have attachments, I want to create an empty set, as follows:

As long as the Function node has no input, the json code gets generated, but as soon as I connect it to the true port of the If statement, I get ‘No data … Data returned by this node will display here’

Any ideas what I might be doing wrong here?

I’ve been playing around some more, but I can’t seem to get the If function to work. It just stops, even if the condition is true …

This is a sample text of a MIME message without attachments that I’m feeding into this workflow:

From: Dick <[email protected]>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Testbericht voor n8n IMAP Email test
X-Universally-Unique-Identifier: 908A1AFB-ADD4-479B-93D2-23B4256A0C1D
Message-Id: <[email protected]>
Date: Wed, 16 Feb 2022 15:35:52 +0100
To: ecOrganizer BV <[email protected]>

test

groetjes - Dick Honing

http://www.ecorganizer.nl - ecOrganizer CRM & ERP Software


Please note: this workflow uses simpleMailer, so you’ll need to ad the following to your environments file in order to make this work:

NODE_FUNCTION_ALLOW_EXTERNAL=mailparser

After some further study of the IF function in an isolated workflow, I finally got this to work :grinning:

1 Like