Skip to main content
August 22, 2021
Question

How to call a Python or JavaScript function in Appian

  • August 22, 2021
  • 8 replies
  • 4 views

Hi.

I am running into a problem in my current use case. I am using Appian to load new tasks into my Appian application environment every day. These tasks are then automatically assigned to a set of workers/appian users. 

Each task has its own set of requirements that must match with the worker's set of skills. This is a classic work assignment problem and I was able to reduce it to a Min Cost Max Flow problem, to which there are many established solutions in the form of an algorithm. There are plenty of code implementations of these algorithms in Python, JavaScript, C, etc etc.

My problem is that I am having a hard time figuring out a way to incorporate these code implementations into Appian. 

Does Appian have a way of calling/compiling/running python or JS code?

8 replies

August 23, 2021

have you explored writing a plugin - getting it cloud approved and using it in your implementation?

stefanhelzle0001
Brainy
August 23, 2021

Not sure why you need code here. Create an expression which checks the requirements for a given task and returns a list of users or groups. In this expression you could use a process report to get the current work load for groups/users.

August 23, 2021

I see, unfortunately I am not assigning tasks using the Appian task-user feature, For now I just need a way to systematically assign new tasks that come in daily to existing team of users, while matching the set of skills required and making sure a fair distribution. 

davel001150
August 24, 2021

If you have a way to host it, you could also put the python or JS on your own domain, expose it as webservice, and create a connected system to link to it.  Then you can use nodes in a PM to call the logic from Appian.

If that sounds like a lot, it is, but there's a chance it's less than figuring out how to do the same in Appian.  I would at least investigate to see how much lift an Appian based rule that does it would be to create, because the webservice route adds a host of potential problems that will stay with you.  For instance, you'll have to occasionally deal with 403 and other error codes.