Inspiration

Building AI-agent workflows usually means writing a lot of Python code, connecting APIs manually, handling conditions, and managing how different agents interact.

We wanted to create a simpler way to describe these workflows: instead of implementing every step in code, developers should be able to describe what the workflow should do using a purpose-built language.

That idea led to AgentFlow, a Domain-Specific Language designed specifically for defining, validating, and executing AI-agent workflows.

Our goal was to make agent orchestration feel more like writing a clear workflow specification than building a complex software pipeline from scratch.

What it does

AgentFlow lets developers define AI-agent workflows using a simple, readable syntax.

A workflow can describe:

  • Agents and their responsibilities
  • Inputs and outputs
  • Tasks and actions
  • Connections between agents
  • Conditions and branching
  • Sequential and parallel execution
  • Tool usage
  • Human approval steps
  • Workflow-level configuration

For example, an AgentFlow program can express a research workflow conceptually like:

workflow ResearchAssistant {

    agent researcher {
        task search_web
        task collect_sources
    }

    agent analyst {
        task analyze_information
    }

    researcher -> analyst

    output final_report
}

Instead of manually implementing the workflow orchestration, the AgentFlow runtime interprets the language and executes the defined workflow.

The project demonstrates the complete pipeline:

AgentFlow code → Parser → AST → Validation → Execution

How we built it

We built AgentFlow as a custom DSL using Python and textX as the language-processing foundation.

The system is divided into several components:

1. Language Grammar

We designed a dedicated grammar for describing AI-agent workflows.

The grammar defines concepts such as workflows, agents, tasks, connections, conditions, inputs, and outputs.

2. Parser

The AgentFlow source code is parsed into a structured representation.

This allows the system to understand the user's workflow rather than treating the program as plain text.

3. Abstract Syntax Representation

The parsed language is transformed into structured objects representing the workflow.

This provides the foundation for validation and execution.

4. Semantic Validation

AgentFlow checks the workflow for problems such as invalid references, undefined agents, missing tasks, and invalid workflow connections before execution.

5. Runtime

The runtime converts the validated workflow into an executable sequence of operations.

This is where agents, tasks, tools, conditions, and workflow transitions are coordinated.

6. Examples and Documentation

We created example AgentFlow programs demonstrating how the DSL can be used for different agent-based workflows.

The project is designed to be extensible so developers can add new agent types, tools, execution strategies, and language features.

Challenges we ran into

The biggest challenge was designing a language that was simple enough to read but expressive enough to represent real AI-agent workflows.

We had to think carefully about:

  • Designing intuitive syntax
  • Representing relationships between agents
  • Parsing nested workflow structures
  • Validating references between different parts of a workflow
  • Separating language parsing from execution
  • Handling invalid workflows gracefully
  • Designing an architecture that can be extended in the future

Another challenge was avoiding the temptation to make AgentFlow simply another configuration format.

A major part of the project was making it behave like an actual programming language with its own grammar, parsing process, structured representation, validation, and runtime.

Accomplishments that we're proud of

We are proud of turning the idea of an AI-agent workflow language into a working DSL architecture.

Some of the accomplishments include:

  • Designing a dedicated syntax for AI-agent workflows
  • Building a working parser
  • Creating a structured representation of AgentFlow programs
  • Implementing workflow validation
  • Building an execution layer
  • Creating example programs
  • Separating the language layer from the runtime
  • Designing AgentFlow to be extensible rather than tied to a single workflow

Most importantly, we created a foundation where developers can describe complex agent workflows using a language specifically designed for that problem domain.

What we learned

This project taught us that designing a programming language is much more than creating syntax.

We learned about:

  • Grammar design
  • Parsing
  • Abstract syntax representations
  • Semantic validation
  • Interpreters and runtimes
  • Domain-specific language design
  • Error handling
  • Language usability
  • Separating a compiler/interpreter front-end from execution logic

We also learned that a good DSL should hide unnecessary complexity without hiding the concepts developers need to understand.

What's next for AgentFlow

We want to evolve AgentFlow into a more complete language for AI-agent orchestration.

Future improvements could include:

  • A visual workflow editor
  • More advanced type checking
  • Parallel agent execution
  • Built-in AI model providers
  • Tool and API integrations
  • Persistent workflow state
  • Agent memory
  • Better debugging and tracing
  • Workflow testing
  • A package ecosystem for reusable agents and tools
  • IDE syntax highlighting and autocomplete
  • Compilation to multiple execution backends

Our long-term vision is for AgentFlow to become a developer-friendly language where complex multi-agent systems can be designed, tested, and executed using a concise and understandable programming model.

Built With

  • abstract
  • agentic
  • agents
  • ai
  • artificial
  • automation
  • compiler
  • domain-specific
  • dsl
  • intelligence
  • interpreter
  • language
  • natural
  • parser
  • processing
  • python
  • software
  • syntax
  • textx
  • tree
  • workflow
Share this project:

Updates

Submission history