test_case_id: "map_workflow_001"
description: "Tests a map workflow that iterates over a list of items"
tags: ["all", "workflows", "map"]
skip_intermediate_events: true
expected_completion_timeout_seconds: 60

test_runner_config_overrides:
  agent_config:
    artifact_scope: "namespace"

gateway_input:
  target_agent_name: "MapTestWorkflow"
  user_identity: "workflow_test_user@example.com"
  external_context:
    a2a_session_id: "map_test_session"
  parts:
    - type: "data"
      data:
        items: ["item_a", "item_b"]

llm_interactions:
  # Iteration 1: Process first item
  # Note: Map iterations may run in parallel, order is not guaranteed
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: |
              «««save_artifact: filename="item_0_output.json" mime_type="application/json" description="Processed item"
              {"processed_item": "item_a", "index": 0, "status": "processed"}
              »»»

  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "Item processed. «result:artifact=item_0_output.json:0 status=success»"

  # Iteration 2: Process second item
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: |
              «««save_artifact: filename="item_1_output.json" mime_type="application/json" description="Processed item"
              {"processed_item": "item_b", "index": 1, "status": "processed"}
              »»»

  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "Item processed. «result:artifact=item_1_output.json:0 status=success»"

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