Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dialogflow CX Playbook Stuck in OUTPUT_STATE_PENDING After API Invocation

Hi Everyone

I am working on a Dialogflow CX agent integrated with Twilio (WhatsApp). When I invoke a playbook via the Dialogflow CX API, the playbook transitions successfully but remains in the OUTPUT_STATE_PENDING state. Below are the steps I’ve taken, the observed behavior, and the specific issue I’m encountering.

What I Am Trying to Achieve

I want to use a playbook to handle customer requests for  services, process their location for pricing calculations, and respond with the relevant pricing details. The playbook should complete and return the correct output but it does not instead I am getting the below error:

mahambabp_0-1735287383377.png

Question

  • Why does the playbook remain in OUTPUT_STATE_PENDING even after valid invocation?
  • How can I ensure actionParameters are correctly populated during playbook invocation?

 

 

3 10 1,342
10 REPLIES 10

Hello,

I have the same problem since last week. I think it is a google problem because I work on my project since the 1/09 and conversation in playbook where always transfered with the playbook in pending status. Maybe they change a rule, I am stuck in the console but curiously it works on the widget. Also if un create a new agent with only one instruction to transfer playbook 1 on playbook 2, this does'nt work. And also the prebuilt agent made by google are not working anymore and have the same error message. So I'am waiting 🙂

Hi 

I merged all my playbooks as a temporary solve but meaning I cannot do handovers to another playbook(agent) while this issue is still pending.

Hi @mahambabp,

Welcome to Google Cloud Community!

I understand you're encountering an issue where your Dialogflow CX playbook remains in OUTPUT_STATE_PENDING despite successful invocation, and you're seeing the message "Playbook output should be empty for pending invocation of playbook." You also have questions about action parameter population.

The playbook might remain in OUTPUT_STATE_PENDING due to:

  1. Asynchronous Playbook Execution: Playbooks often involve asynchronous operations, such as making API calls to external services, waiting for data to be processed, etc. If your playbook relies on an external service and that service is slow or unresponsive, or if the playbook logic is not set up correctly to handle delays, it can remain in OUTPUT_STATE_PENDING indefinitely.
  2. Missing or Incorrect Action Parameters: If action parameters are not correctly passed to the playbook during invocation, it might fail to execute or get stuck. Your error message "Playbook output should be empty for pending invocation of playbook" seems to indicate that no output has been produced. This message is typically returned when you invoke a playbook that is configured to return output, and that output is not being produced, which can be due to missing action parameters.
  3. Playbook Configuration Issues: There may be configuration errors within your playbook itself, such as an infinite loop, a step that always fails, or incorrect access permissions to external resources.
  4. Dialogflow CX Integration Issues: Problems with the integration of Dialogflow CX with the playbooks (e.g., authentication, network issues between systems, incorrect API calls) can also cause it to get stuck. Check that your Dialogflow CX service account or API key has the appropriate permissions.
  5. Error Handling in Playbook: The playbook logic may have an uncaught exception which is preventing completion.

You may try these approaches to populate the action parameters: 

  1. Double-Check Parameter Names: Make absolutely sure that the names of the parameters you are passing in your actionParameters exactly match the parameters defined in your playbook. Case sensitivity is important. It is always useful to check this.
  2. Parameter Types: Verify that the data types of the action parameters you are passing match the expected types in your playbook definition. For example, if the playbook expects an integer, ensure you're not passing a string.
  3. Inspect Payload During Invocation: Inspect the actionParameters payload you're sending to the Dialogflow CX API to ensure all parameters and their values are correct. You can either log this data or use the debugging features in your chosen development environment or API tool.
  4. Test with Simple Parameters: Initially test with a simplified playbook (e.g., that returns a fixed string as output and uses a limited set of inputs/parameters). Start by passing hardcoded values to ensure the basic functionality is working. Once that’s stable, introduce more complex data or parameter handling gradually.
  5.  Use a Mock Service for Integration: If the issue is related to the external service your playbook is calling, create a mock service that returns predefined data. This helps to isolate if the issue is in the external service or the playbook logic.

Here are the troubleshooting steps that you may follow:

  1. Examine Playbook Logs: Check the logs associated with your playbook executions. These logs might provide clues about what is happening inside your playbook. Check for any errors, exceptions, or warnings.
  2. Debugging Tools: If possible, use any debugging tools that your playbook environment provides, such as tracers or debuggers, to step through the playbook's execution and identify the point of failure.
  3. Simplify the Playbook: If your playbook is complex, try simplifying it to narrow down the source of the problem. If the simplified playbook works, start adding elements back in to pinpoint the component causing the issue.
  4. Monitor API Calls: Monitor any API calls made by your playbook. Ensure that the requests are successful and that the data being returned matches what you are expecting.
  5. Check Dialogflow CX Documentation: Review the official documentation for Dialogflow CX and playbooks. Pay particular attention to any information about action parameter handling, output states, and asynchronous operations. Here are some documentation that you may find useful:

     6. Check Google Cloud Status Dashboard: Look for any reported incidents on the Google Cloud Status Dashboard related to Dialogflow or AI/ML services. 

     7. Contact GCP Support and Twilio Support: If none of the above steps help, contact Google Cloud Support and Twilio Support. They have better visibility into the underlying system and can assist you with specific issues. Also, I suggest filing a defect report. This way you could have visibility on the progress of your request as it is publicly available. Please note that I can't provide any details or timelines at this moment. For future updates, I suggest keeping an eye out on the issue tracker and release notes

Finally, here’s a similar case that you may check and may find useful.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

Hi

My Agent app was working fine before the update nothing was changed in terms of tools, webhooks and prompts, I suspect it was the console consolidation because everything worked fine before, I resorted to using one playbook now because if I do any handover to another playbook I get the same error.

Still have the same issue, has someone managed to solve it? It worked well until last week (1st week of January) and I have not modified anything

 

Hi , It still does'nt work  as a temporary work around I have bundled all prompts into one playbook until google fixes the bug becuase , day before the new update it was working fine.

This is working since this morning 🙂

Agree, it started working fine past wednesday 🙂 Thanks to both of you!

@ruthseki or anyone, any update if this bug is fixed? I am debating putting all instructions into one prompt but it still makes examples difficult with 'child' / 'parent' playbook error.  Any work arounds you have used @MarcVallcorba , @antho29 , @mahambabp ? Any help appreicated

yes the bug is fixed. Could you developp what's your problem ? What's the error message ?