This message was deleted.
# ask-marvin
s
This message was deleted.
m
thought for 273.7 seconds
Thanks for flagging this. On Prefect 3.0.11 the Custom Webhook notification block’s form in the UI can appear read-only. If you’re staying on 3.0.11, the reliable workaround is to update/create the block programmatically and overwrite the existing one. Here’s how to create or update a Custom Webhook block by name:
Copy code
from prefect.blocks.notifications import CustomWebhookNotificationBlock

# Create or update (overwrite) the block named "my-webhook"
block = CustomWebhookNotificationBlock(
    url="<https://example.com/webhook>",
    method="POST",  # or GET/PUT/PATCH/DELETE
    headers={"Content-Type": "application/json"},
    json_data={"text": "Hello from Prefect!"},
    # params={"key": "value"},
    # form_data={"key": "value"},
    # cookies={"session": "abc"},
    # timeout=10,
)
# Save will create if it doesn't exist, or update if it does when overwrite=True
block.save("my-webhook", overwrite=True)
Notes: - The block type slug for this class is
custom-webhook-notification
, so the full slug is
custom-webhook-notification/my-webhook
. - If you prefer to inspect what you have first: - List all blocks:
prefect block ls
- Inspect a specific block:
prefect block inspect custom-webhook-notification/my-webhook
- If your code runs in an async context, use
await block.save(...)
. In a normal script,
block.save(...)
is fine. If you’re comfortable sharing: are you on Prefect Cloud or OSS UI? And is the entire form read-only or just some fields? I can tailor the guidance further (e.g., mapping current values, migrating secrets, etc.).