# How to execute workflow (having SRG task) using DT API

**URL:** <https://community.dynatrace.com/t/how-to-execute-workflow-having-srg-task-using-dt-api/44083>\
**Category:** Automations\
**Tags:** workflows, site-reliability-guardian, automations\
**Created:** [February 12, 2024, 1:54pm UTC](https://community.dynatrace.com/t/how-to-execute-workflow-having-srg-task-using-dt-api/44083 "2024-02-12T13:54:39Z")\
**Posts on this page:** 3\
**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:** [February 12, 2024, 1:54pm UTC](https://community.dynatrace.com/t/how-to-execute-workflow-having-srg-task-using-dt-api/44083/1 "2024-02-12T13:54:39Z")

</div>

Hi Team  
I have built one workflow , having Task 1 - run\_validation which runs SRG.

When I am planning to run this workflow using DT API&nbsp;&nbsp; /automation/v1/workflows/

Can somebody please help me to know How to pass SRG custom timeframe&nbsp; timeframe( time window for SRG validation)&nbsp; as a input time in DT API request body?

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:** [February 13, 2024, 7:42am UTC](https://community.dynatrace.com/t/how-to-execute-workflow-having-srg-task-using-dt-api/44083/2 "2024-02-13T07:42:09Z")

</div>

Please help me on this

---

<div class="post-metadata">

**Author:** ![JohannesBraeuer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/johannesbraeuer/32/5357_2.png) [@JohannesBraeuer](https://community.dynatrace.com/u/JohannesBraeuer)\
**Post date:** [February 15, 2024, 2:13pm UTC](https://community.dynatrace.com/t/how-to-execute-workflow-having-srg-task-using-dt-api/44083/3 "2024-02-15T14:13:44Z")

</div>

Hello Heramb,

I would like to propose solving this by sending an event (BIZ\_EVENT), which then acts as a trigger for your workflow.&nbsp;  
In Workflows:&nbsp;  
1. Set the trigger of your workflow to be an Event trigger  
2. Configure a filter to act on those events that should trigger the workflow

Instead of calling the API, compile a JSON payload as explained [here](https://docs.dynatrace.com/docs/platform-modules/automations/site-reliability-guardian/execution-context#context-propagation) and set it to the endpoint: /platform/classic/environment-api/v2/bizevents/ingest

The event payload then provides the timeframe to validate.

Regards,  
Johannes

Best Regards,

Johannes
