Use Cases
Native Action Use Cases
Script Test Use Case
8 min
scenario test script action rowan is an orchestrator who wants to map static and playbook property data to the script native action inputs so that he can reference this data in the python script and test the inputs to see the results before continuing to build the playbook he also wants to see if there are any discovered outputs in addition to the original outputs first, rowan adds his webhook trigger, so the webhook property data is available downstream in the playbook let's see how he sets up the script native action to see if there are discovered outputs and testing docid\ xdoxji82d8iulanf8c34h steps to configure the script native action click the action drop down menu, select script , and enter a title for the action click configure to open the script configuration window this window displays three tabs script , outputs , and test note to ensure proper testing, verify that your script has valid inputs and a valid output structure this avoids errors in the next steps from the script tab, click add property and select string enter the value " hello " for this property tip you can add multiple input types (e g , strings, numbers, objects) to test various scenarios add another property of type object rename the properties as string test and object test1 for easier identification inside the object property, click add property again and select string name this inner string property string 2 in the script pane, enter the script navigate to the test tab this allows you to test the script before finalizing the action if there are any discovered outputs and testing docid\ xdoxji82d8iulanf8c34h (outputs automatically generated but not initially visible), click the checkbox next to the discovered outputs to include them for downstream actions important discovered outputs can be added for further use in the playbook review discovered outputs thoroughly to avoid missing important properties advanced script usage rowan also wants to know how to handle complex data or troubleshoot script errors in the process here’s how he can handle more advanced use cases error handling always validate the input data using conditional statements for example, check if a required field exists before processing it handle exceptions within the script to ensure smooth playbook execution script flexibility the script can support complex python logic, including loops, conditionals, and data transformation functions rowan can use these features to build more advanced scripts example loop through an array of objects example perform a transformation on string data conclusion rowan successfully tested his script, verified discovered outputs, and now has the flexibility to handle more complex data manipulation using python scripts by validating the inputs and checking discovered outputs, he can confidently use this script in downstream actions within the playbook