Skip to main content

Webhook

Send custom HTTP webhook notifications (most flexible option).

Attributes​

AttributeTypeDescription
urlstrWebhook URL (supports template variables)
methodLiteral["POST", "PUT", "PATCH", "GET", "DELETE", "HEAD", "OPTIONS", "TRACE", "CONNECT"] = "POST"HTTP method (default: "POST")
headersOptional[Dict[str, str]] = nullOptional HTTP headers (values support template variables)
bodyOptional[Dict[str, Any]] = nullOptional request body as dict (all string values support template variables recursively)

Constructor​

Signature​

def Webhook(
on_phase: Union[[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase), List[[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase)]] = null,
url: str = null,
method: str = "POST",
headers: Optional[Dict[str, str]] = None,
body: Optional[Dict[str, Any]] = None
) -> null

Parameters​

NameTypeDescription
on_phaseUnion[[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase), List[[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase)]] = nullThe execution phase or phases that trigger the notification.
urlstr = nullThe destination URL for the webhook request, supporting template variables.
methodstr = "POST"The HTTP method to use for the request (e.g., POST, PUT, PATCH).
headersOptional[Dict[str, str]] = NoneA dictionary of HTTP headers to include in the request.
bodyOptional[Dict[str, Any]] = NoneA dictionary representing the request body, which can contain nested template variables.