SiegbertSchnoesel
03/13/2026, 12:02 PMMarvin
03/13/2026, 12:02 PMMarvin
03/13/2026, 12:11 PM[project.entry-points."prefect.collections"]
my_company = "my_company_prefect"
- Ensure that importing my_company_prefect imports the module(s) that define your blocks.
3) Make sure your block declares the notification capability
- Either inherit NotificationBlock or set the capability and implement notify:
from prefect.blocks.core import Block
class MyNotifier(Block):
_block_type_name = "My Notifier"
_block_type_slug = "my-notifier" # stabilize the slug
_block_schema_capabilities = ["notify"]
async def notify(self, body: str, subject: str | None = None) -> None:
...
4) Register/update block types in the server environment
- After installing the package on the server:
prefect block register -m my_company_prefect
5) Restart the API service
- Entry points are loaded once per process; restart to ensure your collection is discovered.
6) Verify from the server environment
- Check that the type is present in the API:
prefect block type ls
prefect block type inspect my-notifier
- Optionally, sanity check class resolution:
python -c "from prefect.blocks.core import Block; Block.get_block_class_from_key('my-notifier'); print('OK')"
Common gotchas
- Entry points group name must be prefect.collections (not prefect.blocks).
- If you renamed the class, your slug may have changed. Either set _block_type_slug explicitly or recreate/update your block documents so they reference the current slug.
- If your block does not expose the “notify” capability, the automation will fail later with “not a notification block” even if the slug resolves.
Notes about Cloud vs Server
- You’re on Prefect Server, so installing your custom package into the API environment is supported and required.
- For Prefect Cloud, the control plane cannot import your private packages; you generally cannot use custom notification blocks in automations there. Use built-in blocks or route through a webhook if you need custom behavior.
If you can share:
- The exact error text
- How/where the custom package is installed
- The slug you expect
- How you registered the block (module/file)
…I can help pinpoint the exact step that’s failing.