IBM Security SOAR

Expand all | Collapse all

Can we use helper.fail () in workflows/script related to data tables?

  • 1.  Can we use helper.fail () in workflows/script related to data tables?

    Posted Wed June 23, 2021 11:30 AM
    Hi Members,

    I have scenario where I want to trigger a workflow when a data table field is changed. The workflow eventually calls a function which will via the integration code attempt to execute API call over the internet. If the API call is successful then its fine but in case the API call fails due to any reason(connectivity,authentication token issue etc) i want the values in data table cell to be reverted back and user gets a popup notification using helper.fail().

    I tried to do so, the function is returning the results with required indicator for failed attempts but not able to execute the helper.fail() frmo post processing script for the function. I also tried to use a in-script in workflow which will  execute the helper.fail() but that is also not working. 
    The workflow and Script both are for object type data table.

    Any help on this is appreciated.

    ------------------------------
    Mihir Ashar
    ------------------------------


  • 2.  RE: Can we use helper.fail () in workflows/script related to data tables?

    Posted Thu June 24, 2021 09:16 AM
    When a workflow/playbook starts, it is in the context of the same transaction that the user that caused it to start. Any helper.fail() calls in the context of user transaction is shown to the user as a popup modal.

    Workflow/playbook progress after a function happens in the background. Any helper.fail() that happens in the background just causes the workflow/playbook to fail. There is currently no method for a user to get a modal popup to this effect.

    It is definitely a good idea to have a more proactive notification to users for the cases when the workflow/playbook is running in the background. I recommend opening an idea in the Aha portal.

    Ben

    ------------------------------
    Ben Lurie
    ------------------------------



  • 3.  RE: Can we use helper.fail () in workflows/script related to data tables?

    Posted Thu June 24, 2021 09:20 AM
    Hi Mihir,

    Unfortunately using helper.fail() AFTER a function is not capable of doing what you need. Once a function is called, any changes made by the workflow up until that point are saved to the database and can no longer be interrupted or rolled back by helper.fail(). This is because functions are external code that could potentially run for hours at a time so we can't include it all in a single transaction.

    You could try your best to validate the data BEFORE the function and use helper.fail() to roll back changes, but like you said, this won't help with connectivity/authentication issues. Your best option might just be to add a note to the incident explaining the data table function failed but this is not as noticeable to the user and won't stop the changes.

    I can't think of a better answer to your problem at the moment, but maybe someone else has a good idea of how to work around it.

    ------------------------------
    Sean Mc Cann
    ------------------------------