Check queue availability when a conversation is received

In this example, we'll check if the destination queue of the conversation is closed or has no serving agents. In this case, we'll transfer the conversation to an overflow queue.

Queue availability check is supported for all channel types but this example is for chat.

For this integration, you'll need to configure the following:

  • Endpoint URL: edi://echo
  • Conversation Direction: You can only use this example for inbound conversations.
  • Events: Received
  • Queues: Use the destination queue of the conversation.
  • JSON for Configuration:

    To set the queue for the conversation as chat.overflow@sap.com if the destination queue of the conversation is either closed or has no serving agents:

    {
      "request": {
        "condition": "queue.is_available() is False  # move to overflow queue if primary queue is closed, or there are no serving agents",
        "method": "POST",
        "body": {
          "address": "chat.overflow@acme.com"
        }
      },
      "response": {
        "set": {
          "queue": {
            "address": "{response.body.content.address}"
          }
        }
      }
    }

    To use the service time schedule of another queue and set the queue for the conversation as chat.overflow@sap.com if the other queue is closed:

    {
      "request": {
        "condition": "queue.is_open('schedule@internal') is False  # move to overflow queue if service schedule queue is closed",
        "method": "POST",
        "body": {
          "address": "chat.overflow@acme.com"
        }
      },
      "response": {
        "set": {
          "queue": {
            "address": "{response.body.content.address}"
          }
        }
      }
    }