# Cannot create a Webhook triggered automation programatically

**URL:** <https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140>\
**Category:** Questions\
**Tags:** core\
**Created:** [April 7, 2025, 8:00pm UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140 "2025-04-07T20:00:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RayBBM](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/raybbm/32/50031_2.png) [@RayBBM](https://community.n8n.io/u/RayBBM)\
**Post date:** [April 7, 2025, 8:00pm UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/1 "2025-04-07T20:00:42Z")

</div>

## I can’t import via CLI or API a workflow that is triggered by a webhook

### TL;DR

I need to import a workflow that will be triggered only via a webhook.  
The webhook returns 404 until I update the workflow on n8n UI.  
Once I do that, it works properly.

But I need it to be programmatically.

Does anyone has a workaround about this ?

### Original version:

I have pulled a bunch of my hair on this one.

I am in the exact same situation as @dingo-dev [in his post](http://community.n8n.io/t/activate-workflow-cli-command-not-activating-web-hooks/40756) trying to build a CI/CD pipeline and automating workflow creation.

I need to run integration tests from Github Actions (hence the need for zero UI intervention) that would call an automation via webhook and assert the result, before committing the workflow to the GitHub repository.

I tried:

- Importing via CLI then activating via CLI
- Importing via CLI then activating via API
- Importing via CLI then activating I then deactivating then reactivating via API
- Importing via CLI then making a PUT on the workflow via API
- Importing via API , then activating via API

The webhook won’t work until I touch it via the UI

Does anybody know any workaround ?  
Even if it is triggering a workflow programmatically with another way than webhook

## Information on your n8n setup

- n8n version: 1.84.3,
- Database: PostgreSQL
- n8n EXECUTIONS\_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Ubuntu 22.04 or Mac OS 15.4

---

<div class="post-metadata">

**Author:** ![RayBBM](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/raybbm/32/50031_2.png) [@RayBBM](https://community.n8n.io/u/RayBBM)\
**Post date:** [April 7, 2025, 8:17pm UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/2 "2025-04-07T20:17:39Z")

</div>

I am exploring the execution via CLI using ` n8n execute --id <ID>` as described in [this part of the doocumentation](https://docs.n8n.io/hosting/cli-commands/?_gl=1*16fw99w*_gcl_aw*R0NMLjE3NDIyMTI4MzEuQ2owS0NRandrTi0tQmhEa0FSSXNBRF9tbklwcDFUWHdLV3U3MHJrN2RzbEU4bDVDT2FlS3Bab183dldmWWhaSHV2WDduRnJQb2poUWJpMGFBbE90RUFMd193Y0I.*_gcl_au*MTA5MDQxNzI0NC4xNzQyMjEyODMw*_ga*NDU1MjYxMjQ1LjE3NDM3NTg4ODE.*_ga_0SC4FF2FH9*MTc0NDA1MTQwNC43LjEuMTc0NDA1NjI0My4zNi4wLjA.#start-a-workflow) but the execution of the following workflow seems stuck at the `User settings loaded from: /home/node/.n8n/config`

Here is the workflow (although it is a simple just to test the execution):

---

<div class="post-metadata">

**Author:** ![barn4k](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/barn4k/32/8170_2.png) [@barn4k](https://community.n8n.io/u/barn4k)\
**Post date:** [April 7, 2025, 8:43pm UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/3 "2025-04-07T20:43:09Z")

</div>

hello @RayBBM

> [@RayBBM](#):
>
> The webhook won’t work until I touch it via the UI
> 
> Does anybody know any workaround ?

Make sure the id of the webhook is unique (fields `webhookId` and `path`).

And can you share the workflow which you are trying to run via automation?

---

<div class="post-metadata">

**Author:** ![RayBBM](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/raybbm/32/50031_2.png) [@RayBBM](https://community.n8n.io/u/RayBBM)\
**Post date:** [April 8, 2025, 8:00am UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/4 "2025-04-08T08:00:52Z")

</div>

Yes so far it is the only workflow with a webhook:

Here it is, it is only to make it work before move on

---

<div class="post-metadata">

**Author:** ![barn4k](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/barn4k/32/8170_2.png) [@barn4k](https://community.n8n.io/u/barn4k)\
**Post date:** [April 8, 2025, 10:00am UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/5 "2025-04-08T10:00:14Z")

</div>

I didn’t have any issues with programmatic webhook. Check that you have a proper `webhookId` field in the payload. I suppose it should be a valid GUID

---

<div class="post-metadata">

**Author:** ![RayBBM](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/raybbm/32/50031_2.png) [@RayBBM](https://community.n8n.io/u/RayBBM)\
**Post date:** [April 9, 2025, 11:52am UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/6 "2025-04-09T11:52:32Z")

</div>

Thank you,

it turns out that the webhookId was the missing part in the workflow I wanted to import:

```json
"name": "Webhook Workflow 1",
    "active": false,
    "nodes": [
      {
        "parameters": {
          "httpMethod": "POST",
          "path": "workflow",
          "responseMode": "lastNode",
          "responseData": "allEntries",
          "options": {}
        },
        "type": "n8n-nodes-base.webhook",
        "typeVersion": 1,
        "position": [
          250,
          300
        ],
        "id": "webhook-node",
        "webhookId": "56d7c763-8c1c-4037-bd3a-77abe8e930e2", // THIS WAS MISSING
        "name": "Webhook",
        "credentials": {
          "httpBasicAuth": {
            "user": "",
            "password": ""
          }
        }
      },
...
]
...}

```

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [April 16, 2025, 11:52am UTC](https://community.n8n.io/t/cannot-create-a-webhook-triggered-automation-programatically/98140/7 "2025-04-16T11:52:41Z")

</div>

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