Create workflow works differently from UI and API

in n8n UI - when I import a workflow which starts with something like the JSON below (partial sample), it just imports fine. But when I use the same JSON via the api to call the workflow creation api/v1/workflows and passing as POST message. I get error stating the additional fields are provided
{{"createdAt":"2025-08-15T13:45:11.896Z","updatedAt":"2025-08-15T14:43:52.484Z","id":"11u82un7GJy3Msmk","name":"Mult-Agents with tool","active":false,"isArchived":false,"nodes":[{"parameters":{"options":{}},"type":"@n8n/n8n-nodes-langchain.chatTrigger","typeVersion":1.3,"position":[-864,-112],"id":"e2d293b4-6cb1-426d-b14a-1edd18289548","name":"When chat message received","webhookId":"32a7b5
I had to remove the following sections, to make it work. This is strange, it should work the same manner

Active:false
createdAt
id
isArchived
meta
shared
staticData
tags
triggerCount
updatedAt
versionId

yes, as I indicated in above post, there is a list of fields that needs to be removed in the JSON to make the API work. As it was downloaded from the UI, I had not removed it earlier. However, this should not be the case, the API should work just like UI otherwise, unsuspecting API users will have difficult time to pass the correct JSON. For the testing, it would be natural to assume that people would use the existing workflow and download it via UI. And then use this via API.
in the API docs, I am not sure whether the provided example JSON for the API call is complete and can be used for semantic verification? If that is the case, I would assume, this could be listed out clearly to save some dev time

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