Can't debug my execute workflow node

Hey everyone.

I’m trying to pass data from one workflow to another, in order to create an email sender workflow.

Since the “Execute workflow” node was only executing once and only passing one item, I decided to compact all of my items into one json. The json structure looks like this:

[
  {
    "result": [
      {
        "email": "[email protected]",
        "body": "My awesome body"
        "subject": "some subject etc"
      },
	        {
        "email": "[email protected]",
        "body": "My awesome body"
        "subject": "some subject etc"
      },
	        {
        "email": "[email protected]",
        "body": "My awesome body"
        "subject": "some subject etc"
      }

    ]
  }
]

This allows me to send multiple items in one go. The problem is, I don’t exactly know the structure of the “Start” node of the workflow being triggered, so I have no idea how to process the data further.

Obviously what I’m trying to achieve is to break that output back to 3 items again, so my “Send email” node in the target workflow, actually sends 3 emails.

FYI, I’ve already toyed with a function node in the target workflow that will translate the array to 3 items but when I hook up the start node, I get errors.

Any ideas on how to approach this?

Pepe

Hey @pepeday, I am not sure I fully understand this part:

The problem is, I don’t exactly know the structure of the “Start” node of the workflow being triggered, so I have no idea how to process the data further.

So you don’t know which data structure will be sent to the Start node of your sub-workflow? Or are you just unsure about the number of items inside your result array? If so, you could simply use the Item Lists node to split out the result field.

I am aware what the parent workflow Execute node input is (it’s the one I mentioned in the previous post).

My problem is that I don’t know how to process this output from the Start node of the child workflow. The reason is I can’t debug it since the child execution doesn’t show up in the executions list if it fails. My main problem is how to debug this, since i’ll be coding “blind” (i.e. wont be able to test the child flow and produce meaningful errors).

Ah, so if you simply want to mock data to work with in your child workflow you could add a Function node like this to your child workflow:

Simply execute it when you’re building your child workflow and disable it once done building your child workflow.

1 Like

I was kinda doing that but building it as a variable within a Function node but that wasn’t working. I used it directly as a return as you metnioned above and all is good. Thanks!

1 Like

Glad to hear this helps, thx for confirming!

1 Like