{"id":23037,"library":"apache-airflow-providers-discord","title":"Apache Airflow Provider for Discord","description":"An Apache Airflow provider package that integrates Discord messaging via webhooks. Version 3.12.2 supports Airflow 2.9+ and Python ≥3.10. Released on a monthly cadence alongside other providers.","status":"active","version":"3.12.2","language":"python","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/providers/discord","tags":["airflow","provider","discord","webhook","notification"],"install":[{"cmd":"pip install apache-airflow-providers-discord","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Core dependency required for all Airflow providers.","package":"apache-airflow","optional":false}],"imports":[{"note":"Old Airflow 1.x path; deprecated since Airflow 2.0.","wrong":"from airflow.contrib.hooks.discord_hook import DiscordWebhookHook","symbol":"DiscordWebhookHook","correct":"from airflow.providers.discord.hooks.discord_webhook import DiscordWebhookHook"}],"quickstart":{"code":"from airflow import DAG\nfrom airflow.providers.discord.operators.discord_webhook import DiscordWebhookOperator\nfrom datetime import datetime, timedelta\nimport os\n\ndefault_args = {\n    'owner': 'airflow',\n    'depends_on_past': False,\n    'email_on_failure': False,\n    'email_on_retry': False,\n    'retries': 1,\n    'retry_delay': timedelta(minutes=5),\n}\n\nwith DAG(\n    'discord_webhook_example',\n    default_args=default_args,\n    description='A simple DAG to send Discord message',\n    schedule_interval=timedelta(days=1),\n    start_date=datetime(2021, 1, 1),\n    catchup=False,\n    tags=['example'],\n) as dag:\n    discord_task = DiscordWebhookOperator(\n        task_id='send_discord_notification',\n        http_conn_id='discord_webhook',\n        message='Hello from Airflow!',\n        username='AirflowBot',\n        avatar_url='',\n        tts=False,\n        proxy=None,\n        dag=dag,\n    )","lang":"python","description":"Sends a Discord message via webhook operator. Requires a connection with ID 'discord_webhook' containing the webhook URL."},"warnings":[{"fix":"Always provide 'http_conn_id' when instantiating DiscordWebhookHook or DiscordWebhookOperator. Create a Connection with 'discord_webhook' as conn_id and the webhook URL in the 'host' field.","message":"Default hook/operator classes now require 'http_conn_id' to be explicitly set. In older versions (pre-3.0), the webhook URL was read from variable 'discord_webhook_url'.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"In Airflow UI, create a Connection: Conn Id = discord_webhook, Conn Type = HTTP, Host = https://discord.com/api/webhooks/... (the full webhook URL).","message":"The webhook URL is stored in the 'host' field of the Airflow connection, not in the 'password' or 'login' fields. Many users mistakenly put it in the password field.","severity":"gotcha","affected_versions":"all"},{"fix":"Verify the webhook URL manually by sending a test curl command. Ensure the webhook is active and has proper permissions.","message":"The operator sends the message as a POST request to the webhook URL. If the webhook URL is invalid or Discord returns an error, the task fails with a generic HTTP error. No additional error details are logged.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install via pip: pip install apache-airflow-providers-discord. Ensure Airflow 2.0+ is installed.","cause":"The provider package is not installed or the Airflow version is too old (pre-2.0).","error":"ModuleNotFoundError: No module named 'airflow.providers.discord'"},{"fix":"Use current import: from airflow.providers.discord.hooks.discord_webhook import DiscordWebhookHook","cause":"Using deprecated import paths from Airflow 1.x.","error":"AttributeError: module 'airflow.hooks.base_hook' has no attribute 'BaseHook'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}