Async processing in Flows for APEX 26.1

 


In my previous post, I showcased adhoc sub processes with my demo app "IT-Support". What I didn't mention is that this app also uses another feature of 26.1: Async processing*. The task "Search Knowledge Base" calls a LLM that returns a decision used by the exclusive gateway. With "async before" turned off, the end user would have to wait until the LLM has returned with a response. This might take longer then 3 seconds, after which the user starts to suspect the app isn't working correctly. After submitting a ticket to the IT help desk, we need to immediately return control to the user again. This is exactly what happens when "async before" is turned on. Technically, the LLM call is now handled by a database job.

Turning this feature on might require you to handle a new state the application is in. Before async processing, there was "before the LLM gets called" and "after the LLM returned a response", now you have "the LLM is being asked for" for a couple of seconds. So in my case, when users immediately want to start activities in the adhoc sub process, it may not have reached this state because Flows for APEX is still awaiting a response from the LLM. To prevent users from seeing the activities region when navigating to page 3 "Ticket Details", I added a server-sided condition that checks if the process instance is currently at the adhoc sub process:

select 1
  from flow_subflows_vw
 where sbfl_prcs_id = :PROCESS_ID
   and sbfl_id = :SUBFLOW_ID
   and sbfl_status = 'in adhoc subprocess'

More information about this feature can be found in the documentation.


*) Async processing is part of Flows for APEX 26.1 Enterprise Edition and requires licensing. See flowquest.net for more information about the Enterprise Edition.

Comments

Popular posts from this blog

Software Development Lifecycle with Oracle APEX

From Low-Code to Low-AI-Code.

Getting up to speed with Oracle Application Express (Oracle APEX)