version: v1

# Graph workflow with a human-approval node (0.12.0 § D). A `kind=human` graph
# node pauses the traversal: the run returns a `blocked` result and persists a
# continuation, resumable with the reviewer's response. The human node's output
# routes the branch — approve → publish, reject → archive — via edge conditions.
# Non-human nodes use canned functions so the example runs end-to-end without a
# provider; retarget them before any real use.

agent:
  name: graph-approval-root
  system_prompt: Root agent for the graph approval workflow.
  model:
    provider: openai
    name: gpt-4o-mini
  strategy:
    type: simple
  runtime_preferences:
    preferred_mode: bridge
    allowed_modes: [bridge]

workflow:
  type: graph
  name: graph-approval-workflow
  start: draft
  max_steps: 10
  nodes:
    draft: {id: draft, kind: function, ref: draft_report}
    approve: {id: approve, kind: human, ref: approval-reviewer}
    publish: {id: publish, kind: function, ref: publish_report}
    archive: {id: archive, kind: function, ref: archive_rejected}
  edges:
    - from: draft
      to: approve
    - from: approve
      to: archive
      condition: {type: output_contains, value: "Rejected by human reviewer"}
    - from: approve
      to: publish

components:
  functions:
    draft_report:
      implementation: examples.human_functions.draft_report
    publish_report:
      implementation: examples.human_functions.publish_report
    archive_rejected:
      implementation: examples.human_functions.archive_rejected
  humans:
    approval-reviewer:
      description: Please approve or reject the draft report.
      assignee: reviewer@example.com
      timeout_seconds: 86400
      on_timeout: escalate
