warren_chan
ServiceNow Employee
ServiceNow Employee

This article shows a multi-turn conversation where the External Agent (A2A client) asks the ServiceNow AI agent (A2A server) to find a place to stay in Ibiza, Spain. The ServiceNow AI agent returns a list of available options and asks the External Agent (A2A client) if they would like to view any details of a property listing. The External Agent (A2A client) replies with '7', and the ServiceNow agent responds with the property’s details.

 

Requirements:

  • A2A client is communicating over Google A2A 0.3.0 specification
  • ServiceNow instance is running Now Assist AI Agents 6.0.x+ (December 2025 release)
  • This example assumes the A2A server is running in synchronous communication mode. For asynchronous communication, include the pushNotificationConfig block in the configuration block, like this:
"params": {
      "configuration": {
        "pushNotificationConfig": {
          "url": "callback_url"
        },
        "acceptedOutputModes": [
          "application/json"
        ],
        "historyLength": 0
      },

 

Step 1 — Client Request (Find a place to stay in Ibiza, Spain)

{
  "payload": {
    "jsonrpc": "2.0",
    "method": "message/send",
    "params": {
      "configuration": {
        "acceptedOutputModes": [
          "application/json"
        ],
        "historyLength": 0
      },
      "message": {
        "role": "user",
        "kind": "message",
        "parts": [
          {
            "kind": "text",
            "text": "Find a place to stay in Ibiza, Spain."
          }
        ],
        "messageId": "<MESSAGE_ID_001>",
        "contextId": null,
        "taskId": null
      },
      "metadata": {}
    },
    "id": "<REQUEST_ID_001>"
  },
  "headers": {
    "Content-Type": "application/json",
    "x-sn-apikey": "<your ServiceNow A2A server API key>"
  },
  "endpoint": "https://<your ServiceNow instance name>.service-now.com/api/sn_aia/a2a/v1/agent/id/<your ServiceNow AI Agent ID>"
}

 

Step 2 — Server Response (List of places)

{
  "content": {
    "jsonrpc": "2.0",
    "id": "<REQUEST_ID_001>",
    "result": {
      "status": {
        "state": "input-required",
        "message": {
          "contextId": "<CONTEXT_ID_001>",
          "kind": "message",
          "messageId": "<MESSAGE_ID_002>",
          "parts": [
            {
              "kind": "text",
              "text": "Here are several Airbnb listings available in Ibiza Spain with details on dates bedrooms beds ratings and prices for a 5-night stay 1 Amazing Villa Privacy and Sea View offers 6 bedrooms and 6 beds available Dec 17 – 22 rated 4.86 with 63 reviews priced at $339 total https://www.airbnb.com/rooms/11784527 2 Cala Vadella beachfront studio with 3 beds available Jan 6 – 11 rated 4.84 with 311 reviews priced at $690 total https://www.airbnb.com/rooms/761926 3 Country House with Sea View featuring 2 bedrooms and 5 beds available Jan 4 – 9 rated 4.96 with 180 reviews priced at $1,693 total https://www.airbnb.com/rooms/1128846 4 Cozy with a terrace in DaltVila has 1 bedroom and 1 double bed available Dec 17 – 22 rated 4.59 with 59 reviews priced at $433 total originally $489 https://www.airbnb.com/rooms/1121686487780475455 5 IBIZA BELLA VISTA The holiday paradise Wlan Pool offers 2 bedrooms and 2 king beds available Jan 4 – 9 rated 4.95 with 58 reviews priced at $1,392 total https://www.airbnb.com/rooms/45458536 6 Casaklod ibiza center close to the beach with 3 bedrooms and 3 beds available Dec 18 – 23 rated 4.87 with 126 reviews priced at $2,063 total https://www.airbnb.com/rooms/17166918 7 Casa Susana 2 double bedrooms 2 pools chill has 2 bedrooms and 3 beds available Jan 8 – 13 rated 4.9 with 42 reviews priced at $921 total https://www.airbnb.com/rooms/1217457295910758470 8 Casa Muscari Ibiza Rooftop Design Art Plants includes 1 bedroom and 1 double bed available Mar 13 – 18 rated 5.0 with 26 reviews priced at $698 total https://www.airbnb.com/rooms/856417956609375051 9 Boho Luxury Villa with Private Pool and Sea Views offers 4 bedrooms and 4 double beds available Dec 17 – 22 rated 5.0 with 29 reviews priced at $1,534 total originally $3,161 https://www.airbnb.com/rooms/1374848170457358609 10 Villa with heated pool 5 minutes from Ibiza has 2 bedrooms and 3 beds available Jan 3 – 8 rated 5.0 with 54 reviews priced at $1,197 total originally $1,450 https://www.airbnb.com/rooms/890988087808261425 11 Can Roser with amazing views Santa Gertrudis features 4 bedrooms and 7 beds available Feb 6 – 11 rated 4.97 with 33 reviews priced at $2,030 total https://www.airbnb.com/rooms/782610077760255000 12 Living in the heart of Ibiza includes 1 bedroom and 1 bed available Dec 17 – 22 rated 4.87 with 23 reviews priced at $866 total https://www.airbnb.com/rooms/1388391053316702451 13 Apartment with balcony has 1 bedroom and 3 beds available Jan 10 – 15 rated 4.83 with 47 reviews priced at $517 total https://www.airbnb.com/rooms/53854382 14 Appartement Can Nenas offers 1 bedroom and 2 beds available Mar 27 – Apr 1 rated 4.98 with 94 reviews priced at $1,930 total originally $2,288 https://www.airbnb.com/rooms/894991473848545980 15 Luxurious Apartment in Ibiza with 2 bedrooms and 3 beds available Dec 18 – 23 rated 4.84 with 56 reviews priced at $881 total https://www.airbnb.com/rooms/755092197793218446 16 Apartment in Dalt Vila with a terrace and views of the harbor has 2 bedrooms and 2 double beds available Mar 1 – 6 rated 4.93 with 95 reviews priced at $1,693 total https://www.airbnb.com/rooms/34810376 17 Large Tropical Villa Pool Near Bossa Ibiza featuring 8 bedrooms and 14 beds available Dec 18 – 23 is a new place to stay priced at $9,839 total https://www.airbnb.com/rooms/1575369409555675952 18 Quiet apartment in Santa Gertrudis includes 1 bedroom and 3 beds available Jan 3 – 8 rated 4.94 with 181 reviews priced at $1,057 total https://www.airbnb.com/rooms/26804357 For more options visit https://www.airbnb.com/s/Ibiza%2C%20Spain/homes?adults=1&children=0&infants=0&pets=0"
            },
            {
              "kind": "text",
              "text": "You have a list of Airbnb options in Ibiza, Spain, including details such as bedrooms, beds, ratings, and prices. Would you like to view more details about any specific listing? If so, please specify the listing number or name from the list provided."
            },
            {
              "kind": "text",
              "text": ""
            }
          ],
          "referenceTaskIds": [
            "<TASK_ID_001>"
          ],
          "role": "agent",
          "taskId": "<TASK_ID_001>"
        },
        "timestamp": "2025-12-17T19:51:33.395Z"
      },
      "id": "<REQUEST_ID_001>",
      "kind": "task",
      "contextId": "<CONTEXT_ID_001>",
      "metadata": {
        "provider": "default-external-agent"
      }
    }
  },
  "status_code": 200,
  "error": null,
  "timestamp": "2025-12-17T19:50:39.995Z"

 

Step 3 — Client Request (Select listing #7)

{
  "payload": {
    "jsonrpc": "2.0",
    "method": "message/send",
    "params": {
      "configuration": {
        "acceptedOutputModes": [
          "application/json"
        ],
        "historyLength": 0
      },
      "message": {
        "role": "user",
        "kind": "message",
        "parts": [
          {
            "kind": "text",
            "text": "Tell me more about #7"
          }
        ],
        "messageId": "<MESSAGE_ID_003>",
        "contextId": "<CONTEXT_ID_001>",
        "taskId": "<TASK_ID_001>"
      },
      "metadata": {}
    },
    "id": "<REQUEST_ID_001>"
  },
  "headers": {
    "Content-Type": "application/json",
    "x-sn-apikey": "<your ServiceNow A2A server API key>"
  },
  "endpoint": "https://<your ServiceNow instance name>.service-now.com/api/sn_aia/a2a/v1/agent/id/<your ServiceNow AI Agent ID>"
}

 

Step 4 — Server Response (Details of listing #7)

{
  "content": {
    "jsonrpc": "2.0",
    "id": "<REQUEST_ID_001>",
    "result": {
      "status": {
        "state": "input-required",
        "message": {
          "contextId": "<CONTEXT_ID_001>",
          "kind": "message",
          "messageId": "<MESSAGE_ID_004>",
          "parts": [
            {
              "kind": "text",
              "text": "This Ibizan house is a 75 m2 duplex located in Cala Llonga, Illes Balears, Spain, just a 5-minute walk from Cala Llonga beach and 10 minutes from the port of Ibiza and downtown Santa Eulalia The house features Nordic/industrial decoration with designer furniture and has been recently renovated It includes 2 terraces, 2 double bedrooms, 1 bathroom, and a large living room with kitchen and dining area with a fireplace."
            },
            {
              "kind": "text",
              "text": "You have just reviewed the details for Casa Susana (listing #7) in Ibiza, Spain. Would you like to view more details about another Airbnb listing from the list, or are you done viewing listings? Please reply with the listing number or name if you want to see another, or let me know if you are finished."
            },
            {
              "kind": "text",
              "text": ""
            }
          ],
          "referenceTaskIds": [
            "<TASK_ID_001>"
          ],
          "role": "agent",
          "taskId": "<TASK_ID_001>"
        },
        "timestamp": "2025-12-17T19:59:16.671Z"
      },
      "id": "<REQUEST_ID_001>",
      "kind": "task",
      "contextId": "<CONTEXT_ID_001>",
      "metadata": {
        "provider": "default-external-agent"
      }
    }
  },
  "status_code": 200,
  "error": null,
  "timestamp": "2025-12-17T19:58:40.606Z"
}

 

Version history
Last update:
2 hours ago
Updated by:
Contributors