# Question about javascript (struture) used in workflow

**URL:** <https://community.dynatrace.com/t/question-about-javascript-struture-used-in-workflow/46041>\
**Category:** Automations\
**Tags:** workflows, automations\
**Created:** [June 11, 2024, 8:21am UTC](https://community.dynatrace.com/t/question-about-javascript-struture-used-in-workflow/46041 "2024-06-11T08:21:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [June 11, 2024, 8:21am UTC](https://community.dynatrace.com/t/question-about-javascript-struture-used-in-workflow/46041/1 "2024-06-11T08:21:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChristopherHejl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christopherhejl/32/20735_2.png) [@ChristopherHejl](https://community.dynatrace.com/u/ChristopherHejl)\
**Post date:** [June 11, 2024, 8:44am UTC](https://community.dynatrace.com/t/question-about-javascript-struture-used-in-workflow/46041/2 "2024-06-11T08:44:48Z")

</div>

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. [Run JavaScript action for Workflows — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/workflows-action-javascript#task-result)

---

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [June 11, 2024, 11:33am UTC](https://community.dynatrace.com/t/question-about-javascript-struture-used-in-workflow/46041/3 "2024-06-11T11:33:23Z")

</div>

Hello Christopher,

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

Thanks Henk
