Execute a Workflow through API

Hi,

I want a particular workflow to be test executed from my mobile application. I went through the Editor UI code and found this method to execute a workflow, but not able to understand the parameters to pass.

// Execute a workflow
				runWorkflow: async (startRunData: IStartRunData): Promise<IExecutionPushResponse> => {
					return self.restApi().makeRestApiRequest('POST', `/workflows/run`, startRunData);
				},

I tried with the following parameter and got this error message.

{"workflowData": {"id":"3"}}
{"code":0,"message":"nodes is not iterable"}

Thanks

This endpoint expects the whole workflow. So including all nodes and connections. There is no endpoint which allows to execute an existing workflow by ID. Was never needed in n8n. If people want to execute a specific workflow they normally use webhooks.

1 Like