Jido.Composer.HITL.ApprovalRequest (Jido Composer v0.4.0)

Copy Markdown View Source

A serializable struct representing a pending human decision.

Constructed by the HumanNode and enriched by the strategy with flow identification. Contains no PIDs, closures, or process references — it can be persisted, sent over the wire, or displayed in any UI.

Required Fields

  • prompt — Human-readable question
  • allowed_responses — Outcome atoms the human can choose from

Strategy-Set Fields

The following fields are typically set by the strategy layer after the HumanNode constructs the initial request:

  • agent_id, agent_module — identity of the suspended agent
  • workflow_state — current FSM state (Workflow only)
  • tool_call — triggering tool call (Orchestrator only)
  • node_name — name of the HumanNode or gated node

Summary

Types

t()

@type t() :: %Jido.Composer.HITL.ApprovalRequest{
  agent_id: String.t() | nil,
  agent_module: module() | nil,
  allowed_responses: [atom()],
  created_at: DateTime.t(),
  id: String.t(),
  metadata: map(),
  node_name: String.t() | nil,
  prompt: String.t(),
  response_schema: keyword() | nil,
  timeout: pos_integer() | :infinity,
  timeout_outcome: atom(),
  tool_call: map() | nil,
  visible_context: map(),
  workflow_state: atom() | nil
}

Functions

new(attrs)

@spec new(keyword()) :: {:ok, t()} | {:error, String.t()}