Jackson Freitas
09/23/2025, 1:53 PMMarvin
09/23/2025, 1:53 PMMarvin
09/23/2025, 2:00 PMprefect.blocks.webhook.Webhook
(stores URL, headers, method, etc.)
- prefect.blocks.notifications.CustomWebhookNotificationBlock
(send notifications to arbitrary webhook endpoints)
- Register your custom block types so they appear in the UI:
prefect block register -m your_package.blocks
- Docs: Blocks overview
2) Inbound webhooks (Cloud-only)
- If you need a public URL managed by Prefect to receive events and trigger actions/flows, that’s available in Cloud:
- Create a webhook (Cloud)
- This capability is not available in OSS right now. There isn’t a public timeline for OSS parity. If this is important to you, I’m happy to pass your feedback along.
3) OSS patterns to receive external requests and trigger flows
If you’re self-hosting, you can still handle inbound requests—you’ll just run the endpoint yourself and call Prefect to start a flow run.
A. Minimal FastAPI (or any web framework) service that calls Prefect’s Python client
- Handle the external HTTP request, parse/validate payload, then trigger a deployment via the client:
from fastapi import FastAPI, Request
import os
from prefect import get_client
app = FastAPI()
DEPLOYMENT_ID = os.environ["PREFECT_DEPLOYMENT_ID"]
@app.post("/webhook")
async def receive(request: Request):
payload = await request.json()
async with get_client() as client:
run = await client.create_flow_run_from_deployment(
deployment_id=DEPLOYMENT_ID,
parameters={"payload": payload},
tags=["webhook"],
)
return {"flow_run_id": str(run.id)}
- You can add HMAC validation, IP allowlists, retries, etc., as needed.
B. Call the Prefect REST API directly from your external system
- Your service (or the third party) can POST to the Prefect Server API to create flow runs.
- REST reference: Create a flow run (REST)
Notes and clarifications
- Automations/event-driven features in the UI (including inbound webhooks) are Cloud features today.
- Outbound webhooks/notifications are fully usable in OSS via Blocks.
- If you tell me more about the external system and your security constraints (e.g., need for signed payloads/HMAC, rate limits, required response times), I can sketch a concrete setup (FastAPI example, infra notes, and how to pass parameters into your deployment).