{
  "name": "conductor_agent_human_in_loop",
  "version": 1,
  "schemaVersion": 2,
  "description": "Framework-agnostic Conductor Agents recipe: an AGENT task pauses (WAITING -> COMPLETED with waiting=true and a pendingTool question), a HUMAN task collects the answer, and a second AGENT task resumes the same run with its executionId.",
  "timeoutSeconds": 3600,
  "timeoutPolicy": "TIME_OUT_WF",
  "tasks": [
    {
      "name": "run_agent",
      "taskReferenceName": "run_agent_ref",
      "type": "AGENT",
      "inputParameters": {
        "agentType": "conductor",
        "name": "planner",
        "prompt": "${workflow.input.prompt}",
        "maxDurationSeconds": 900
      }
    },
    {
      "name": "check_waiting",
      "taskReferenceName": "check_waiting_ref",
      "type": "SWITCH",
      "evaluatorType": "value-param",
      "expression": "waiting",
      "inputParameters": { "waiting": "${run_agent_ref.output.waiting}" },
      "decisionCases": {
        "true": [
          {
            "name": "collect_answer",
            "taskReferenceName": "collect_answer_ref",
            "type": "HUMAN"
          },
          {
            "name": "resume_agent",
            "taskReferenceName": "resume_agent_ref",
            "type": "AGENT",
            "inputParameters": {
              "agentType": "conductor",
              "name": "planner",
              "executionId": "${run_agent_ref.output.executionId}",
              "prompt": "${collect_answer_ref.output.answer}",
              "maxDurationSeconds": 900
            }
          }
        ]
      },
      "defaultCase": []
    }
  ]
}
