Handling Asynchronous calls from Appian

Certified Senior Developer

Hi, 

For handling asynchronous calls from Appian, I have analyzed below approaches. Can you pls advise which approach would be suitable for below scenario? If you have any better solution, kindly let me know.

Thank you in advance.

Design summary:

1- Orchestration is carried out in Appian process model. There are three external APIs (Say A, B and C) that need to be invoked from Appian.

2- After calling API-A, Appian will hold the process flow

3- Once Appian receives response for API-A asynchronously, then it should move on next step

4- Same pattern follows for API- B and API-C

 We have following solutions to accomplish this Asynchronous communication pattern.

Solution-1:

  • After invoking API-A at step#1 , flow moves to User input task to hold the process at Step#2
  • Response payload for the above call will be published to KAFKA topic at Step#3 from upstream system ( system for API A)
  • Custom message listener ( JAVA based component ) will pick the response message from KAFKA topic at step#4 and will call Appian exposed API over http at step#5
  • Once Appian receives the response payload from step#5, it will retrieve active task Id using process ID using Appian inbuilt function (getactivetaskidsforprocess())to close the User input task at step#6
  • Appian flow will move on to next step at step#7
  • This pattern will continue for API-B & API-C

Disadvantage:

  • Appian function getactivetaskidsforprocess() may return multiple active task Ids for a process instance. Identifying the task id for the user input task and completing it would be difficult.
  • This approach is a workaround solution to implement Asynchronous communication. User input tasks is used for any human intervention but here this activity is used to hold process flow

Solution-2:

  • After invoking API-A at step#1, flow moves to Receive message event to hold the process flow at Step#2
  • Response payload for the above call will be published to KAFKA topic from upstream system (system for API A) at Step#3
  • Custom message listener (JAVA based component) will pick the response message from KAFKA topic at step# 4 and will call Appian exposed API via http at step#5
  • Once Appian receives the response payload from step#5, it will send the response to receive message event through send message event step# 6 to release the process
  • Appian flow will move on to next step at step#7

 Disadvantage:

  • Receive message events listen/poll for messages continuously which occupies the memory all the time and this eventually has impact on performance. This behavior can potentially cause slowness.
  • There is no other way to create separate queue for managing send receive event 

 Solution-3:

 

  • After invoking API-A at step#1, flow moves to Receive message event to hold the process flow at step#2
  • Upstream system which hosts the APIs will invoke receive message event directly to release the flow at step#3
  • Flow moves on to next step at step#4

 

Disadvantage:

 This approach is tightly coupled and P2P communication.

  Discussion posts and replies are publicly visible