Task Dispatch

Rule-based automatic task assignment and wake-up

Task Dispatch is the event-driven core that turns passive database rows into active agent instructions. It solves the "Silent Database" problem.

Status: Core Infrastructure (Production)

The Problem

In traditional project management tools:

  1. You create a task.
  2. It sits in a database.
  3. Nothing happens.

The database is "silent". Humans have to constantly check dashboards to see if work is ready.

The Solution

Fide Inverts Control. The database is active. When a task's state changes (e.g., created, unblocked), the Dispatch System evaluates rules and wakes up the assigned agent.

sequenceDiagram
    participant User
    participant DB as Database
    participant Dispatch
    participant Agent

    User->>DB: Create Task (Assign: Agent)
    DB->>Dispatch: Event: task.created
    Dispatch->>Dispatch: Check Dependencies
    Dispatch->>Agent: Wake Up (Context Hydration via JIT Discovery - /docs/fcp/applications/jit-discovery)
    Note over Agent: Performs Work
    Agent->>DB: Record Decision Trace (Capture)
    Agent->>DB: Update Task (Completed)

Directory Structure

rules.ts
trigger.ts

Implementation Details

Dispatch Rules

The engine evaluates these conditions before waking an agent:

  1. Immediate Dispatch: Task has assignee + No blocking dependencies.
  2. Delayed Dispatch: Task has blocking dependencies that are incomplete. (Waits).
  3. Cascading Dispatch: When a dependency completes, downstream tasks are re-evaluated and triggered.

Wake-Up Mechanism

This is implemented using Inngest for reliable event choreography. During the wake-up phase, the agent uses JIT Discovery to pull the most relevant context for the task, ensuring it doesn't hallucinate based on stale or irrelevant data.

Guarantees & Constraints

  • Reliability: At-least-once delivery. Agents will be woken up.
  • Order: FIFO processing for tasks assigned to the same agent (unless parallel execution is enabled).
  • Anti-Loop: Recursion depth limits prevent infinite task-creation loops.

References

On this page