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

Question about javascript (struture) used in workflow

henk_stobbe
DynaMight Champion
DynaMight Champion

Hello all,

Maybe a beginners question, but what is the reason in that in the documentation this is used:

export default async function ({ execution_id }) ??

You define a function "execution_id" that will be called by the workflow? And is this mandatory?

KR Henk

 

2 REPLIES 2

ChristopherHejl
Dynatrace Helper
Dynatrace Helper

The export default async function is required for the javascript runtime to pick it up and automatiacally run it (and optionally pick up the result that is returned by the function).
The { execution_id } is a parameter that is passed to the function by the workflow, which holds the ID of the workflow execution that caused this function to run. With this ID we can use the SDK to load context from that execution, for example grab the result of a previous task. https://docs.dynatrace.com/docs/shortlink/workflows-action-javascript#task-result

Hello Christopher,

Just letting you know your answer really clarified a lot! It all makes sense now!

Thanks Henk

Featured Posts