# Call workflow using Dynatrace API and pass workflow input parameters

**URL:** <https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957>\
**Category:** Automations\
**Tags:** workflows, site-reliability-guardian, dynatrace-api\
**Created:** [June 6, 2024, 4:28pm UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957 "2024-06-06T16:28:19Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [June 6, 2024, 4:28pm UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957/1 "2024-06-06T16:28:19Z")

</div>

Hi All,  
I have workflow having task&nbsp; of SRG validation and this task needs input as test timeframe to evaluate srg.

Howe we can call this workflow using dynatrace API and how we can pass SRG task input from API??

Regards,  
Heramb Sawant

---

<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:** [June 7, 2024, 5:17am UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957/2 "2024-06-07T05:17:10Z")

</div>

Please help me to on this issue.

---

<div class="post-metadata">

**Author:** ![jaume\_reverte](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jaume_reverte/32/1479_2.png) [@jaume\_reverte](https://community.dynatrace.com/u/jaume_reverte)\
**Post date:** [June 7, 2024, 7:12am UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957/3 "2024-06-07T07:12:23Z")

</div>

Hello!

You can make use of the API call /workflows/{id}/run to trigger the execution of a particular workflow. And then in the request body you can send some information. For example:

```javascript
{
  "input": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "params": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "uniqueQualifier": "string"
}

```

This information is then available for ypu to use in the workflow execution time.

For executing this API call the&nbsp; **Required scope:** &nbsp;automation:workflows:run&nbsp;is needed for the token.

Best

---

<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:** [July 5, 2024, 10:57am UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957/4 "2024-07-05T10:57:23Z")

</div>

Could you please tell me how to capture/receive these input parameters in workflow task.

Regards,  
Heramb

---

<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:** [July 5, 2024, 12:30pm UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957/5 "2024-07-05T12:30:05Z")

</div>

Also If I add above given parameters in the api body as it is. in the response I get workflow status **success but workflow do not triggered** and If I just remove the above given input parameters , API works fine workflow status is Running.

What could be the reason here ??

```auto
Regards,
Heramb sawant

```

---

<div class="post-metadata">

**Author:** ![Eric\_Yu](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/eric_yu/32/20360_2.png) [@Eric\_Yu](https://community.dynatrace.com/u/Eric_Yu)\
**Post date:** [July 5, 2024, 5:38pm UTC](https://community.dynatrace.com/t/call-workflow-using-dynatrace-api-and-pass-workflow-input-parameters/45957/6 "2024-07-05T17:38:18Z")

</div>

You might be able to get that information from the execution log with a js block:

> **[Automation | Dynatrace Developer](https://developer.dynatrace.com/develop/sdks/client-automation/)**
>
> Automation API allows working with workflows and various trigger options.

```markup
import { executionsClient } from "@dynatrace-sdk/client-automation";

const data = await executionsClient.getExecutionLog({
  id: "...",
});

```

An alternative to send the values you want is to change the trigger to a bizevent and send all the information you need in that bizevent:  
[https://docs.dynatrace.com/docs/shortlink/ba-api-ingest](https://docs.dynatrace.com/docs/shortlink/ba-api-ingest)
