In this workflow, you'll learn how to create a conditional flow based on agent availability to check if a message was received when agents were offline. While the bot builder can verify if a message arrived during business hours, it doesn't automatically detect agent availability. To achieve this, you'll need a custom solution with some additional configuration.

The workflow includes the steps below.

  • Step 1: Create a bearer token
  • Step 2: Create an API connection
  • Step 3: Create a conditional statement in the bot builder

Step 1: Create a bearer token

Create a bearer token for the Zendesk Chat API by following the steps in the article: Chat API tutorial: Generating an OAuth token.

Step 2: Create an API connection

Create an API connection by following these steps:

  1. Select the option Bearer token and enter the token created in step 1.
  2. Enter the allowed domain value: rtm.zopim.com

Step 3: Create a conditional statement in the bot builder

  1. In Admin Center, navigate to AI agents automation > Conversation bots and select your bot
  2. Under the selected bot, choose the answer intent.
  3. Add the HTTP API call step with details:
    • GET
    • Enter the Endpoint URL:https://rtm.zopim.com/stream/agents/agents_online
    • Under Authentication, select the connection created in Step 2
    • Click on Make an API call to test the call and return status code 200
    • Under the Variable tab, select Open content, then Data
    • In Data, you will see agent_online. Click Save adjacent to this and save the variable as is Zendesk creates a variable as agent_onlinewhich is utilized in the next step
  4. Under API Successful flow, create a conditional step with options Online and Else.
  5. Open the Conditional step, and under Options configure the option as Online.
  6. Add the condition: agent_online IS NOT 0
  7. Save and publish the bot.

You have successfully created a condition in your bot to check if agents are available.

Note: The real-time API used above is available to Enterprise plans.
This article describes functionality available only to customers who had a drafted or published AI agent as of February 2, 2025. For information about equivalent functionality in the AI agents - Advanced add-on, see Building dialogues for AI agents - Advanced.
Powered by Zendesk