Skip to content
approved Visibility internal Owner erik@uvilo.com Approver _ Created 2026-06-15 Updated 2026-06-27

Orchestration Plan 7

Scope: Integrate Inngest for cron scheduling and wire up the full orchestration loop — scheduled Project Runner and Task Runner runs, on-demand triggering, and the complete trigger → discover → invoke → monitor → handle failure pipeline (Spec §10).

Spec: Orchestration Spec

Prior plan: Plan 6


Task 1 — Set Up Inngest Project and Schedules

Inngest handles scheduling — it POSTs to the orchestrator’s HTTP endpoint on each schedule (Spec §10.1). The orchestrator does not need its own cron engine.

  1. Create an Inngest project (or use existing Uvilo workspace)
  2. Define scheduled functions (Spec §10.1):
    JobScheduleAgentDescription
    Project RunnerOnce dailyproject_runnerCheck active project phases
    Task RunnerHourlytask_runnerCheck for new agent todo items
    Memory CompactionOnce daily(future)Run memory compaction agent
    Infrastructure CheckMonthly(future)Check infrastructure configuration
  3. Each Inngest function POSTs to POST /orchestrator/run with the appropriate agent_id and task_prompt
  4. For the initial implementation, only configure Project Runner (daily) and Task Runner (hourly). The other two are future placeholders.

Deliverable: Inngest project with scheduled functions for Project Runner and Task Runner.


Task 2 — Update Dispatcher to Handle Scheduled Triggers

The orchestrator reuses POST /orchestrator/run for both scheduled and on-demand invocations (Spec §10.2).

  1. Extend the dispatcher to accept Inngest’s POST format:
    • Inngest sends a POST with event data including the schedule name and payload
    • Map the schedule to the appropriate agent_id and task_prompt
  2. Add a schedule-to-agent mapping configuration:
    const SCHEDULE_CONFIG = {
      project_runner_daily: {
        agent_id: "agent_<project_runner_id>",
        task_prompt: "Check all active projects for phase completions. For any completed phase, initiate the next phase or add an item to Erik_Todo.md for human approval.",
        mode: "disconnect"
      },
      task_runner_hourly: {
        agent_id: "agent_<task_runner_id>",
        task_prompt: "Check Agent_Todo.md for incomplete items. For each item, dispatch the appropriate SRP agent. Update todo item states as agents complete.",
        mode: "disconnect"
      }
    }
  3. Verify that the same POST /orchestrator/run endpoint works for both Inngest triggers and manual invocations

Deliverable: Dispatcher handles both scheduled and on-demand triggers.


Task 3 — End-to-End Scheduled Orchestration Test

  1. Trigger the Project Runner schedule manually (Inngest supports manual triggers via dashboard or API)
  2. Verify the full pipeline: Inngest → POST /orchestrator/run → invoke Project Runner → agent checks projects → creates todo items or initiates phases
  3. Trigger the Task Runner schedule manually
  4. Verify: Task Runner reads Agent_Todo.md → dispatches SRP agent → SRP agent completes → todo item updated
  5. Let one natural cycle run (wait for the hourly Task Runner trigger) and verify it fires correctly
  6. Check Postgres: verify AgentJob records are created and updated correctly for scheduled runs

Deliverable: Full scheduled orchestration loop verified end-to-end.