Showing results for 
Show  only  | Search instead for 
Did you mean: 

workflow with http request

DynaMight Champion
DynaMight Champion

Good morning,

As shown below, it would be nice to use variables in the http request:


So my questions is this possible, or do I need to write my own fetch request?

  And I assume you need multiple returns for multiple variables or is the proper way state or document? 

In short what is the proper way for this?

KR Henk








Dynatrace Helper
Dynatrace Helper

You can use the expressions documented at as well as any default jinja2 function (link in the doc).
We currently do not support defining a fixed set of variables on the workflow to use anywhere (although on the roadmap for this year with the proper introduction of workflow input support and default values in the UI).
For now, if you want to manage a set of variables in one place to use throughout the workflow, your best bet would be an ad-hoc javascript task that returns the desired data.

Return data can be any json object, so complex, nested objects with any json supported types are possible. for example:

export default async function ({ execution_id }) {

  return {
    my_string: "Some important string",
    my_number: 42,
    my_list: [1,2,"something else"],
    my_object: {
      my_key: "my value",
      my_other_number: 196,
      my_boolean: true

will return as shown



Then you can access the data using the result expression

{{ result("my_data_task")["my_object"]["my_key"] }}



Note: in order to get proper autocomplete suggestion for the results, you'll need to update the sample result of your custom javascript task accordingly.
You can find that on the Sample Result tab


Then Edit and update the content.


Best way to do this I suggest to run the workflow once first, check the task works as expected and then use the "Sample from task exeuction" button which automatically updates the sample result with the result from the last execution:



Once we add full workflow input (and output) support, you will have a setting in the worklfow do define worklow scoped variables.

Great lesson thanks! (-;

Thanks for the question!

Featured Posts