# Call another existing workflow from within a new workflow

**URL:** <https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802>\
**Category:** Automations\
**Tags:** automationengine, latest-dynatrace, workflows, automation\
**Created:** [May 18, 2023, 7:23am UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802 "2023-05-18T07:23:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![agata.wlodarczyk](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agata.wlodarczyk/32/22_2.png) [@agata.wlodarczyk](https://community.dynatrace.com/u/agata.wlodarczyk)\
**Post date:** [May 18, 2023, 7:23am UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/1 "2023-05-18T07:23:41Z")

</div>

Can I call another existing workflow from within my new workflow?

---

<div class="post-metadata">

**Author:** ![michaelwinkler](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michaelwinkler/32/29293_2.png) [@michaelwinkler](https://community.dynatrace.com/u/michaelwinkler)\
**Post date:** [May 18, 2023, 7:31am UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/2 "2023-05-18T07:31:33Z")

</div>

Yes, triggering a workflow from within a workflow is possible, currently via the automation SDKs and APIs.

On the roadmap is the concept of sub-workflows which can be added as tasks.

---

<div class="post-metadata">

**Author:** ![Stephen1\_Lee](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stephen1\_Lee](https://community.dynatrace.com/u/Stephen1_Lee)\
**Post date:** [October 27, 2023, 8:23pm UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/3 "2023-10-27T20:23:29Z")

</div>

HI.

Can you give an example of how a workflow could trigger another workflow?

Does some task workflow somehow call another one?

Thank you

---

<div class="post-metadata">

**Author:** ![michaelwinkler](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michaelwinkler/32/29293_2.png) [@michaelwinkler](https://community.dynatrace.com/u/michaelwinkler)\
**Post date:** [October 29, 2023, 10:23am UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/4 "2023-10-29T10:23:00Z")

</div>

Hi

Yes, currently you can use a workflow task like “HTTP request” (calling the workflow API) or “Run Javascript” (adding the Automation SDK).

On the roadmap we have the concept of subworkflows as well. We’ll keep you posted.

---

<div class="post-metadata">

**Author:** ![lee-pritchard](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@lee-pritchard](https://community.dynatrace.com/u/lee-pritchard)\
**Post date:** [September 17, 2024, 12:10am UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/5 "2024-09-17T00:10:37Z")

</div>

Hi Steven,

I belive your looking for the following documentation to run via Javascript ([Automation | Dynatrace Developer](https://developer.dynatrace.com/develop/sdks/client-automation/#runworkflow))&nbsp;and example of how to use this function would be:

import { workflowsClient } from “@dynatrace-sdk/client-automation”;

const data = await workflowsClient.runWorkflow({  
id: “…”,  
body: {},  
});

where id is the UUID of the workflow you want to run

---

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [March 19, 2025, 12:44pm UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/6 "2025-03-19T12:44:39Z")

</div>

Hi Team,  
I tried running above given snippet in javascript task of workflow but getting below error. Please help me on this.

An error of type UNCAUGHT\_EXCEPTION occurred in an imported library: 404: Not found.  
at **ActionExecutionsClient.getActionExecutionLog (f**ile:///opt/sdk\_modules/@dynatrace-sdk/client-automation/esm/index.js:388:17)  
at eventLoopTick (ext:core/01\_core.js:175:7)  
at async default (file:///script.ts:13:3)

---

<div class="post-metadata">

**Author:** ![MarwanC](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marwanc/32/34480_2.png) [@MarwanC](https://community.dynatrace.com/u/MarwanC)\
**Post date:** [October 10, 2025, 10:07am UTC](https://community.dynatrace.com/t/call-another-existing-workflow-from-within-a-new-workflow/39802/7 "2025-10-10T10:07:19Z")

</div>

This works for me if you use this code, but there is still an issue that you need to wait until the workflow completes and poll for the output of the last task, If I have the solution for this I will post it, meanwhile here is the working code, when you run it you will code the output of the workflow that is in a running mode.

import { execution } from ‘@dynatrace-sdk/automation-utils’;  
import { workflowsClient } from “@dynatrace-sdk/client-automation”;

export default async function () {  
// Define the body with input parameters  
const body = {  
input: {  
display\_id: “PROBLEM-ID”  
},  
};

// Run the workflow with the defined body  
const data = await workflowsClient.runWorkflow({  
id: “f8888104-3105-464f-bd26-db404f8f73e8”,  
body: body,  
});

console.log(“Workflow run response:”, data);  
}
