<?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: Trigger a Job Flow (from Manage Environment) in SAS Studio Task Prompt in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967953#M30017</link>
    <description>&lt;P&gt;Good day sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First off, you need the job request id from Environment Manager.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZOR_AD_0-1748877882852.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107520i28F1887B76870B2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZOR_AD_0-1748877882852.png" alt="ZOR_AD_0-1748877882852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Task Prompt/Program section you use the following:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filename jobresp temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let viyaHost = %sysfunc(getoption(SERVICESBASEURL));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc http&lt;BR /&gt;url="&amp;amp;viyahost./jobExecution/jobRequests/e703d46b-7798-4c81-9fee-fe18f72b31db/jobs"&lt;BR /&gt;method="POST"&lt;BR /&gt;out=jobresp&lt;BR /&gt;oauth_bearer = sas_services;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*you can assign a lib to see the API response if you run all the above as a program, maybe as a test before prod */&lt;BR /&gt;libname jobresp json fileref=jobresp;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;Best.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jun 2025 15:33:16 GMT</pubDate>
    <dc:creator>ZOR_AD</dc:creator>
    <dc:date>2025-06-02T15:33:16Z</dc:date>
    <item>
      <title>Trigger a Job Flow (from Manage Environment) in SAS Studio Task Prompt</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/965863#M29960</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First off kindly point me to an existing topic in the community if the subject has already been discussed, but from what i searched so far did not find one (maybe i missed it).&lt;/P&gt;&lt;P&gt;Closest i found is:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917349/thread-id/361364" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917349/thre...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product: SAS Studio Engineer / Version : 2024.03&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context&lt;/STRONG&gt;: i have a job flow in Environment Manager which consists in Flows (.flw) from SAS Studio deployed as jobs (all of them used here in the flow) and some Logic Gates. See Below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Job Flow Name : JF_RUN&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZOR_AD_0-1746517545507.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106758iEBF93FBB9B20EE32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZOR_AD_0-1746517545507.png" alt="ZOR_AD_0-1746517545507.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now, this Job Flow is scheduled to run daily at 12:00 pm. In case the Job Flow fails with an error, the person responsible with the process will investigate, take necessary measures, and need to execute the Flow again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BUT&lt;/STRONG&gt;,&amp;nbsp; Job Flow 2, one of the flows from SAS studio used in this flow in Environment Manager,&amp;nbsp; works with some input parameters, and, from the investigations made, it turns out that some of them need to be altered, &lt;U&gt;only for the next run iteration&lt;/U&gt;. Since the parameters are read from csv's on the server and loaded into tables, we would like to avoid user interaction with the CSV, especially since the parameters modification is only for next execution.&lt;/P&gt;&lt;P&gt;And so we considered generating a Job-&amp;gt;Task Prompt from SAS Studio where the user will input parameters (into an XML form) with altered values for Job Flow 2 and then trigger the existing Job Flow in Environment Manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The question&lt;/STRONG&gt; : How can i trigger the execution of my flow JF_RUN in Environment Manager from the Program Tab using SAS code in a Task Prompt, ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZOR_AD_1-1746517545653.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106757i958166D1958F005B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZOR_AD_1-1746517545653.png" alt="ZOR_AD_1-1746517545653.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 07:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/965863#M29960</guid>
      <dc:creator>ZOR_AD</dc:creator>
      <dc:date>2025-05-06T07:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job Flow (from Manage Environment) in SAS Studio Task Prompt</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967953#M30017</link>
      <description>&lt;P&gt;Good day sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First off, you need the job request id from Environment Manager.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZOR_AD_0-1748877882852.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107520i28F1887B76870B2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZOR_AD_0-1748877882852.png" alt="ZOR_AD_0-1748877882852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Task Prompt/Program section you use the following:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filename jobresp temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let viyaHost = %sysfunc(getoption(SERVICESBASEURL));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc http&lt;BR /&gt;url="&amp;amp;viyahost./jobExecution/jobRequests/e703d46b-7798-4c81-9fee-fe18f72b31db/jobs"&lt;BR /&gt;method="POST"&lt;BR /&gt;out=jobresp&lt;BR /&gt;oauth_bearer = sas_services;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*you can assign a lib to see the API response if you run all the above as a program, maybe as a test before prod */&lt;BR /&gt;libname jobresp json fileref=jobresp;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;Best.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 15:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967953#M30017</guid>
      <dc:creator>ZOR_AD</dc:creator>
      <dc:date>2025-06-02T15:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job Flow (from Manage Environment) in SAS Studio Task Prompt</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967956#M30018</link>
      <description>&lt;P&gt;OMG this was EXACTLY what i was looking for! Thank you so much !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="award.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107521iA0F58D623F17AFF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="award.jpg" alt="award.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 15:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967956#M30018</guid>
      <dc:creator>ZOR_AD</dc:creator>
      <dc:date>2025-06-02T15:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job Flow (from Manage Environment) in SAS Studio Task Prompt</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967960#M30019</link>
      <description>&lt;P&gt;LE: The solution works for the execution of Jobs in Environment Manager.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZOR_AD_0-1748880777635.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107522i6D49D5E9E4BC334C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZOR_AD_0-1748880777635.png" alt="ZOR_AD_0-1748880777635.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar, for the programmatic execution of Job Flows you need to access the specific API and obtain the Flow ID. One option ( that i found so far) is to manually get the Flow ID, meaning:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let viyaHost = %sysfunc(getoption(SERVICESBASEURL));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Go to&amp;nbsp;url: &amp;amp;viyahost./jobFlowScheduling/flows/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scroll, if you haven't filtered in the URL, and find the name of your flow in Environment Manager. EG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mine is named "JF_API" (very clever, duuh)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZOR_AD_1-1748881057969.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107523i2C82F78FE6FF7E04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZOR_AD_1-1748881057969.png" alt="ZOR_AD_1-1748881057969.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i get the ID from the URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; {
      "creationTimeStamp": "2025-06-02T15:56:28.497377Z",
      "createdBy": "sasuser",
      "modifiedTimeStamp": "2025-06-02T15:56:28.497378Z",
      "modifiedBy": "sasuser",
      "version": 1,
      "id": "fa3202f7-342d-4a5b-b9cf-85f628d59477",
      "name": "JF_API",
      "links": [&lt;/PRE&gt;&lt;P&gt;And with the PATCH method (that you also see in the "links" when accessing the Flow API - above) you execute the Job Flow:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filename jobresp temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let viyaHost = %sysfunc(getoption(SERVICESBASEURL));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc http&lt;BR /&gt;url="&amp;amp;viyahost./jobFlowScheduling/flows/fa3202f7-342d-4a5b-b9cf-85f628d59477/scheduled"&lt;BR /&gt;method="PATCH"&lt;BR /&gt;out=jobresp&lt;BR /&gt;oauth_bearer = sas_services;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*you can assign a lib to see the API response if you run all the above as a program, maybe as a test before prod */&lt;BR /&gt;libname jobresp json fileref=jobresp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 16:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Trigger-a-Job-Flow-from-Manage-Environment-in-SAS-Studio-Task/m-p/967960#M30019</guid>
      <dc:creator>ZOR_AD</dc:creator>
      <dc:date>2025-06-02T16:24:31Z</dc:date>
    </item>
  </channel>
</rss>

