Skip to content

perry-sonar/flow-agent

Repository files navigation

Flow Agent

A microservices-based automation platform with workflow execution capabilities.

Project Structure

flow-agent/
├── src/                    # Source code for all services
│   ├── workflow-worker/    # Workflow execution engine
│   └── docker-compose.yaml # Service-level Docker Compose
├── tests/                  # Service-level tests
│   ├── workflow-worker/    # Workflow worker tests
│   └── docker-compose.yaml # Test environment Docker Compose
└── instructions/           # Service documentation and PRDs

Quick Start

Running Services

  1. Start the services from the project root:

    docker-compose -f src/docker-compose.yaml up -d
  2. Check the logs:

    docker-compose -f src/docker-compose.yaml logs workflow-worker
  3. Stop the services:

    docker-compose -f src/docker-compose.yaml down

Running Tests

Tests are now organized in a separate test directory and run using Docker Compose:

  1. Navigate to the tests directory:

    cd tests
  2. Run the tests:

    docker-compose up

This will:

  • Build the test environment
  • Run all tests for the workflow-worker service
  • Exit automatically when tests complete
  1. To run tests in detached mode and check results:
    docker-compose up -d
    docker-compose logs workflow-worker
    docker-compose down

Services

Workflow Worker

The workflow execution engine that processes workflow definitions and executes them node by node.

Status: Milestone 1 Complete

  • ✅ Basic project structure
  • ✅ Taskiq worker with Redis broker
  • ✅ Simple execute_node task that logs inputs
  • ✅ Docker configuration
  • ✅ Test framework with respx for HTTP mocking

Next Milestones:

  • Milestone 2: Core action node execution and state management
  • Milestone 3: Conditional logic and error handling
  • Milestone 4: Parallelism (expand and join nodes)
  • Milestone 5: Resource limit enforcement

Development

Local Development

For local development without Docker:

  1. Install dependencies:

    cd src/workflow-worker
    pip install -r requirements.txt
    pip install -r requirements-dev.txt
  2. Run tests locally:

    pytest tests/

Testing Strategy

  • Service Tests: Located in /tests/ directory, run via Docker Compose
  • Unit Tests: Can be run locally or within the test container
  • Integration Tests: Use respx for HTTP mocking to isolate services
  • Workflow Tests: Sample workflow JSON files in /tests/workflow-worker/test_workflows/

Architecture

The system consists of several microservices:

  • Workflow Service: Manages workflow definitions
  • State Service: Manages workflow execution state
  • Integration Service: Provides external API integrations
  • Workflow Worker: Executes workflows (this service)

All services communicate via HTTP APIs and use Redis for task queuing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published