11 Jun 2024 09:21 AM
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
Solved! Go to Solution.
11 Jun 2024 09:44 AM
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
11 Jun 2024 12:33 PM
Hello Christopher,
Just letting you know your answer really clarified a lot! It all makes sense now!
Thanks Henk