Hello,
i’m trying to call run workflow using restAPI
POST /rest/workflows/${workflowId}/run
and send the headers
{
‘Content-Type’: ‘application/json’,
Accept: ‘application/json’,
‘X-N8N-API-KEY’: ‘My_API_key’
}
but i’m getting 401 unauthorized request even i’m setting the docker env for n8n as below
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!
Where did you get the idea of n8n API with the usage you demostrated in the post? Here’s what is supported by n8n REST API, API reference | n8n Docs. Note also the endpoints start with /api/v1/.
Hey @MuhammadGouda , I don’t think the API supports running a workflow manually. You can only activate a workflow to run either on schedule or by the trigger.
Therefore, the only solution I can think of is to use Webhook as the trigger to your “manual” workflow. Then you can run your workflow by sending HTTP Request (by Postman) to the webhook URL.