Create workflow without webhook or manual trigger, and activate using n8n api

Can someone give me an example of this:

Create workflow without webhook or manual trigger, and activate using n8n api

Is it the case that all workflows should have a webhook trigger or manual trigger. I just want a simple workflow which I can trigger using an n8n api call with the workflow_id

Hey, the n8n API doesn’t have an Execute workflow method. Why do you want to avoid a webhook trigger? It’s essentially exactly what you need.

Alternatively, you can do a Scheduled trigger to run every 5 minutes. Then, you can use the n8n API to ACTIVATE (not run) the workflow. It will run once and then you will need to deactivate it before the next run in 5 minutes.

Let me know,

Ok, lets say I create a workflow with a webhook trigger. Even when I set the workflow as active, do I need to next:

a. First, execute the webhook from the UI??
b. Then call the webhook?

What a list of api for best automation of the workflow without manual intervention at all?

Hey, simply add the webhook trigger, activate the workflow then trigger the Production URL of the webhook like you would normally trigger an API call. Example in terminal with my webhook:

curl http://localhost:5678/webhook/2b8d0fe4-39d1-46fe-a0ee-9f44f30af51b

{"message":"Workflow was started"}

You can even configure the webhook to be a POST request so you can pass data in the Body of the request to use in the other nodes.

Feel free to mark as Solution if it helped :slight_smile:

1 Like

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