Hi Charles,
Your design pattern actually makes a lot of sense operationally, especially for seasonal/temporarily disabled products where you want to preserve the NLU structure without constantly modifying intents and routing logic.
Regarding Session.LastCompletedIntent, from what I have seen in Digital Bot Flows, the behavior can be a bit inconsistent depending on where in the flow lifecycle you attempt to access it.
One important detail:
Ask for Intent identifies the matched intent, but Session.LastCompletedIntent is generally populated only after the intent/task execution lifecycle completes successfully.
So if you attempt to read it:
-
immediately after the Ask for Intent
-
before the intent task finishes
-
or inside the same conversational branch
it may still be blank.
Operationally, what worked more reliably for us was:
-
capturing the matched intent immediately after Ask for Intent
-
storing it explicitly in a flow variable
-
then using that variable downstream for centralized routing/availability logic
For example:
Ask For Intent
→ matched intent
→ Set Variable: Flow.ActiveIntent
→ centralized "availability validation" task
→ route or gracefully reject
Instead of relying on:
Session.LastCompletedIntent
as the authoritative source.
This pattern also tends to scale better because it gives you deterministic control over:
We implemented something very similar using a centralized availability table/API:
{
"intent": "SeasonalSaver",
"enabled": false,
"message": "This product is currently unavailable."
}
Then the bot flow simply:
without touching the underlying NLU configuration.
That avoided:
-
deleting intents
-
retraining
-
duplicated flows
-
seasonal redeployments
Another advantage:
this approach works very well with external configuration management because business users can toggle availability without modifying Architect directly.
So short answer:
I would probably avoid depending exclusively on Session.LastCompletedIntent for this pattern and instead persist the matched intent explicitly into your own flow variable immediately after intent resolution.
------------------------------
Gabriel Garcia
NA
------------------------------