API to make flows in n8n

Hi, I want to create flows via api. is this possible?

so in the UI I would hit Create workflow, then save it as a “flowName” then get the url for that workflow back.

Id like to import a flow and then get the url from it…

We do not have an official API to do that. You can however use the internal one the editor-UI uses:

Locally that would be a POST request to http://locahost:5678/rest/workflows
It then returns the saved workflow with its ID.

You can simply look in the browser what requests gets made and how they look like when a workflow gets created.

But again, it is not an official API. Meaning it can change and so break for you any time.

Hi @jan, i also am interested in knowing more about this.

My use-case: i would like to make a direct API call from my UI to create/deploy a workflow with its new/existing set of credentials.

Kindly guide regarding the procedures to implement this.


I actually thought I already did above. All available endpoints can be found in the Server.ts file I linked above. No matter what you want to do, you can find out what endpoint to call and what data to send by executing that action in the browser via the Editor-UI. There you can see the endpoint that gets called and what data gets passed.

As the API is not officially supported and changes to that API may be made at any time (without any announcement, as it is only an internal API) will sadly no documentation for that be created.

Thanks for your response.

Is it on the roadmap for the API to be officially supported, at some point in the future? If yes, any idea around when?

A proper API based model would really allow to build SaaS products that utilise n8n in their core.

Yes, it is on the roadmap but is not scheduled yet. Sadly simply way too many things too improve and features to create for our small team right now. Sorry.