<?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: How to get Workflow Job Execution Status Reports via email: The Solution in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140293#M25622</link>
    <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/9898"&gt;@CAPATEL_NET1984&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What version of WFA you are using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll not try to debug this now, this solutiuon is outdated as new some APIs have come in WFA. I think this solution was developed for WFA3.X&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll post a updated solution here. You need to wait for a few days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sinhaa&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 21:06:34 GMT</pubDate>
    <dc:creator>sinhaa</dc:creator>
    <dc:date>2018-05-16T21:06:34Z</dc:date>
    <item>
      <title>How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/103365#M18288</link>
      <description>&lt;P&gt;Workflow Execution status reports can be very useful for WFA users, Admins and Architects even operators. I wanted to receive recurring email reports on how many workflows were executed in the last 7 days, and out of those how many passed or how many in Pending state. It helps to track jobs and workfflow executions. Like I wanted to know how many have been failing and how many times, which are stuck in Waiting for approval and need attention. Which workflows are being executed maximum no of times. How many workflow completed sucessfully etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A weekly/daily execution status report email to a list of users is a very useful feaure. But its&amp;nbsp;not available as yet with WFA.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Making such a solution had some big challenges. BIG!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;No rest API to get the list of all Workflow Execution jobs&lt;/LI&gt;&lt;LI&gt;No mechanism to connect to DB and get job execution&amp;nbsp; information&lt;/LI&gt;&lt;LI&gt;A job details can't be obtained unless you know the job ID and the workflow UUID. And I can’t get the job ID due to point 1.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, considering that there is always a possibility of innovation and genius&amp;nbsp;&lt;img id="robotvery-happy" class="emoticon emoticon-robotvery-happy" src="https://community.netapp.com/i/smilies/16x16_robot-very-happy.png" alt="Robot Very Happy" title="Robot Very Happy" /&gt; ,&amp;nbsp;let's build one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following logic&amp;nbsp;is used for building the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get this list of all workflows.&lt;/LI&gt;&lt;LI&gt;For every &lt;EM&gt;workflow name&lt;/EM&gt;, get its &lt;EM&gt;UUID&lt;/EM&gt;.&lt;/LI&gt;&lt;LI&gt;Use API &lt;EM&gt;SearchResource&lt;/EM&gt; with &lt;EM&gt;context EXECUTION_STATUS&lt;/EM&gt; to return the list of jobs for this particular &lt;EM&gt;workflow name&lt;/EM&gt;. Search is based on name&amp;nbsp; pattern matching, so it is possible that jobs of other workflows which had common or similar&amp;nbsp;words in their names will also get retuned. So returned list will be:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All jobs of our concerned workflow + (possibly) jobs of workflows with common patterns in their names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need to remove the latter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;For every job in the list of jobs returned in step-3, call API to get Execution details using the workflow &lt;EM&gt;UUID&lt;/EM&gt; . If this job didn't belong to our workflow, it will fail.&lt;/LI&gt;&lt;/OL&gt;&lt;OL&gt;&lt;LI&gt;Now we have been able to filter out which are our relevant jobs for this workflow. 70% of task done.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Assume you wanted weekly status report i.e. Execution status of the last 7 days. So get current date, get the date old date by subtracting 7 days from current date.&lt;/LI&gt;&lt;LI&gt;If our current job has execution start date falls within this time duration, get its status, and put in in our report. Prepare as beautiful reports as you want.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Do it for every job&lt;/LI&gt;&lt;LI&gt;Do the same for every workflow.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now I've designed a solution that generates the report and sends them by email. But you can use the above logic to generate your own reports the way you want them like in CSV or XL or PDF or just plain text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, Lets look at the 3 commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT color="#008000"&gt;Workflow Execution Status Reporter:&lt;/FONT&gt; It gets the execution status details within the time duration provided by the user, prepares the report in beautiful HTML formats. But this is also going to be in a workflow, so its been designed to ignore its own job when preparing the job execution reports. You'll see as you go on.&lt;/LI&gt;&lt;LI&gt;S&lt;FONT color="#008000"&gt;end Email with Workflow Execution Status Reports :&lt;/FONT&gt; Send the Workflow execution status report as email to a list of recipients.&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#008000"&gt;Workflow Scheduler:&lt;/FONT&gt; The command to schedule this workflow for recurring executions so that the execution status reports can be generated and sent automatically every day or every week or as &amp;nbsp;once in 2 weeks or per the user decides.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Details on this command are available here: &lt;A href="https://community.netapp.com/t5/OnCommand-Storage-Management-Software-Discussions/How-to-schedule-a-workflow-for-recurring-executions-The-solution/m-p/101547#M17984" target="_blank"&gt;http://community.netapp.com/t5/OnCommand-Storage-Management-Software-Discussions/How-to-schedule-a-workflow-for-recurring-executions-The-solution/m-p/101547#M17984&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;A sample workflow using the above 3 commands which sends Weekly Execution Status Report is attached. Just import it and execute it after getting the prerequisites done. You'll just love it.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Prerequisties:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Minimum WFA version &lt;STRONG&gt;3.0&lt;/STRONG&gt;: I've used the new feature Password as a User-Input type in Send email command which is only availabe from WFA3.0 on wards. WFA 2.2 Users will need to slightly modify this command.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;You need &lt;STRONG&gt;PowerShell 3.0&lt;/STRONG&gt; on your WFA server. WFA is fully supported to work on Posh3.0. Its available by default in Win2012, Win2008 can be upgraded, Win2003 users can't use it.&lt;/LI&gt;&lt;LI&gt;Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhost&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Match: Exact&lt;BR /&gt;Type: Other&lt;BR /&gt;Name/IP: localhost&lt;BR /&gt;Username: &amp;lt;WFA Admin/Architect Username&amp;gt;&lt;BR /&gt;Password: &amp;lt;User Password&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;IMG title="Credentials_localhost.png" border="0" alt="Credentials_localhost.png" src="https://community.netapp.com/t5/image/serverpage/image-id/2456i61D539B14491DB16/image-size/original?v=mpbl-1&amp;amp;px=-1" /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;A&amp;nbsp;sample Email of a Job execution report email will look as following. And it will be sent recurringly as per your schedule.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="WFA Weekly Execution status report email.png" border="0" alt="WFA Weekly Execution status report email.png" src="https://community.netapp.com/t5/image/serverpage/image-id/2594i3B0E5FB6A5E37DA2/image-size/original?v=mpbl-1&amp;amp;px=-1" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 10:30:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/103365#M18288</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2015-04-17T10:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/111086#M19616</link>
      <description>&lt;P&gt;I took the code that you wrote for this and started playing with it from Powershell directly on a machine with WFA3.0P1 installed. &amp;nbsp;When I run the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$creds = get-credential&lt;/P&gt;&lt;P&gt;$URL = "http://localhost:8080/rest/search?term=Test Exit&amp;amp;context=EXECUTION_STATUS"&lt;/P&gt;&lt;P&gt;$results = Invoke-RestMethod -Method get -Uri $URL -Credential $creds -contenttype "application/xml"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get a collection of results in the $results variable but all the job IDs are the same. &amp;nbsp;I see the correct number of entries, for example if the workflow was run 3 times I see 3 items in the collection, but all 3 are idential.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bug? &amp;nbsp;Something I did wrong? &amp;nbsp;Thinking no on that because if I just use a browser and do essentially the same thing with the correct URL I get the same result.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 22:41:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/111086#M19616</guid>
      <dc:creator>2006FatBoy</dc:creator>
      <dc:date>2015-10-13T22:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/111097#M19619</link>
      <description>&lt;P&gt;Hi 2006FatBoy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I see that this is your first post on NetApp communities. So welcome to this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@&amp;nbsp;Bug? &amp;nbsp;Something I did wrong? &amp;nbsp;Thinking no on that because if I just use a browser and do essentially the same thing with the correct URL I get the same result.&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No bug but a user mistake. Your workflow name has &amp;lt;space&amp;gt; in it. So&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$URL = "http://localhost:8080/rest/search?term=Test Exit&amp;amp;context=EXECUTION_STATUS"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;wont give the right results. Serach will not fail, but it won't give what you are looking for. Search engines are designed not to fail.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've taken care of it in my code, seems like you missed it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You need to use URL as below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;http://localhost:8080/rest/search?term='Test Exit'&amp;amp;context=EXECUTION_STATUS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i.e. have single quotes in the parameter for term i.e. workflow name so that in cases where workflow names have &amp;lt;space&amp;gt;, it will still work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try it on your browser. single quotes and &amp;lt;space&amp;gt; gets translated to %27 and %20 respectively by browser. But you get what you were looking for.&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;&lt;SPAN&gt;sinhaa&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 06:50:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/111097#M19619</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2015-10-14T06:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/111119#M19625</link>
      <description>&lt;P&gt;Ok. &amp;nbsp;I had manually translated the [space] to %20 when I tried it in the browser but I did not add the quotes. &amp;nbsp;So that was my mistake. &amp;nbsp;Thanks for the assist.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 11:37:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/111119#M19625</guid>
      <dc:creator>2006FatBoy</dc:creator>
      <dc:date>2015-10-14T11:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140282#M25620</link>
      <description>&lt;P&gt;Hi Sinha&lt;/P&gt;
&lt;P&gt;I ahve imported the workflow and still hitting the issue&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;11:44:24.293 INFO [Workflow Execution Status Reporter] Credentials successfully provided for 'localhost' 11:44:43.059 ERROR [Workflow Execution Status Reporter] The remote server returned an error: (500) Internal Server Error. 11:44:43.121 ERROR [Workflow Execution Status Reporter] Failed executing command. Exception: The remote server returned an error: (500) Internal Server Error.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 15:45:34 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140282#M25620</guid>
      <dc:creator>CAPATEL_NET1984</dc:creator>
      <dc:date>2018-05-16T15:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140293#M25622</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/9898"&gt;@CAPATEL_NET1984&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What version of WFA you are using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll not try to debug this now, this solutiuon is outdated as new some APIs have come in WFA. I think this solution was developed for WFA3.X&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll post a updated solution here. You need to wait for a few days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sinhaa&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:06:34 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140293#M25622</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2018-05-16T21:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140295#M25623</link>
      <description>&lt;P&gt;it looks like&amp;nbsp;its not advancing after below command&lt;/P&gt;
&lt;P&gt;$url1= 'http://localhost:' + $httpPort + '/rest/workflows'&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$workflowList = Invoke-RestMethod -Method get -Uri $url1 -Credential $cd -TimeoutSec 300&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am using 4.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance for checking&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:25:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140295#M25623</guid>
      <dc:creator>CAPATEL_NET1984</dc:creator>
      <dc:date>2018-05-16T21:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Workflow Job Execution Status Reports via email: The Solution</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140296#M25624</link>
      <description>&lt;P&gt;Even i use&amp;nbsp;http://wfaservername/rest/docs/#!/Execution%3AWorkflows/getWorkflows link to manually check the api call the response code is still 500 and resonse body stayed empty.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:37:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/How-to-get-Workflow-Job-Execution-Status-Reports-via-email-The-Solution/m-p/140296#M25624</guid>
      <dc:creator>CAPATEL_NET1984</dc:creator>
      <dc:date>2018-05-16T21:37:21Z</dc:date>
    </item>
  </channel>
</rss>

