web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - Topic Creation & Management
Suggested Answer

Error: This agent is currently unavailable. It has reached its usage limit. Please try again later.

(3) ShareShare
ReportReport
Posted on by 18

I’m encountering an issue where my website displays the message:

“Agent is currently unavailable. It has reached its limit.”

However, when I test the same flow in Copilot Studio, it works perfectly fine.

At the start of my flow, I’m trying to send an input value from my Angular code into one of three variables (any of them would be acceptable). The problem is that the agent isn’t accepting the input directly — whenever I try to enter or send the value (For testing), it returns the same “agent unavailable” message.

I need to pass a user token to the agent for the second-step authentication process.
I’ve tried three different methods to pass this token, but none of them have worked successfully.

Could you please let me know:
  • If there are any other possible ways to pass the user token to the agent directly to the agent?

  • Or if there’s any mistake in my implementation (either in the Angular code or in the agent configuration)?


My Flow



My Angular Code
 
createCustomStore() {
    return window.WebChat.createStore(
      {},
      ({ dispatch }: any) =>
        (next: any) =>
        (action: any) => {
          if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') {
            dispatch({
              type: 'DIRECT_LINE/POST_ACTIVITY',
              meta: { method: 'keyboard' },
              payload: {
                activity: {
                  channelData: { postBack: true },
                  name: 'startConversation',
                  type: 'event',
                  channelId: this.userToken,
                },
              },
            });
 
            dispatch({
              type: "WEB_CHAT/SEND_EVENT",
              payload: {
                name: "pvaSetContext",
                value: {
                  "token": this.userToken
                }
              },
            });
          }
          return next(action);
        }
    );
  }
  renderWebChat(token: string): void {
    try {
      const directLine = window.WebChat.createDirectLine({
        token: token,
      });
 
      this.webChatInstance = window.WebChat.renderWebChat(
        {
          directLine,
          styleOptions: this.styleOptions,
          store: this.createCustomStore(),
          userID: this.userToken,
        },
        this.webchatContainer.nativeElement
      );
 
      this.isReady = true;
      console.log('WebChat rendered successfully');
 
    } catch (err) {
      console.error('Failed to render WebChat:', err);
    }
  }
 
As
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    52,569 Super User 2025 Season 2 on at
    Error: This agent is currently unavailable. It has reached its usage limit. Please try again later.
     
    Without digging into your licenses, your plan etc the #1 reason something works in the Tester but NOT in the actual Channel is because the Tester is free.
     
    Once you deploy it it stats consuming messages.
     
    So you have to make sure that you have a Pay as you Go Plan or have purchased a Message Bundle and have allocated etc and in that environment bla bla licenses..
     
    Do you have that configured?

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • KM-14101522-0 Profile Picture
    18 on at
    Error: This agent is currently unavailable. It has reached its usage limit. Please try again later.
    Hi @KM-14101522-0

    I have pay as you go plan 
  • Michael E. Gernaey Profile Picture
    52,569 Super User 2025 Season 2 on at
    Error: This agent is currently unavailable. It has reached its usage limit. Please try again later.
     
    Can you share a picture under your billing plan.
     
    Verify that you added the correct environment and make sure its NOT the default environment

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 304 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 224 Super User 2025 Season 2

#3
Sam_Fawzi Profile Picture

Sam_Fawzi 78 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics