I am facing an inconsistent behavior when integrating Playbooks and Flows with Datastore execution in a Conversational Agent.
Current production setup:
My production chatbot uses a single flow with a default welcome intent and standard routing. In this flow, the datastore is configured together with a custom payload to display the first knowledge search result, and a webhook is executed to return buttons with links to the documents retrieved from the storage bucket. This setup works correctly in production.
New requirement:
I needed to introduce a document filter to distinguish between two different knowledge bases: Course training documents and Expert books.
What was attempted:
-
I initially modified the webhook logic to handle multiple datastore IDs and dynamically decide which knowledge base to query based on the user conversation.
-
I then restructured the flow by adding a start page and specific pages per question. Although the conversation navigation worked, the datastore was no longer executed in the same way as in the production chatbot.
-
I attempted to reproduce the same behavior using a new agent with Playbooks. The idea was to route questions about courses or books to a secondary playbook that would call the datastore tool directly. This approach did not work.
-
I then tried a hybrid approach:
-
A Playbook introduces the conversation and asks the user which knowledge base they want to search.
-
Based on the answer, the Playbook redirects the conversation to a Flow.
-
This Flow is configured exactly the same as the production flow (datastore, custom payload, webhook).
-
Observed behavior:
-
The solution worked once during an initial test in the Toggle Simulator.
-
When tested in the standard integration chat (messenger), it did not work.
-
After that, the same configuration also stopped working in the Toggle Simulator.
-
The behavior became inconsistent and non-deterministic.
The Playbook only redirects to the Flow. Inside the Flow, I adjusted the welcome intent to closely match the production chatbot behavior. All configurations were kept the same.
As a troubleshooting attempt, I added an “end flow” transition in the datastore step to return control to the Playbook, but this change did not resolve the issue. The problem also occurred before this modification.
Expected behavior:
The Flow triggered by the Playbook should execute the datastore in the same way as the production chatbot, returning consistent knowledge results and webhook responses.
Actual behavior:
When the Flow is triggered via Playbook redirection, the datastore does not execute as expected, even though the configuration is identical to the production setup.
At this point, I am unable to identify what differs internally between the working production Flow and the Flow invoked by the Playbook, and why the datastore execution behaves inconsistently across environments. Can someone, please, help me?