Workflow returning inconsistent JSON response

I have a work flow that takes as input some JSON, adds a property to it, and then returns. Its just 1 'code' block between a Webhook starttrigger and a Web Response.

Example input (startTrigger):

{
  "Test" : "Hello",  
}

Code :

startTrigger.data.FooBar = "123"
return startTrigger.data

Response :

{
  "data": {
    "status": 200,
    "body": {
      "Test": "Hello",
      "FooBar": "123"
    }
  },
  "metadata": null
}

Problem is when I call this using an APP. I have a Resource Query using RESTQuery. The JSON response has the added property OUTSIDE of the other json, like this :

{
  "data": {
    "Test": "Zebra"
  },
  "FooBar": "123"
}

Any idea on why the inconsistency between when I run with the app vs running the workflow?

Hey @bwdahlquist!

startTrigger.data should contain the full JSON body you're passing, you don't need to specify another data property on it. With how you're currently triggering the workflow startTrigger will looks something like:

{
  data: {
    data: {
      Test: "Zebra",
    }
  }
}

So when you append FooBar to startTrigger.data you get:

{
  data: {
    data: {
      Test: "Zebra",
    },
    FooBar: "123"
  }
}