Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Session.LastCompletedIntent - Empty or Not_Set

    Posted 13 days ago

    HI!

    Within our digital bot flow i've been looking to use the Session.LastCompletedIntent however am running into issues with it returning as blank, despite the intent being triggered via an Ask For Intent action. 

    Has anyone used this variable successfully and could provide some guidance?

    We're implementing a pattern in our bot/virtual assistant to preserve intent scripting while still handling seasonal or temporarily unavailable products gracefully.

    Some intents represent products or services that are only available at certain times of year (or are periodically paused). For example:

    • A Seasonal Saver account offered only during a campaign window
    • A limited-time product that may return later
    • A feature rollout that's disabled while fixes or compliance checks happen

    When a product is unavailable, we don't want to:

    • delete the intent
    • rework the dialogue flow repeatedly throughout the year
    • duplicate logic across multiple intents

    Instead, we want to keep the intent intact and simply toggle availability on/off, allowing the bot to exit politely when it's not in use.

    This would ideally be achieved by having a centralised task which handles all inactive intents, and uses the active intent to identify which path should be taken in the subsequent inactive task.

    Thanks!


    #Architect

    ------------------------------
    Charles Pugh
    tbc
    ------------------------------


  • 2.  RE: Session.LastCompletedIntent - Empty or Not_Set

    Posted 13 days ago

    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:

    • feature flags

    • seasonal enablement

    • temporary maintenance windows

    • compliance pauses

    • phased rollouts

    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:

    • checks the intent

    • validates availability

    • either continues normally

    • or exits gracefully

    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
    ------------------------------



  • 3.  RE: Session.LastCompletedIntent - Empty or Not_Set

    Posted 8 days ago

    Hi Gabriel! Thank you so much for your detailed response, its much appreciated. 

    I also came to the exact same conclusion as you and created a table to manage our intents and easily toggle them on or off as required. 

    How are you capturing the intent after the ask for intent? Is this a hardcoded variable dependent on the task that's triggered e.g having an update data action at the beginning of the triggered task to write to a variable or some other method?

    Kind regards



    ------------------------------
    Charles Pugh
    tbc
    ------------------------------



  • 4.  RE: Session.LastCompletedIntent - Empty or Not_Set

    Posted 11 hours ago

    Hi Gabriel! Are you able to provide some further info on your flow?



    ------------------------------
    Charles Pugh
    tbc
    ------------------------------