{"record":{"id":"b694441e0549240c","repo":"Significant-Gravitas/AutoGPT","slug":"graph-graph-id-does-not-have-a-webhook-trigger","errorCode":null,"errorMessage":"Graph #{graph_id} does not have a webhook trigger node","messagePattern":"Graph #(.+?) does not have a webhook trigger node","errorType":"exception","errorClass":"InvalidInputError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/triggers.py","lineNumber":60,"sourceCode":"    Sets up the webhook for the graph's trigger node — auto-registering it with\n    the provider for auto-setup webhooks, or just minting the ingress URL for\n    manual-setup webhooks — then creates a preset linked to that webhook. The\n    returned preset has ``.webhook`` populated, so ``preset.webhook.url`` is the\n    ingress URL to hand to the user for manual-setup webhooks.\n\n    Fetches the graph itself (rather than taking a ``GraphModel``) so it can run\n    as an RPC endpoint without serializing the whole graph across the boundary.\n\n    Raises:\n        NotFoundError: if the graph no longer exists / isn't accessible.\n        InvalidInputError: if the graph has no webhook node, or the webhook\n            backend rejects the trigger config / credentials.\n    \"\"\"\n    graph = await get_graph(graph_id, version=graph_version, user_id=user_id)\n    if not graph:\n        raise NotFoundError(f\"Graph #{graph_id} is not accessible (anymore)\")\n    if not (trigger_node := graph.webhook_input_node):\n        raise InvalidInputError(\n            f\"Graph #{graph_id} does not have a webhook trigger node\"\n        )\n\n    trigger_config_with_credentials = {\n        **trigger_config,\n        **(\n            make_node_credentials_input_map(graph, agent_credentials).get(\n                trigger_node.id\n            )\n            or {}\n        ),\n    }\n\n    # Resource-follows-parent: the webhook lives in the graph's org/team,\n    # not the caller's active org.\n    new_webhook, feedback = await setup_webhook_for_block(\n        user_id=user_id,\n        trigger_block=trigger_node.block,","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/triggers.py#L42-L78","documentation":"InvalidInputError raised inside setup_triggered_preset when the graph exists but graph.webhook_input_node is None — the graph contains no webhook-capable input block, so no trigger can be registered. It signals a caller-side modeling problem: only graphs whose input includes a webhook block (e.g. webhook trigger blocks from the integrations framework) support triggered presets.","triggerScenarios":"POST /presets/setup-trigger for a graph built with a manual/scheduler start block instead of a webhook block; a graph whose webhook node was removed in a newer version while an older version_id was passed; calling the setup-trigger RPC on a plain agent graph.","commonSituations":"Developer assumes any agent can be webhook-triggered; UI allows trigger setup for non-webhook graphs; graph duplicated from a webhook template then had the webhook node deleted.","solutions":["Add a webhook trigger block (from the integrations category) as the graph's input node and re-save the graph.","Verify programmatically: fetch the graph and check graph.webhook_input_node is not None before calling setup.","Ensure you reference the graph version that actually contains the webhook node.","Handle InvalidInputError in callers with a message telling the user to add a webhook trigger to the agent."],"exampleFix":"# before\nawait setup_triggered_preset(user_id=uid, graph_id=gid, graph_version=v, ...)\n# after\ngraph = await get_graph(gid, version=v, user_id=uid)\nif graph and not graph.webhook_input_node:\n    raise ValueError(\"Add a webhook trigger block to this agent before setup\")\nawait setup_triggered_preset(user_id=uid, graph_id=gid, graph_version=v, ...)","handlingStrategy":"type-guard","validationCode":"graph = await get_graph(gid, version=v, user_id=uid)\nif graph and not graph.webhook_input_node:\n    raise ValueError('Graph needs a webhook trigger block before trigger setup')","typeGuard":"def supports_webhook_trigger(graph) -> bool:\n    \"\"\"True when the graph has a webhook-capable input node.\"\"\"\n    return graph.webhook_input_node is not None","tryCatchPattern":"try:\n    await setup_triggered_preset(...)\nexcept InvalidInputError as e:\n    if 'webhook trigger node' in str(e):\n        raise NeedsWebhookBlock('Add a webhook trigger block to the agent') from e\n    raise","preventionTips":["Only offer 'set up trigger' UI for graphs where webhook_input_node exists.","Gate trigger setup in graph templates to webhook-based starts."],"tags":["invalid-input","webhooks","graphs","triggers"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}