{"record":{"id":"5dd41bc4f73f527d","repo":"Significant-Gravitas/AutoGPT","slug":"could-not-set-up-webhook-feedback","errorCode":null,"errorMessage":"Could not set up webhook: {feedback}","messagePattern":"Could not set up webhook: (.+?)","errorType":"exception","errorClass":"InvalidInputError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/triggers.py","lineNumber":84,"sourceCode":"        **(\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,\n        trigger_config=trigger_config_with_credentials,\n        organization_id=graph.organization_id,\n        team_id=graph.team_id,\n    )\n    if not new_webhook:\n        raise InvalidInputError(f\"Could not set up webhook: {feedback}\")\n\n    return await db.create_preset(\n        user_id=user_id,\n        preset=models.LibraryAgentPresetCreatable(\n            graph_id=graph.id,\n            graph_version=graph.version,\n            name=name,\n            description=description,\n            inputs=trigger_config_with_credentials,\n            credentials=agent_credentials,\n            is_active=True,\n        ),\n        webhook_id=new_webhook.id,\n        # A trigger on an expert-installed workflow fires as the expert's\n        # work: unique (user, graph) → expert matches keep the attribution.\n        expert_id=await experts_db.resolve_expert_for_graph(user_id, graph.id),\n    )\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/triggers.py#L66-L102","documentation":"InvalidInputError raised inside setup_triggered_preset when setup_webhook_for_block returns no webhook — the webhook provider/backend rejected the registration and returned a feedback string. The error embeds that feedback, which carries the provider-specific reason (bad credentials, invalid config, provider API failure). Note the webhook is created in the graph's org/team (resource-follows-parent), not the caller's.","triggerScenarios":"setup-trigger with trigger_config values the provider rejects (invalid event names, malformed URLs); missing or expired provider credentials for the webhook block; provider API down or rate-limiting; credentials supplied for the wrong provider.","commonSituations":"Expired third-party OAuth token for the trigger block; provider changed required config fields; org-level integration not enabled; webhook provider secret not configured in the backend environment.","solutions":["Read the embedded {feedback} — it is the provider's own rejection message and names the exact problem.","Reconnect the provider credentials and pass fresh ones in agent_credentials.","Validate trigger_config keys against the webhook block's input schema before submission.","If feedback indicates provider outage/rate limit, back off and retry rather than re-submitting immediately."],"exampleFix":"# before\nawait setup_triggered_preset(user_id=uid, graph_id=gid, graph_version=v, name=n, description=d, trigger_config=cfg, agent_credentials=creds)\n# after\ntry:\n    await setup_triggered_preset(user_id=uid, graph_id=gid, graph_version=v, name=n, description=d, trigger_config=cfg, agent_credentials=creds)\nexcept InvalidInputError as e:\n    if 'expired' in str(e):\n        creds = await refresh_provider_credentials(uid)\n        return await setup_triggered_preset(user_id=uid, graph_id=gid, graph_version=v, name=n, description=d, trigger_config=cfg, agent_credentials=creds)\n    raise","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await setup_triggered_preset(...)\nexcept InvalidInputError as e:\n    if 'expired' in str(e).lower():\n        creds = await refresh_provider_credentials(uid)\n        return await setup_triggered_preset(..., agent_credentials=creds)\n    raise TriggerRejected(str(e)) from e","preventionTips":["Parse the embedded feedback string; it is the provider's own diagnosis.","Re-authenticate provider credentials before trigger setup if they are older than the provider's token TTL.","Validate trigger_config against the webhook block schema client-side."],"tags":["invalid-input","webhooks","triggers","credentials"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}