Joebot is a small FastAPI service that lives between Slack and our Airflow deployment. It does two things:
Daily failure digest
A scheduled POST /generateDigest pulls every task instance that failed in
the last 24 hours from the Airflow REST API, hands the list to an LLM with a
digest prompt, and posts the summary to the engineering alerts channel. Instead of
a wall of red links each morning, the channel gets a readable recap grouped by
what actually went wrong.
Conversational Airflow
The bot also listens for mentions and DMs via Slack's Events API. When someone
asks a question, the model uses list_task_instances as a function-calling
tool, generated directly from the Pydantic schema of the Airflow request so
the model can filter by DAG, date range, duration, or state without any
hand-written glue. The bot runs the tool, feeds the results back into a second
completion, and replies in-thread.
Stack
- FastAPI on Cloud Run, built with
uvand deployed viacloudbuild.yaml - OpenAI Responses API with strict JSON-schema tools derived from Pydantic models
- Google-auth'd session against the Airflow REST API
- Slack signing-secret verification on every inbound event