cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calling an app function from a custom action in the workflow engine

michael_mayr
Dynatrace Advocate
Dynatrace Advocate

Hi,

I understand that one can automate app function runs of an app with the workflow automation engine with a JavaScript task [1]. I wanted to put this JavaScript into a dedicated app with a custom action and call the app function of another app, so that other users can re-use the code and can easily supply input parameters. However the app function returns, that those calls are not allowed. Is there a way to configure this or is this generally not possible?

[INFO]    {"error":{"code":403,"message":"App is not allowed to call function from another App"}}

It seems to be confusing for me, why one can call an app function within a JavaScript task of the workflow automation, but not within a custom action for the workflow automation. Are there any ideas to change this in the future?


[1] Automate app function runs | Dynatrace Developer

2 REPLIES 2

michal_zawislak
Dynatrace Advisor
Dynatrace Advisor

Hi Michael,

Currently,  You can call app functions from the Workflows app UI, "Run Javascript" action, and other app functions of the same app, but this is not possible to reach the function of another app (see image below).

Your AutomationEngine ally!

stefan_baumgart
Dynatrace Advocate
Dynatrace Advocate

There is currently no way to call an app from another app because you're introducing a direct dependency on something that is potentially volatile. We designed AppEngine so teams and developers can work independently, relying on stable and slow-moving platform APIs while they are more flexible to change their own APIs. If we'd allow other apps to depend on existing apps, we'd either

- need to put the responsibility of API stability on the app developers people depend on, which is a huge responsibility,
- or we'd put the responsibility to adapt to new APIs in the hands of the app developers who depend on other apps, which might result in tons of temporarily broken apps.

Furthermore, applications are always run in a specific scope with specific rights. If you'd call app B from app A, what would be the correct way to execute app B if the rights differ? Scope down to App A --> potentially breaking code. Enhance to App B? --> potentially opening security holes that App A has not signed up for.

This is why you can't depend directly on another application. The only apps that are allowed to do that have special privileges like Automation which query for APIs that can be integrated with their calling interface, and which also takes care of getting the correct scope for execution.

Featured Posts