VMware Cloud Community
jonoped
Contributor
Contributor

How do you get the payload output and make it input for another workflow

I have a situation, where a VM is being built via vRA and getting a IP from infoblox,

On vRO I have a workflow that need to SSH to the machine that was just built and one of the parameters it needs is the IP of the server to ssh to it..

I have a payload scriptable task that receives the payload and gives me the IP,  I also have the workflow that can run and install what it needs to via the ssh install  if I give it a IP.

What I need is for the  payload to get the IP and then pass that IP to the SSH installer...

I have googled a heap, and tried various ways, that I have thought of but none of them seem to work..

Currently I have the EBS setup to run this workflow, and it seemingly fails to get the payload.  This happens when I add the ssh installer workflow into this workflow the input parameter is set to use the attribute that the output of the payload goes too.

pastedImage_0.png

If I remove the ssh installer and let it run it will complete with the payload result.

pastedImage_1.png

As soon as I add the installer back, it fails again.

Has anyone done this?

Thanks Jono

Reply
0 Kudos
5 Replies
iiliev
VMware Employee
VMware Employee

Hi Jono,

Such types of errors are hard to analyze without having details, like parameters/attributes' bindings, etc. So, if possible, could you attach a vRO package containing both the failing and the working workflows (and the items they are using)?

From the provided error, it is clear that it fails due to scripting code trying to call an expression like payload.get(somekey) when the object on the left side is null, but it is not clear how the addition/removal of ssh installer workflow changes the situation.

Reply
0 Kudos
jonoped
Contributor
Contributor

iiliev​  - Firstly thanks for looking into this, I appreciate it..

Unfortunately I can not add the package due to rules around the information we have for the client...

But please find attached a bit of a run down with what I can share... hopefully its enough.

Thanks again,

Jono

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

The problem doesn't seem to be related to hostNameOrIP parameter. The screenshot in your first post shows that the workflow has been invoked with payload parameter having a null value, which causes the first line of your scriptable task to fail:

var machine=payload.get("machine"); // this will fail if 'payload' is null

So it seems that the problem is how the workflow is being called - in one case the payload input has some valid value, and in the other case it is null. To verify this, you can add an extra System.log() statements to the scriptable task to dump the value/content of payload input.

Reply
0 Kudos
jonoped
Contributor
Contributor

Yes it does look to be that payload part being "null"

Im not the best with JavaScript so I hope im reading what you said right and I added this line to the scripting section..

System.log(payload)

on a successful run (with no ssh installer) it gave me a HashMap and the IP...

[2018-11-19 23:35:47.555] [I] HashMap:2080696877

[2018-11-19 23:35:47.557] [I] ##.###.##.## ( i have to hash the IP)

one with the ssh installer I can not see the HashMap... I have modified the client specific stuff and attached the errorlog..

Thanks

Reply
0 Kudos
jonoped
Contributor
Contributor

This has been resolved.

The payload was coming through as null. SO it was actually a blueprint issue and not a vRO / config / attribute problem.

Reply
0 Kudos