An n8n-like workflow system for creating and managing A2A agent networks.
Agent Flow is a Python-based workflow system that allows you to:
- Connect multiple A2A agents together into networks
- Use conditional branching, transformations, and parallel execution
- Integrate with MCP tools for additional functionality
- Create, save, and run complex workflows
- Build powerful agent-based applications
Based on the Python A2A framework, Agent Flow provides a unified way to connect LLMs, agents, and tools.
- Agent Integration: Connect to local and remote A2A agents
- Agent Management: Create, monitor, and control A2A agents from templates
- Tool Integration: Use MCP tools in your workflows
- Workflow Engine: Powerful execution engine with conditional branching
- Visual Editor: Drag-and-drop interface for building workflows
- CLI Interface: Command-line interface for managing workflows
- REST API: HTTP API for programmatic access
- Persistence: Save and load workflows
Agent Flow is included as part of the python-a2a package. To start using it:
# Install python-a2a
pip install python-a2a
# Or install in development mode
pip install -e .
# Start the Agent Flow UI
a2a uiThe UI will automatically open in your browser at http://localhost:8080.
Start the Agent Flow UI to begin creating workflows:
# Start the UI server
a2a uiThis will open the UI in your browser at http://localhost:8080.
In the UI, you can discover and connect to agents:
- Go to the "Agents" tab in the UI
- Click "Discover Agents" to find agents on your network
- Add agents manually by providing their URL
Or use the CLI to discover agents:
# Discover agents using the command line
a2a agent discoverAfter discovering agents, you can build workflows using the visual editor:
- Drag and drop nodes onto the canvas
- Connect nodes with edges
- Configure node properties
- Save and run your workflow
Create a file called my_workflow.json:
{
"name": "Simple Agent Workflow",
"description": "A basic workflow connecting two agents",
"nodes": [
{
"id": "input",
"name": "User Input",
"type": "INPUT",
"position": {"x": 100, "y": 100},
"config": {
"input_key": "query"
}
},
{
"id": "weather",
"name": "Weather Agent",
"type": "AGENT",
"position": {"x": 400, "y": 100},
"config": {
"agent_id": "REPLACE_WITH_WEATHER_AGENT_ID"
}
},
{
"id": "output",
"name": "Result",
"type": "OUTPUT",
"position": {"x": 700, "y": 100},
"config": {
"output_key": "result"
}
}
],
"edges": [
{
"id": "e1",
"source": "input",
"target": "weather",
"type": "DATA"
},
{
"id": "e2",
"source": "weather",
"target": "output",
"type": "DATA"
}
]
}Replace REPLACE_WITH_WEATHER_AGENT_ID with the actual agent ID from the discovery step.
# Import your workflow
a2a workflow create --file my_workflow.json
# Run your workflow
a2a workflow run YOUR_WORKFLOW_ID --input '{"query": "What is the weather in London?"}'Agent Flow is built on a modular architecture:
- Models: Core data models for workflows, agents, and tools
- Engine: Execution engine for running workflows
- Storage: Storage services for saving and loading workflows
- Server: REST API and web interface
- CLI: Command-line interface
Start the Agent Flow UI:
a2a uiThe browser will automatically open to http://localhost:8080 to access the visual editor.
Command options:
--port PORT: Specify a custom port (default: 8080)--host HOST: Specify a custom host (default: localhost)--storage-dir DIR: Specify a directory for workflow storage--no-browser: Don't open browser automatically--debug: Enable debug mode
The API provides endpoints for:
/api/agents: Managing agent definitions/api/tools: Managing tool definitions/api/workflows: Managing workflows/api/executions: Managing workflow executions/api/agent_templates: List agent templates/api/agent_servers: Manage running agent servers/api/create_agent: Create agents from templates/api/import_agents: Import agent collections/api/export_agents: Export agent collections
Agent Flow includes a comprehensive agent management system that allows you to:
-
Create agents from templates, including:
- Weather Agent
- Travel Agent
- Math Agent
- Knowledge Agent
- OpenAI-powered Agent (requires API key)
- Anthropic-powered Agent (requires API key)
- Custom Script Agent
-
Monitor agent health and status
-
Start and stop agent servers
-
Import and export agent configurations
The agent management UI is accessible at http://localhost:8080/agents
For more complex workflows with conditional branching:
- Add a conditional node to check for specific conditions in responses
- Connect the nodes with different edge types (DATA, CONDITION_TRUE, CONDITION_FALSE)
- Add transform nodes to modify data between agents
To add external tools to your workflows:
- Start an MCP server with tools
- Discover and register the tools using the UI or CLI
- Add tool nodes to your workflow and configure them
- Check the API docs at http://localhost:8080/api/docs
- Create complex workflows with multiple agents and tools
- Connect your own AI models and agents
- Contribute to the project by submitting issues and pull requests
This project is licensed under the MIT License - see the LICENSE file for details.