# Get results from pervious workflow

**URL:** <https://community.dynatrace.com/t/get-results-from-pervious-workflow/40826>\
**Category:** Automations\
**Tags:** workflows, javascript\
**Created:** [July 21, 2023, 3:53pm UTC](https://community.dynatrace.com/t/get-results-from-pervious-workflow/40826 "2023-07-21T15:53:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jingyi](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jingyi](https://community.dynatrace.com/u/Jingyi)\
**Post date:** [July 21, 2023, 3:53pm UTC](https://community.dynatrace.com/t/get-results-from-pervious-workflow/40826/1 "2023-07-21T15:53:46Z")

</div>

Hi

In Workflow, there are three types of Execution:&nbsp;Execute DQL Query,&nbsp;HTTP Request,&nbsp;Run Javascript. If I use&nbsp;HTTP Request for task1 and have the response. How can I get this response result to use in next tasks, if next task uses Javascript? I tried with the ref&nbsp;[Expression reference | Dynatrace Docs](https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference)&nbsp;but still get error

 ![capture.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/7/37e163a71c10232bbf60d1e168abd578d3e5b5c6.png)

Thanks

---

<div class="post-metadata">

**Author:** ![samuelbernardy](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@samuelbernardy](https://community.dynatrace.com/u/samuelbernardy)\
**Post date:** [July 31, 2023, 1:11pm UTC](https://community.dynatrace.com/t/get-results-from-pervious-workflow/40826/2 "2023-07-31T13:11:20Z")

</div>

res will need to be declared here. For example:

```markup
const res = ex.result('http_request_1')

```

Also, keep in mind that in javascript, the result function is called via the current execution. While you may use the template string {{ result() }} from within an HTTP request for instance, you are importing the execution and result modules, which would require you to write the declaration as such:

```javascript
export default async function({execution_id}) {
  const ex = await execution(execution_id); 
  const res = await ex.result('http_request_1');
  console.log(res);
}

```
