Registry /
workflow / apache-airflow-providers-pagerduty
Install & Compatibility
Where this runs
tested against v5.2.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 5.402s · 267.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 26.2s · import 4.960s · 267MB
266MB installed
● package 266MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PagerdutyHook
✓ from airflow.providers.pagerduty.hooks.pagerduty import PagerdutyHook
send_pagerduty_notification
✓ from airflow.providers.pagerduty.notifications.pagerduty import send_pagerduty_notification
PagerdutyNotifier
✓ from airflow.providers.pagerduty.notifications.pagerduty import PagerdutyNotifier
✗ from airflow.providers.pagerduty.notifications import PagerdutyNotifier
Import from the specific 'pagerduty' module within 'notifications'.
This quickstart demonstrates how to use `send_pagerduty_notification` as an `on_failure_callback` for both a DAG and a specific task. Ensure you have configured a PagerDuty connection in Airflow (Admin -> Connections, type 'Pagerduty' or 'Pagerduty Events') or provide the `integration_key` directly. For security, it's recommended to store sensitive keys in Airflow Connections or a secret backend, and retrieve them via `BaseHook.get_connection`.
import os
from datetime import datetime
from airflow.models.dag import DAG
from airflow.operators.bash import BashOperator
from airflow.providers.pagerduty.notifications.pagerduty import send_pagerduty_notification
PAGERDUTY_INTEGRATION_KEY = os.environ.get('PAGERDUTY_INTEGRATION_KEY', '')
with DAG(
dag_id='pagerduty_notification_example',
start_date=datetime(2023, 1, 1),
schedule=None,
catchup=False,
tags=['pagerduty', 'notification'],
on_failure_callback=[
send_pagerduty_notification(
summary="The DAG {{ dag.dag_id }} failed!",
severity="critical",
source="airflow dag_id: {{dag.dag_id}}",
dedup_key="{{dag.dag_id}}-failure",
component="airflow",
integration_key=PAGERDUTY_INTEGRATION_KEY,
)
]
) as dag:
start_task = BashOperator(
task_id='start_task',
bash_command='echo "Starting DAG..."',
)
failing_task = BashOperator(
task_id='failing_task',
bash_command='exit 1', # This task will intentionally fail
on_failure_callback=[
send_pagerduty_notification(
summary="Task {{ ti.task_id }} failed in DAG {{ dag.dag_id }}",
severity="error",
source="airflow task_id: {{ti.task_id}}",
dedup_key="{{dag.dag_id}}-{{ti.task_id}}-failure",
component="airflow",
integration_key=PAGERDUTY_INTEGRATION_KEY,
)
]
)
success_task = BashOperator(
task_id='success_task',
bash_command='echo "DAG succeeded!"',
)
start_task >> failing_task >> success_task
Debug
Known issues
breakingProvider version 5.0.0 removed all deprecated classes, parameters, and features. Ensure your code does not rely on any previously deprecated components.fixRefer to the official changelog for specific removals. Update your code to use current API methods.
affects: >=5.0.0
breakingMinimum Apache Airflow version required is 2.11.0. Older Airflow versions are not supported.fixUpgrade your Apache Airflow environment to at least version 2.11.0. If upgrading from Airflow <2.1.0, an `airflow upgrade db` might be necessary.
affects: <5.0.0 requires Airflow <2.1.0, >=5.0.0 requires >=2.1.0, >=5.2.4 requires >=2.11.0
breakingPython 3.9 support was dropped with version 5.0.1. Ensure your environment uses Python 3.10 or newer.fixUpgrade your Python environment to version 3.10 or later.
affects: >=5.0.1
gotchaWhen configuring a PagerDuty connection in Airflow, there are two main types: 'Pagerduty' for the REST API (requires an API token in the 'Password' field) and 'Pagerduty Events' for the Events API (requires an Integration Key). Using the wrong type or credential will lead to authentication failures.fixSelect the correct connection type in the Airflow UI (Admin -> Connections) and provide the corresponding API token or Integration Key in the designated field. For Events API, the integration key can often be passed directly to the `send_pagerduty_notification` function.
affects: All versions
gotchaAn issue (reported in Jan 2025 as #45626) indicated that the `PagerdutyNotifier` class's `notify` method was attempting to use a `create_event` method that no longer existed, leading to failed notifications. While this might be resolved in current versions, using the `send_pagerduty_notification` function directly in callbacks is often a more robust and commonly demonstrated approach.fixPrefer using the `send_pagerduty_notification` function for DAG/task callbacks. If using `PagerdutyNotifier`, ensure your provider version is sufficiently updated and test the notification flow thoroughly.
affects: Potentially provider versions around 4.x - 5.0.x (check specific patch notes for resolution)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'airflow.providers.pagerduty'
The 'apache-airflow-providers-pagerduty' package is not installed or not properly configured.
fixInstall the package using 'pip install apache-airflow-providers-pagerduty'.
ImportError: cannot import name 'PagerdutyHook' from 'airflow.providers.pagerduty.hooks.pagerduty'
The 'PagerdutyHook' class has been moved or renamed in recent versions of the provider package.
fixUpdate the import statement to 'from airflow.providers.pagerduty.hooks.pagerduty import PagerDutyHook'.
AttributeError: 'PagerdutyHook' object has no attribute 'create_event'
The 'create_event' method has been deprecated and removed in favor of 'send_event'.
fixReplace 'create_event' with 'send_event' in your code.
TypeError: send_event() missing 1 required positional argument: 'event'
The 'send_event' method requires an 'event' argument that was not provided.
fixEnsure you pass the required 'event' argument when calling 'send_event'.
RuntimeError: The package 'apache-airflow-providers-pagerduty' needs Apache Airflow 2.11.0+
The installed version of Apache Airflow is lower than the required version for this provider package.
fixUpgrade Apache Airflow to version 2.11.0 or higher.
Upgrade
Version history
5.2.6latest on PyPI · released Jun 7, 2026
Audit
Dependencies
apache-airflowrequiredCore Apache Airflow library, required for all providers.
pagerdutyrequiredOfficial PagerDuty Python client library used by the provider.
apache-airflow-providers-common-compatoptionalProvides common compatibility features for providers, used with `[common.compat]` extra.
apache-airflow-providers-httpoptionalProvides HTTP connection functionality, used with `[http]` extra.