<?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 Retry &amp;quot;ScheduleCommand&amp;quot; when it fails in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521249#M1399</link>
    <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;We're deploying a programmed automation which sometimes fails due to an external error. We'd like to retry in case the command fails. The command used is "ScheduleCommand". How can this "retry" be created? &lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 10:41:15 GMT</pubDate>
    <dc:creator>Josep</dc:creator>
    <dc:date>2022-11-15T10:41:15Z</dc:date>
    <item>
      <title>Retry "ScheduleCommand" when it fails</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521249#M1399</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;We're deploying a programmed automation which sometimes fails due to an external error. We'd like to retry in case the command fails. The command used is "ScheduleCommand". How can this "retry" be created? &lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 10:41:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521249#M1399</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-11-15T10:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retry "ScheduleCommand" when it fails</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521356#M1402</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/226640"&gt;@Josep&lt;/a&gt;, might need more information. Does ScheduleCommand command need to be re-tried of the command that it calls.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the playbook task using the command that&amp;nbsp;ScheduleCommand runs, in the below case I'm using Print. (Recommended method)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-11-16 at 12.57.02 pm.png" style="width: 472px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/45360iFAE50F268CC0FA69/image-dimensions/472x207/is-moderation-mode/true?v=v2" width="472" height="207" role="button" title="Screen Shot 2022-11-16 at 12.57.02 pm.png" alt="Screen Shot 2022-11-16 at 12.57.02 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you insist on using the ScheduleCommand, then you will have to create a wrapper script. The scheduleEntry command calls itself. (This method is not recommended unless playbook approach won't work)&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;res = demisto.executeCommand("Print", { "value" : "This is a test"})[0]

# Test res to verify if the command was successful. Code would depend on the automation your running.

# If command failed re-run
if cortexIncident['status'] != 1: # Test to check the outcome of res, dummy code
    exit(0)
else: # Schedule the next run
    demisto.executeCommand("scheduleEntry", { 'command' : 'wrapperSchedule', 'cron' : '1 * * * *', 'times' : 1 })&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 02:07:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521356#M1402</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-11-16T02:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Retry "ScheduleCommand" when it fails</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521375#M1406</link>
      <description>&lt;P&gt;Thanks for the reply,&lt;/P&gt;
&lt;P&gt;"On Error" option does not appear in our XSOAR tasks.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 08:20:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521375#M1406</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-11-16T08:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retry "ScheduleCommand" when it fails</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521385#M1409</link>
      <description>&lt;P&gt;You're right more info is needed, I refer to the command that calls inside "ScheduleCommand"&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 11:34:44 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521385#M1409</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-11-16T11:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Retry "ScheduleCommand" when it fails</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521503#M1411</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/226640"&gt;@Josep&lt;/a&gt;, in older versions of Cortex the option is available under the advanced tab. Screenshot below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-11-17 at 1.14.55 pm.png" style="width: 533px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/45390i1BB95AB3D0562078/image-dimensions/533x319/is-moderation-mode/true?v=v2" width="533" height="319" role="button" title="Screen Shot 2022-11-17 at 1.14.55 pm.png" alt="Screen Shot 2022-11-17 at 1.14.55 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 02:16:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/retry-quot-schedulecommand-quot-when-it-fails/m-p/521503#M1411</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-11-17T02:16:31Z</dc:date>
    </item>
  </channel>
</rss>

