Serverless Airflow Executor on Modal
Project description
Modalflow
A serverless Airflow Executor for Modal.
Usage
Prerequisites
- pip
- A Modal account, workspace, and environment
- Modal CLI configured to your workspace
Steps
pip install modalflowon your local machine, and add it to your Airflow cluster.- Run
modalflow deploy --env {environment name}to deploy the resources into your Modal environment. - Add
modalflow.executor.ModalExecutorto your Airflow config
Networking Configuration
Local Development
ModalExecutor automatically detects when you're running Airflow locally and creates a tunnel to your local Airflow instance (localhost:8080). No additional configuration needed.
The executor will:
- Detect if localhost:8080 is accessible
- Create a Modal tunnel to expose your local Airflow API
- Pass the tunnel URL to Modal Functions so they can "phone home"
Production / VPC Deployments
If your Airflow deployment is in a VPC or behind a firewall, you need to configure the execution API URL so Modal Functions can reach it.
Option 1: Environment Variable (Recommended)
Set the execution API URL as an environment variable:
export AIRFLOW__CORE__EXECUTION_API_SERVER_URL=https://your-airflow-api.example.com/execution/
Option 2: Airflow Config
Set in airflow.cfg:
[core]
execution_api_server_url = https://your-airflow-api.example.com/execution/
VPC Setup Considerations
If Airflow is deployed in a VPC, ensure:
-
Public Endpoint: Airflow API must be accessible via a public endpoint. Options include:
- Application Load Balancer (ALB) in public subnets
- API Gateway in front of Airflow
- Reverse tunnel (ngrok, Cloudflare Tunnel, AWS IoT Secure Tunneling)
-
Security: Use authentication/authorization to protect the endpoint:
- API keys or bearer tokens
- Security groups restricting access
- VPN or private networking (if Modal supports VPC peering)
-
Network Access: Modal Functions run in Modal's cloud infrastructure and can reach public internet endpoints. Ensure:
- No firewall rules blocking Modal's IP ranges
- The endpoint is reachable from the internet (not just internal VPC)
Example: Using Reverse Tunnel
If you can't expose Airflow directly, use a reverse tunnel:
- Set up ngrok or similar:
ngrok http 8080 - Configure the executor with the ngrok URL:
export AIRFLOW__CORE__EXECUTION_API_SERVER_URL=https://abc123.ngrok.io/execution/
Development
We use uv for development. To setup:
cd modalflowuv sync- To run the CLI, use:
uv run -- modalflow [COMMAND] - To run unit tests, use:
uv run pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modalflow-0.2.2.tar.gz.
File metadata
- Download URL: modalflow-0.2.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a46cbddda56c30ecdcb091b14b216f83d2f03c3712591661b4298f3b6914cf4
|
|
| MD5 |
15efe20a9b3e46fc74ec3b37e7b518f3
|
|
| BLAKE2b-256 |
14b68d1f2b0d5201dd670aa75175a0ad1fcdc931eb848e97c0714da7f8cf6c2a
|
Provenance
The following attestation bundles were made for modalflow-0.2.2.tar.gz:
Publisher:
publish.yml on agupta01/modalflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modalflow-0.2.2.tar.gz -
Subject digest:
1a46cbddda56c30ecdcb091b14b216f83d2f03c3712591661b4298f3b6914cf4 - Sigstore transparency entry: 1031552848
- Sigstore integration time:
-
Permalink:
agupta01/modalflow@ac7f687641a5e9f015f2c6dad0c0f9074f0325b7 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/agupta01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac7f687641a5e9f015f2c6dad0c0f9074f0325b7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file modalflow-0.2.2-py3-none-any.whl.
File metadata
- Download URL: modalflow-0.2.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc4004db2b9175063e60008e92fea649653e5bfba25fcb395efada0bd6d85740
|
|
| MD5 |
470b26934f76cf447cb10a29b3eef0e5
|
|
| BLAKE2b-256 |
3c8dfc88ce48cbcf3245ce062cd531a0cb1491a1dc8c5d013ae3b5b1e24cff02
|
Provenance
The following attestation bundles were made for modalflow-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on agupta01/modalflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modalflow-0.2.2-py3-none-any.whl -
Subject digest:
cc4004db2b9175063e60008e92fea649653e5bfba25fcb395efada0bd6d85740 - Sigstore transparency entry: 1031552963
- Sigstore integration time:
-
Permalink:
agupta01/modalflow@ac7f687641a5e9f015f2c6dad0c0f9074f0325b7 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/agupta01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac7f687641a5e9f015f2c6dad0c0f9074f0325b7 -
Trigger Event:
release
-
Statement type: