<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calling the API to start a workflow, is there a way to add and consume parameters? in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247523#M1572</link>
    <description>&lt;P&gt;Hi Sini,&lt;/P&gt;&lt;P&gt;Thanks for your reply,&amp;nbsp; I am very happy,&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2024 09:40:21 GMT</pubDate>
    <dc:creator>henk_stobbe</dc:creator>
    <dc:date>2024-06-06T09:40:21Z</dc:date>
    <item>
      <title>Calling the API to start a workflow, is there a way to add and consume parameters?</title>
      <link>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247496#M1570</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Maybe I am overlooking, but how can I add parameters to the API to start a workflow?&lt;/P&gt;&lt;P&gt;And how do I consume these parameters in js?&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 21:31:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247496#M1570</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2024-06-05T21:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calling the API to start a workflow, is there a way to add and consume parameters?</title>
      <link>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247518#M1571</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/11427"&gt;@henk_stobbe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as &lt;A href="https://docs.dynatrace.com/docs/shortlink/workflows-running#run-a-workflow-with-inputs" target="_blank"&gt;mentioned in help&lt;/A&gt;, have you checked out swagger about how to add parameters to the workflow execution?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_0-1717665604529.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20345i7DA9B7D856936D88/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinisa_zubic_0-1717665604529.png" alt="sinisa_zubic_0-1717665604529.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To access the input parameters, please have a look at this is the code snippet:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// optional import of sdk modules
import { execution } from '@dynatrace-sdk/automation-utils';

export default async function ({ execution_id }) {
  // your code goes here
  // e.g. get the current execution
  const ex = await execution(execution_id);
  console.log('Automated script execution on behalf of', ex.trigger);
  console.log(ex.input);
  console.log(ex.params);
  return { triggeredBy: ex.trigger };
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The parameters in that case will be logged to console.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 09:21:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247518#M1571</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-06-06T09:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calling the API to start a workflow, is there a way to add and consume parameters?</title>
      <link>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247523#M1572</link>
      <description>&lt;P&gt;Hi Sini,&lt;/P&gt;&lt;P&gt;Thanks for your reply,&amp;nbsp; I am very happy,&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 09:40:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247523#M1572</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2024-06-06T09:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calling the API to start a workflow, is there a way to add and consume parameters?</title>
      <link>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247812#M1579</link>
      <description>&lt;P&gt;I'd like to add that you can also access workflow inputs in any action without javascript using expressions as well&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/automation-workflow-expression-reference#execution" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/shortlink/automation-workflow-expression-reference#execution&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# access the current execution object
{{ execution() }}

# access ID of current execution
Execution ID {{ execution().id }}

# access input of current execution
Execution input {{ execution().input | default('no input defined') }}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 07:56:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Calling-the-API-to-start-a-workflow-is-there-a-way-to-add-and/m-p/247812#M1579</guid>
      <dc:creator>ChristopherHejl</dc:creator>
      <dc:date>2024-06-10T07:56:43Z</dc:date>
    </item>
  </channel>
</rss>

