Im trying to update a workflow through the Patch Method on the workflow. Here I have an empty workflow & I want to add nodes and connections in the workflow. Once I make the request I dont get the nodes & connections in the response as well as they dont get added in the workflow. Here are some of the screen shots.
If we take for example the “nodes” property. If you do it as in your example above, directly setting the value to something like [{}], the data will look like this when it gets received by the server:
So it is a string. What we however need is a JavaScript Array.
To get that, we have to change the parameter to an expression and then set it to something like: {{ JSON.parse("[{}]") }}
The data received will then look like this:
That is now correct and should then work as expected. You have to do that for every parameter which is supposed to be a JavaScript-Array or Object.