Error 400 when creating workflow via API

Hey guys, I’m trying to create a workflow via n8n, but it returns a 400 error

This one took a bit of experimenting, @htnrodrigues - but if you change from "nodes": [{{ JSON.stringify($json["nodes"]) }}] to "nodes": {{ JSON.stringify($json["nodes"]) }} this should fix this up for you!

Also returned error 400
I tried it on other installations and got the same error

Hey @htnrodrigues,

It could be worth double checking the settings as well, We don’t support updating all of the values so it could be that you need to remove some.

Hi @Jon,

I think it’s not my N8N’s installation settings, I used the JSON example from the API and it worked, I thought that to duplicate a workflow I just had to GET the workflow to copy the JSON and create a new one

Hey @htnrodrigues,

It isn’t n8n install settings it is n8n workflow settings, We only support a few of them from the API. If you can share the output json of the Set node I can take a look and let you know what the issue likely is, For me the workflows I have that I tested with all worked once I removed the extra []

Thanks @Jon, Sorry for anything

Hey @htnrodrigues,

Can you try removing callerPolicy from the setting, Looks like that isn’t one on the API list at the moment.

Hey @Jon

It worked really well, I’ll leave the workflow here in case anyone needs it. Thanks!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.