Pre-requisites:
Required role privilege 'Manage Workflow Rules' on the project where a system task needs to be created.
Steps to create a system task for executing groovy script on custom objects in a project are as mentioned below:
1. Follow the steps to create system task for Custom Objects (steps 1 to 4).
2. In the task dropdown, select 'Execute Groovy Script'.
3. Upon selecting 'Execute Groovy Script' option, the page expands and enables you to configure complex system tasks by using the groovy script i.e. by writing own groovy scripts. Click on maximize icon to maximize and minimize icon to minimize the groovy script view as needed.
Click here to view full Groovy Script Library containing sample groovy scripts. If you want to create some complex tasks using groovy scripts, you need to contact your Asite Account Manager.
Select the checkbox 'Automatically resume the workflow in case of failures' to run the workflow again in case it fails due to any reason. If this option is selected in the groovy script system task of your project, the configured script will run automatically for next couple of times in the event of a failure.
4. Once done, click on 'Create' button to complete creating a system task.
You can create independent system tasks which can be executed using workflow triggers without adding them to a complex workflow.
All system tasks are performed by system automatically based on the condition defined in related workflow trigger. It appears in related custom object's audit history & task assignment emails as performed by 'Workflow Agent'.
Related Articles: Create a System Task - Executing Groovy Script on Forms (in a Project), Create a System Task - Executing Groovy Script on Files (in a Project)
Next Article: Create a System Task - Sending email notifications specific to Custom Objects (in a Project)