Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign Task Scheduling of Orchestrator Agent and API Integration #287

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Xm0onh
Copy link
Member

@Xm0onh Xm0onh commented Mar 6, 2025

This PR introduces a comprehensive task scheduling system that enables:

  1. Scheduling tasks to run at specific future times
  2. Managing a queue of scheduled tasks
  3. Auto-scheduling follow-up tasks based on workflow results
  4. Exposing task management via REST API endpoints

In the next PR, I'll integrate this with Web-CLI

Implementation Details

Core Components

  • Task Queue: Created a task queue system in taskQueue.ts that maintains scheduled, current, and completed tasks
  • Task Executor: Added taskExecutor.ts to handle the execution of due tasks with proper scheduling
  • API Integration: Extended the OrchestratorRunner with task scheduling methods and integrated with the API server

API Endpoints

Added new REST endpoints:

  • GET /:namespace/tasks - Retrieve all tasks for a namespace
  • POST /:namespace/addTask - Schedule a new task with optional execution time
  • POST /:namespace/run - Run a workflow with passing input

Changes

  • Added express-async-handler dependency for clean async route handling
  • Extended OrchestratorRunner interface with task management methods
  • Created task queue and executor implementations
  • Added API routes for task management and workflow execution
  • Integrated with existing logging and orchestration systems

@Xm0onh Xm0onh changed the title Redesign Task Scheduling to Orchestrator Workflow and API Integration Redesign Task Scheduling of Orchestrator Agent and API Integration Mar 6, 2025
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@1yefuwang1/[email protected] None 0 2.38 MB 1yefuwang1
npm/@1yefuwang1/[email protected] None 0 3.44 MB 1yefuwang1
npm/@1yefuwang1/[email protected] None 0 1.57 MB 1yefuwang1

View full report↗︎

@Xm0onh Xm0onh requested a review from jfrank-summit March 6, 2025 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant