Cant Access Object Once Passed to Sub Workflow

I have read past forum responses about stringfying JSON so the interpreter in the run workflow block knows how to interpret the variables, but I am still getting either “undefined” or “object Object” when I try to retrieve my json object after it has been passed into the sub workflow.

I start with an object that looks like this:
{

“status”: “200”,

“data”: [

{“RecordID” : “….” , “JobId”: “…..”},{“RecordID” : “….” , “JobId”: “…..”}
]
}

I then pass it into the runworkflow block like this:

I have tried both {{json item}} and {{item}} with the same result.

Everytime I try to call JobId within the subworkflow the value of JobId within the subworkflow is:

[

0: “object Object”

]

The launch block is set up with:

Launch Variables:
chemStandards
JobId

I have tried both:

{{json JobId}} and {{JobId}}

With {{json JobId}} I still just get

[

0: “object Object”

]

Here is the remix link with example:

https://app.mindstudio.ai/agents/workflow-execution-error-example-b88ec0cd/remix

I think you’re passing a single JSON object. Try passing a JSON array; something like:

[
  0: object1
  1: object2
  2: object3
]

I am passing an array correctly to the workflow.

Both this, and the fact that the sub-workflow runs once for each array object, tell me I am passing the right multi-object array into the sub-workflow.

1 Like

It looks like I was putting {{json ….}} in the wrong place. Instead of on the {{item}} block I needed to put it on the variable input like below: