Orchestra Governance and Escalation Workflow

System Design · sequence diagram · MIT

Illustrates the interactions between a Task and governance components like PolicyEngine, EscalationManager, AuditLog, and GenealogyTracker, showing policy

Source: https://github.com/vinoth2vinoth/Orchestra/blob/06e0a340f90d486d2f729cc8473921845af9622e/readme/GOVERNANCE.md
Curated by vinoth2vinoth
Orchestra Governance Policy Escalation Audit Lineage Workflow

Mermaid source

sequenceDiagram
    participant Task as Task Execution
    participant PE as PolicyEngine
    participant AL as AuditLog
    participant EM as EscalationManager
    participant GT as GenealogyTracker
    participant ES as EventStore

    Task->>PE: evaluate(task, agentId, threadId)
    PE->>ES: SYSTEM_HOOK (if violations)
    PE-->>Task: {status, violations}

    Task->>EM: recordFailure(threadId, agentId, error)
    EM->>AL: log(threadId, agentId, 'ESCALATION_TRIGGERED', ...)
    EM->>ES: SYSTEM_HOOK (ESCALATION)
    EM-->>Task: EscalationTier

    Task->>EM: requestApproval(threadId, agentId, action, context)
    EM->>AL: log(... 'HUMAN_INTERVENTION_REQUESTED')
    EM->>ES: HUMAN_INTERVENTION_REQUIRED
    EM-->>Task: throw WorkflowSuspendedError

    Task->>GT: recordLineage(agentId, input, output, parentIds)
    GT->>ES: MEMORY_STORED (Genealogy Tracking)
    GT-->>Task: nodeId

    Task->>GT: traceBlastRadius(nodeId)
    GT-->>Task: string[] (affected node IDs)

What this diagram shows

This diagram details the flow of a Task interacting with various governance components. It covers policy evaluation by the PolicyEngine, logging violations to the EventStore, handling task failures and triggering escalations via the EscalationManager, requesting human approvals, and recording task lineage and tracing dependencies using the GenealogyTracker, all while utilizing an AuditLog and EventStore.

When to use it

Use this diagram when designing systems that require robust governance, automated policy enforcement, comprehensive auditing, multi-tier escalation processes, human intervention workflows, and detailed lineage tracking for tasks or operations.

How to adapt it for your project

This pattern can be adapted by introducing more granular policy types, integrating with external incident management or approval systems, adding different escalation tiers based on severity, or extending the GenealogyTracker to include more metadata or support different graph databases.

Key concepts