What if routine developer tasks could run themselves, triggered by systems not by human prompts? Docker recently put this idea to the test, using event-driven, agentic AI to automatically respond to GitHub pull requests.
This approach moves automation beyond the chatbot, showing how intelligent agents can streamline workflows and maximize productivity without direct human input.
Spotting the Perfect Automation Target
With numerous repositories housing tutorials and sample code, Docker frequently receives pull requests from newcomers eager to share their completed exercises. While the enthusiasm is appreciated, accepting these PRs would disrupt the learning journey for others. The repetitive process of reviewing, commenting, and closing these submissions presents a strong case for automation.
- Goal: Instantly recognize tutorial-completion PRs, reply with an encouraging comment, and close them entirely hands-free.
- Trigger: GitHub webhooks alert the agentic app whenever a new PR is opened.
- Tasks: The agent analyzes the PR, drafts a thoughtful comment, and posts it before closing the PR.
Building the Agentic Workflow
The team selected Mastra.ai for its TypeScript compatibility and robust support for multi-agent workflows. The architecture splits the process into three targeted agents: one for PR analysis, one for generating comments, and one for handling execution. This modular setup ensures each agent can respond precisely to events as they happen.
- Integration: The Docker MCP Gateway integrates with GitHub, exposing only the tools required for the workflow.
- Models: Qwen3 handles analysis and execution, while Gemma3 delivers fast, high-quality comment generation.
- Configuration: Docker Compose orchestrates all components, from models to secrets, making scaling and experimentation straightforward.
From Code to Automated Workflow
By leveraging Mastra’s APIs, each agent is assigned clear roles, models, and tools. The Mastra Playground plays a key role in testing and refining prompts, ensuring each agent behaves as intended. Conditional logic is built in, if the analysis suggests a PR should be closed, the execution agent posts a comment and closes it automatically.
- Event Handling: Webhooks managed via smee-client and Express capture relevant PR data for the agentic workflow.
- Testing: Manual tests confirm the system’s ability to autonomously identify, comment, and close tutorial PRs.
Key Takeaways from the Hackathon
- Event-driven agents open new automation possibilities: Automation doesn’t need to rely on chatbots, event triggers can drive seamless, background workflows.
- Prompt engineering is a continuous process: Crafting effective agent prompts is challenging but accelerated by rapid prototyping tools like Mastra Playground.
- Docker makes experimentation easy: Docker Compose enables swapping models and reconfiguring services quickly, optimizing both performance and cost.
- Balance agentic and procedural steps: Not every task needs an agent; simple logic can sometimes deliver faster, more reliable results.
- Testing strategies are evolving: The project raised important questions about the best ways to test agentic workflows, whether via mocked responses or full end-to-end runs.
The Future of Agentic Automation
This experiment demonstrates the value of event-driven agents to automate tasks far beyond chat interfaces. By combining modular agentic logic, advanced frameworks, and Docker’s flexibility, teams can create smart applications that respond to real-world events. As agentic automation matures, expect more workflows to blend intelligent agents with traditional tools freeing developers to focus on creative, higher-value work.
Event-Driven Agents: Automating Developer Workflows Beyond Chatbots