Skip to content

ConnectParticipantWithLexBot immediately returns NoMatchingError without calling Lex bot

0

I'm trying to integrate Amazon Lex V2 with Amazon Connect using ConnectParticipantWithLexBot in my contact flow JSON, but it immediately returns NoMatchingError without ever calling the Lex bot. Environment:

Amazon Connect instance region: ap-northeast-1 (Tokyo) Lex V2 bot alias ARN: arn:aws:lex:ap-northeast-1:YOUR-ACCOUNT-ID:bot-alias/YOUR-BOT-ID/YOUR-ALIAS-ID

What I've confirmed:

Lex bot works correctly when called directly via recognize_text API Lex bot is associated with the Connect instance (visible in Console > Flows > Amazon Lex section) Resource policy on the bot alias allows connect.amazonaws.com to call lex:RecognizeText, lex:RecognizeUtterance, lex:StartConversation Tested with both prod alias and TestBotAlias - same result Contact Lens is enabled on the instance Flow logs are enabled but NO logs are written to CloudWatch at all when the block executes The block returns NoMatchingError instantly (less than 1 second) This is a voice call (not chat)

Contact flow block: json{ "Parameters": { "Text": "Please go ahead.", "LexV2Bot": { "AliasArn": "arn:aws:lex:ap-northeast-1:YOUR-ACCOUNT-ID:bot-alias/YOUR-BOT-ID/YOUR-ALIAS-ID" } }, "Identifier": "ai-listen", "Type": "ConnectParticipantWithLexBot", "Transitions": { "NextAction": "farewell", "Errors": [ {"NextAction": "farewell", "ErrorType": "NoMatchingError"} ] } } Has anyone experienced this? Is there any additional configuration required for ConnectParticipantWithLexBot to work on voice calls in Tokyo region?

  • If my answer was helpful, I would appreciate it if you could mark it as the accepted answer.

2 Answers
1

To supplement the existing answer, an immediate NoMatchingError (under 1 second) with zero CloudWatch logs for the Lex execution means the initialization failed on the Amazon Connect side before the bot was ever invoked.

As far as I understand, the two most common technical reasons for this specific behavior are:

1. Language/Locale Mismatch (Most Common)

Amazon Connect automatically passes the currently active flow language to Amazon Lex. Lex V2 strictly requires that the requested language matches an available language model in your Bot Alias (e.g., en-US or ja-JP).

  • The Fix: Add a Set voice block immediately before your Lex block. Select the exact language your Lex bot uses and ensure you check the Set language attribute box.

2. Incomplete JSON Schema (Missing Conditions & Errors)

When defining contact flows via JSON, the schema is extremely strict. The JSON snippet you provided is missing required routing parameters:

  • Missing Intents (Conditions): You must define which Lex intents this block should listen for in the Conditions array.
  • Missing Mandatory Errors: The schema requires you to handle InputTimeLimitExceeded and NoMatchingCondition alongside NoMatchingError. Without these, the flow parser fails the block validation instantly.

Here is the structurally correct JSON format for the ConnectParticipantWithLexBot action:

{ 
  "Parameters": { 
    "Text": "Please go ahead.", 
    "LexV2Bot": { 
      "AliasArn": "arn:aws:lex:ap-northeast-1:YOUR-ACCOUNT-ID:bot-alias/YOUR-BOT-ID/YOUR-ALIAS-ID" 
    } 
  }, 
  "Identifier": "ai-listen", 
  "Type": "ConnectParticipantWithLexBot", 
  "Transitions": { 
    "NextAction": "default-success-action", 
    "Conditions": [
      {
        "Condition": {
          "Operator": "Equals",
          "Operands": ["NameOfYourLexIntent"]
        },
        "NextAction": "action-for-this-intent"
      }
    ],
    "Errors": [ 
      {"NextAction": "farewell", "ErrorType": "InputTimeLimitExceeded"}, 
      {"NextAction": "farewell", "ErrorType": "NoMatchingCondition"}, 
      {"NextAction": "farewell", "ErrorType": "NoMatchingError"} 
    ] 
  } 
}
EXPERT
answered 8 days ago
0

Based on the configuration you've described, there are several potential causes for the immediate NoMatchingError without the Lex bot being invoked:

Missing Timeout Configuration: The ConnectParticipantWithLexBot action supports a LexTimeoutSeconds parameter that specifies how long to wait for customer input. Without this parameter, the system may not be waiting for voice input at all. Try adding:

"LexTimeoutSeconds": {
"Text": "300"
}

This tells the system to wait up to 300 seconds for customer input before timing out.

DTMF Input Consideration: For voice calls, if customers provide DTMF (touch-tone) input to a Lex bot, the input is made available as a Lex request attribute. However, there can be setup time between flow blocks, which might result in dropped digits if input is provided too quickly. Ensure customers wait for the prompt to complete before providing input.

Error Type Handling: The NoMatchingError error type is one of several supported error conditions for this action. The others include InputTimeLimitExceeded and NoMatchingCondition. Make sure you're handling all relevant error scenarios in your flow transitions.

Regional Considerations: While the action itself is supported across all channels and regions where Amazon Connect is available, verify that your Lex V2 bot is fully deployed and active in the ap-northeast-1 region, and that there are no service-specific limitations in that region.

Prompt Configuration: Consider whether the prompt is being played successfully before attempting to collect input. You might want to test with a PromptId instead of inline Text to ensure the audio is properly configured.

Since flow logs aren't being written to CloudWatch, this suggests the block may be failing before it fully executes. Double-check that your Connect instance has the necessary IAM permissions to invoke Lex bots, beyond just the resource policy on the bot itself.
Sources
ConnectParticipantWithLexBot - Amazon Connect
Flow block in Connect Customer: Get customer input - Amazon Connect Customer Customer

answered 8 days ago
  • Thank you so much for your response. Your suggestion was very helpful and I truly appreciate you taking the time to answer. Based on your advice, I placed the "Set voice" block immediately before the "Get customer input (Lex)" block. However, the issue persists — the ConnectParticipantWithLexBot action still returns NoMatchingError instantly without ever invoking the Lex bot. Here is what I have confirmed so far:

    The Lex V2 bot is Built and Available (ja_JP locale, version 4) The alias ARN is correct and points to the built version Lambda code hooks are disabled on both the bot and alias The resource policy on the Lex bot allows Amazon Connect to invoke it The contact flow deploys successfully via CLI with no errors

    What I am still struggling with is understanding what the "Set language attribute" checkbox in the Set voice block actually adds to the contact flow JSON. I cannot find any corresponding parameter in the Actions section when deploying via CLI. The Metadata section contains languageCode, but as far as I can tell, Metadata does not affect runtime behavior. Is there something specific that the "Set language attribute" option adds at the Actions level that is required for Connect to successfully establish a Lex V2 session? Any further guidance would be greatly appreciated.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.