Getting Started With Scripts

A Script Rule allows you to send information to a custom script running on a remote agent.

To create a new script rule:

  1. On the Rules page, select the arrow beside New and select Script as your rule type.
  2. In the Create Script dialog box, specify the Name and Description for your rule, as well as the remote agent where your script will run.

    Note: Ensure that the selected remote agent contains a queue with the Remote Script Source Plugin.

  3. Click Create.
  4. In the Rule editor page, specify the location of the .dll/.py/.js file on the remote agent host (for example, "C:\ProcessAutomationWorker\bin\Script.dll"). For C# scripts, include the class name and the entry point name. If your C# class library contains multiple entry points, create another rule to access the additional entry points.

    Note: By default, scripts must be located within the bin subfolder within the remote agent worker installation folder (for example, C:\ProcessAutomationWorker\bin).

  5. Optional: Modify the the plugin_settings.json file within the remote agent worker installation's bin subfolder to allow the worker to access additional paths on the remote agent computer. Append additional paths to the AllowList attribute in the RemoteScriptSourcePlugin block. For example, if you would like to open up access to the entire C:\ drive and a shared network path, you can update the attribute to "AllowList": [ "C:\\", "\\\\samplehost\\scriptsfolder" ]. If you have multiple remote agent workers, it is recommended that all scripts be located in a single directory accessible by all of the workers. The remote agent worker service user must still have appropriate Windows access rights to any specified paths. After the remote agent local configuration is modified, the remote agent service must be restarted for changes to take affect.
  6. Add any input or output parameters used.
  7. Test your script by clicking the Test Script button. The output values will be displayed in the Text box at the bottom of the page. If you do not have any outputs configured you will just get a generic success message. If your script performs actions on the remote agent host, please verify the expected output is available.
  8. Publish the rule to make it available for Workflow.
  9. Create a workflow and add a Run Script Rule activity to run your script. Select the rule created in the previous steps. Specify the input values with either static values or workflow tokens. The output values will be available as tokens in the rest of your workflow.

Related Topics:

Visit the Laserfiche Git page to download blank script templates for your C#, Node.js, or Python scripts.