<?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 do I create a custom step that will execute a python script that needs the Job ID as an input to run? in ArcGIS Workflow Manager Questions</title>
    <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53013#M120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;This helped get me going down the right path.&amp;nbsp; I was able to use the LaunchGPTool to get it to work properly, but that pops up the Get Parameters GUI (even though it is populating the parameter automatically from the token) and I want this step to run without any input from the user.&amp;nbsp; Therefore, I switched to ExecuteGPTool and kept all of the same arguments, but it no longer runs the script properly. It is like it isn't getting the JOB_ID parameter now.&amp;nbsp; Do I need to change my script to not use arcpy.GetParameterAsText in order to use ExecuteGPTool?&amp;nbsp; I've tried using arcpy.GetParameter and sys.argv, but neither of those worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turns out the above isn't true.&amp;nbsp; It does work, but not if it is running when the job is created.&amp;nbsp; The job is set to auto-execute several steps immediately after creation including this step.&amp;nbsp; The return code for this step though is 1, so failure.&amp;nbsp; If I reset the workflow to this step and reexecute it, it still says it fails.&amp;nbsp; If I close and reopen Workflow Manager, and then rerun the step, it completes with success.&amp;nbsp; I just added in a loop based on failure or success, it just goes to a procedural step that automatically executes and advances and goes back to the step so it can execute again.&amp;nbsp; I tried creating a new job with this updated workflow and it appears to be stuck in a continuous loop in the job creation.&amp;nbsp; Because it must be failing over and over.&amp;nbsp; I killed the application and reopened it and found the workflow at my update step, ran it, and it completed just fine.&amp;nbsp; Why won't this step complete if it is being executed during the job creation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since my original question has been answered, and the issues I am now having are not related to that question. I have created a new discussion for that issue. It can be found at &lt;A href="https://community.esri.com/message/494502"&gt;ExecuteGPTool step will not run successfully if auto executed during job creation&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2015 23:33:47 GMT</pubDate>
    <dc:creator>deleted-user-7uOyUeQXbkI0</dc:creator>
    <dc:date>2015-04-09T23:33:47Z</dc:date>
    <item>
      <title>How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53011#M118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've created a python script that I want to run in my workflow.&amp;nbsp; I figure I need to create a custom executable step and call the python script from that.&amp;nbsp; The help for creating steps (&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Creating_step_types/00380000001v000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Creating_step_types/00380000001v000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; mentions that tokens can be used as arguments for the executable.&amp;nbsp; That sounds great because then I could pass in the Job ID which is the only input that i need for the script to work properly, but how do i get the script to recognize and use the token?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 16:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53011#M118</guid>
      <dc:creator>deleted-user-7uOyUeQXbkI0</dc:creator>
      <dc:date>2015-04-09T16:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53012#M119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The arguments of the step would accept tokens. An example of running this is - Program = c:\Python.exe Arguments = "yourpythonfile.exe [Job:id]". The example is assuming that when you open a cmd line window to run your python script as "yourpythonfile.exe 1"&lt;/P&gt;&lt;P&gt;Alternatively, you could wrap the python script up as a script tool and then use the launch or execute GP tool step to run it and pass in the proper arguments. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tope&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 17:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53012#M119</guid>
      <dc:creator>TopeBello</dc:creator>
      <dc:date>2015-04-09T17:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53013#M120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;This helped get me going down the right path.&amp;nbsp; I was able to use the LaunchGPTool to get it to work properly, but that pops up the Get Parameters GUI (even though it is populating the parameter automatically from the token) and I want this step to run without any input from the user.&amp;nbsp; Therefore, I switched to ExecuteGPTool and kept all of the same arguments, but it no longer runs the script properly. It is like it isn't getting the JOB_ID parameter now.&amp;nbsp; Do I need to change my script to not use arcpy.GetParameterAsText in order to use ExecuteGPTool?&amp;nbsp; I've tried using arcpy.GetParameter and sys.argv, but neither of those worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turns out the above isn't true.&amp;nbsp; It does work, but not if it is running when the job is created.&amp;nbsp; The job is set to auto-execute several steps immediately after creation including this step.&amp;nbsp; The return code for this step though is 1, so failure.&amp;nbsp; If I reset the workflow to this step and reexecute it, it still says it fails.&amp;nbsp; If I close and reopen Workflow Manager, and then rerun the step, it completes with success.&amp;nbsp; I just added in a loop based on failure or success, it just goes to a procedural step that automatically executes and advances and goes back to the step so it can execute again.&amp;nbsp; I tried creating a new job with this updated workflow and it appears to be stuck in a continuous loop in the job creation.&amp;nbsp; Because it must be failing over and over.&amp;nbsp; I killed the application and reopened it and found the workflow at my update step, ran it, and it completed just fine.&amp;nbsp; Why won't this step complete if it is being executed during the job creation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since my original question has been answered, and the issues I am now having are not related to that question. I have created a new discussion for that issue. It can be found at &lt;A href="https://community.esri.com/message/494502"&gt;ExecuteGPTool step will not run successfully if auto executed during job creation&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 23:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53013#M120</guid>
      <dc:creator>deleted-user-7uOyUeQXbkI0</dc:creator>
      <dc:date>2015-04-09T23:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53014#M121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried&amp;nbsp;using above way of passing parameters and tried executing step manually but nothing worked.&lt;/P&gt;&lt;P&gt;Then I gave parameters as below and it did worked&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;- Program = c:\Python.exe Arguments = "yourpythonfile.exe"&amp;nbsp;&lt;STRONG&gt;[Job:id]&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;JobId should be placed outside the double quote.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53014#M121</guid>
      <dc:creator>NikhilSai</dc:creator>
      <dc:date>2018-08-28T14:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53015#M122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I tried&amp;nbsp;using above way of passing parameters and tried executing step manually but nothing worked.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Then I gave parameters as below and it did worked&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;- Program = c:\Python.exe Arguments = "yourpythonfile.exe"&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;[Job:id]&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;JobId should be placed outside the double quote.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:36:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53015#M122</guid>
      <dc:creator>NikhilSai</dc:creator>
      <dc:date>2018-08-28T14:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53016#M123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, make sure the you provide the full path to python.exe and the full path to the python script that you wish to execute.&lt;/P&gt;&lt;P&gt;If you would like to suppress the command window pythonw.exe can also be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sample arguments for executable step type" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/420693_screendump_wfm_execute_step.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 06:21:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53016#M123</guid>
      <dc:creator>deleted-user-59NIbCq7H8Ve</dc:creator>
      <dc:date>2018-08-29T06:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a custom step that will execute a python script that needs the Job ID as an input to run?</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53017#M124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Lauren, that's correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 20:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/how-do-i-create-a-custom-step-that-will-execute-a/m-p/53017#M124</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-11-29T20:19:04Z</dc:date>
    </item>
  </channel>
</rss>

