Cloudera Workflow Orchestrator operators and hooks
In Cloudera Workflow Orchestrator, operators and hooks are the fundamental building blocks used to define what a workflow actually does. While a DAG defines the structure, operators and hooks handle the execution logic and external integrations.
Operators
An operator represents a single, atomic unit of work within a DAG. When an operator is
instantiated in a DAG, it is called a Task. Cloudera Workflow Orchestrator provides a vast
library of operators, but they generally fall into the following categories:
- Action Operators – These perform a specific action or
command.
CDERunJobOperatorandCdeTriggerRunOperator– Triggers a process (a Spark or Python job) in a remote compute environment. It triggers and monitors jobs within the Cloudera Data Engineering service.BashOperator– Runs a bash command or script.PythonOperator– Calls an arbitrary Python function.EmailOperator– Sends an email.
- Transfer Operators – These are designed specifically to
move data from a source to a destination.
S3ToRedshiftOperator– Loads data from an S3 bucket into a Redshift table.
- Sensor Operators – These are a special type of operator
that keep running (poll) until a certain criteria is met.
ExternalTaskSensor– Waits for a task in a different DAG to complete.HttpSensor– Polls an HTTP endpoint until it returns a specific response.
Cloudera Workflow Orchestrator supports the following Airflow provider packages:
apache-airflow-providers-common-sqlapache-airflow-providers-httpapache-airflow-providers-postgresapache-airflow-providers-cncf-kubernetesapache-airflow-providers-amazonapache-airflow-providers-apache-hdfsapache-airflow-providers-apache-icebergapache-airflow-providers-apache-impalaapache-airflow-providers-apache-livyapache-airflow-providers-apache-sparkapache-airflow-providers-celeryapache-airflow-providers-common-compatapache-airflow-providers-common-ioapache-airflow-providers-common-messagingapache-airflow-providers-dockerapache-airflow-providers-elasticsearchapache-airflow-providers-ftpapache-airflow-providers-gitapache-airflow-providers-googleapache-airflow-providers-grpcapache-airflow-providers-hashicorpapache-airflow-providers-microsoft-azureapache-airflow-providers-mysqlapache-airflow-providers-odbcapache-airflow-providers-openlineageapache-airflow-providers-redisapache-airflow-providers-sendgridapache-airflow-providers-sftpapache-airflow-providers-slackapache-airflow-providers-smtpapache-airflow-providers-snowflakeapache-airflow-providers-sshapache-airflow-providers-standardgoogle-cloud-orchestration-airflowcloudera-airflow-provider==2.4.0cloudera-airflow-provider-awc==1.0.0
Hooks
While operators define the task, hooks act as the interface to external platforms. A hook abstracts the low-level API calls and connection details, allowing Cloudera Workflow Orchestrator to communicate with external systems such as databases, cloud providers, or APIs.
Hooks have the following key characteristics:
- Centralized connections – Hooks use Connection IDs stored in the Airflow Metadata Database, eliminating the need to hardcode credentials in your DAGs.
- Standardized methods – Many hooks share, for example, a SqliteHook or PostgresHook, common methods such as .get_records(), ensuring a consistent developer experience across different databases.
- Efficiency – Hooks handle the boilerplate code for authentication and session management.
Cloudera Workflow Orchestrator supports the following Airflow hooks:
airflow.hooks.dbapiairflow.hooks.filesystemairflow.hooks.package_indexairflow.hooks.subprocess
| Feature | Operator | Hook |
|---|---|---|
| Purpose | Defines a single unit of work (a task). | Defines how to connect to an external system. |
| Location | Used directly within the DAG file. | Usually called inside an Operator. |
| Scope | High-level Example: Run this SQL script |
Low-level Example: Open connection, run, close |
| Analogy | The Worker performing a job. | The tool the worker uses to perform the job. |
