test_case_id: "simple_workflow_two_nodes_001"
description: "Tests a simple 2-node workflow where Peer A processes input and Peer B processes A's output"
tags: ["all", "workflows"]
skip_intermediate_events: true
expected_completion_timeout_seconds: 20

test_runner_config_overrides:
  agent_config:
    artifact_scope: "namespace"

gateway_input:
  target_agent_name: "SimpleTestWorkflow"
  user_identity: "workflow_test_user@example.com"
  external_context:
    a2a_session_id: "workflow_test_session"
  parts:
    - type: "data"
      data:
        input_text: "Process this test data"

llm_interactions:
  # Step 1: TestPeerAgentA receives the workflow input
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: |
              «««save_artifact: filename="step1_output.json" mime_type="application/json" description="Output from step 1"
              {"processed": "Step 1 completed", "data": "processed_data"}
              »»»
    expected_request:
      tools_present: ["load_artifact"]

  # Step 2: System processes the fenced block and injects _notify_artifact_save
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "Step 1 output has been saved. «result:artifact=step1_output.json:0 status=success»"
    expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_name: "_notify_artifact_save"
          response_json_matches:
            filename: "step1_output.json"
            status: "success"

  # Step 3: TestPeerAgentB receives the task
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: |
              «««save_artifact: filename="step2_output.json" mime_type="application/json" description="Final workflow output"
              {"final_result": "Workflow completed successfully"}
              »»»
    expected_request:
      tools_present: ["load_artifact"]

  # Step 4: System processes the fenced block for step 2
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "Step 2 output has been saved. Workflow complete. «result:artifact=step2_output.json:0 status=success»"
    expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_name: "_notify_artifact_save"
          response_json_matches:
            filename: "step2_output.json"
            status: "success"

expected_gateway_output:
  - type: "final_response"
    task_state: "completed"
