{"record":{"id":"af84a9479b7d3c8b","repo":"langgenius/dify","slug":"webhook-trigger-not-found-for-this-node","errorCode":null,"errorMessage":"Webhook trigger not found for this node","messagePattern":"Webhook trigger not found for this node","errorType":"http","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"api/controllers/console/app/workflow_trigger.py","lineNumber":123,"sourceCode":"    @model_validate(Parser)\n    def get(self, req_data: Parser, app_model: App):\n        \"\"\"Get webhook trigger for a node\"\"\"\n\n        node_id = req_data.node_id\n\n        with sessionmaker(db.engine, expire_on_commit=False).begin() as session:\n            # Get webhook trigger for this app and node\n            webhook_trigger = session.scalar(\n                select(WorkflowWebhookTrigger)\n                .where(\n                    WorkflowWebhookTrigger.app_id == app_model.id,\n                    WorkflowWebhookTrigger.node_id == node_id,\n                )\n                .limit(1)\n            )\n\n            if not webhook_trigger:\n                raise NotFound(\"Webhook trigger not found for this node\")\n\n            return dump_response(WebhookTriggerResponse, webhook_trigger)\n\n\n@console_ns.route(\"/apps/<uuid:app_id>/triggers\")\nclass AppTriggersApi(Resource):\n    \"\"\"App Triggers list API\"\"\"\n\n    @setup_required\n    @login_required\n    @account_initialization_required\n    @console_ns.response(200, \"Success\", console_ns.models[WorkflowTriggerListResponse.__name__])\n    @with_current_tenant_id\n    @rbac_permission_required(RBACResourceScope.APP, RBACPermission.APP_VIEW_LAYOUT)\n    @get_app_model(mode=AppMode.WORKFLOW)\n    def get(self, current_tenant_id: str, app_model: App):\n        \"\"\"Get app triggers list\"\"\"\n        with sessionmaker(db.engine, expire_on_commit=False).begin() as session:","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/app/workflow_trigger.py#L105-L141","documentation":"Raised by GET /apps/{app_id}/workflows/webhook/trigger?node_id=... when no WorkflowWebhookTrigger row matches (app_id, node_id). The node either is not a webhook trigger node or has never had its trigger persisted. Returned via flask_restx NotFound (HTTP 404).","triggerScenarios":"GET /console/api/apps/{app_id}/workflows/webhook/trigger?node_id=<id> where node_id is not a webhook node, was deleted from the draft, or its trigger row was never created on save.","commonSituations":"Querying a webhook URL before saving the workflow draft; node_id from a copied graph that was never persisted; node was changed to a different type after the trigger was created; querying for a node in an app that is not in WORKFLOW mode.","solutions":["Open the workflow in studio, ensure the node is a Webhook trigger type, and save the draft to persist WorkflowWebhookTrigger.","Confirm node_id matches a current webhook node via the draft graph before requesting its trigger.","Verify the app mode is WORKFLOW (the route is gated by @get_app_model(mode=AppMode.WORKFLOW))."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const draft = await get(`/apps/${appId}/workflows/draft`);\nconst node = draft.graph.nodes.find(n => n.id === nodeId);\nif (!node || node.type !== 'webhook-trigger') { /* do not request webhook trigger */ }","typeGuard":null,"tryCatchPattern":"try {\n  await get(`/apps/${appId}/workflows/webhook/trigger`, { params: { node_id: nodeId } });\n} catch (e) {\n  if (e.code === 404 && /webhook trigger not found/i.test(e.message)) {\n    // prompt to save the draft with a webhook node present\n  } else { throw e; }\n}","preventionTips":["Persist the workflow draft (POST the graph) before querying a node's webhook trigger.","Only show 'copy webhook URL' for nodes whose type is a webhook trigger."],"tags":["api","not-found","workflow","webhook","trigger"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}