Skip to content

Agentic Workflow

The agentic workflow converts an incoming request into a structured, reviewable, and executable operational plan.

Trigger Points

  • POST /requests: primary trigger for request-driven planning.
  • POST /resources/suggest/{disaster_id}: resource-focused suggestion trigger.

Workflow Pipeline

flowchart TD
    T1[Trigger received] --> T2[Context assembly]
    T2 --> T3[Request + disaster + resource retrieval]
    T3 --> T4[LLM planning and reasoning]
    T4 --> T5[Task decomposition]
    T5 --> T6[Resource and manpower suggestion]
    T6 --> T7[Confidence and priority scoring]
    T7 --> T8[Persist WorkflowOutput]
    T8 --> T9[Human review/moderation]
    T9 -->|approved| T10[Create tasks and assignments]
    T9 -->|rejected/edited| T11[Revise plan]
    T11 --> T8

Data Artifacts Produced

  1. WorkflowOutput (per request)
  2. WorkflowTask[] (ordered response steps with priority and approval status)
  3. WorkflowResource[] (resource recommendations with quantities and approval status)

Moderation And Human-in-the-Loop

  • AI output is not treated as final dispatch by default.
  • Admin/dispatcher can approve, reject, or edit generated tasks/resources.
  • Approved artifacts are translated into first-class operational entities (Task, resource status updates).

Execution State Model

stateDiagram-v2
    [*] --> Requested
    Requested --> Planned: workflow generated
    Planned --> AwaitingApproval: persisted for moderation
    AwaitingApproval --> Approved: admin approves
    AwaitingApproval --> Rejected: admin rejects
    Rejected --> Planned: regenerated/edited
    Approved --> Assigned: tasks created and assigned
    Assigned --> InProgress: responder on_route
    InProgress --> Completed: task success
    InProgress --> Failed: operational failure

Observability and Reliability

  • Each workflow run should be traceable (Langfuse integration).
  • Failures in worker execution should not block API request acknowledgment.
  • Retries, idempotent writes, and explicit status transitions reduce duplicate dispatch risk.