Generic event workers can execute custom code independent of any events in the JFrog Platform.
From the Administration module, click Workers.
The Workers screen appears.
Select the New tab.
The Create Workers section appears that lists all the types of workers that you can create. The Artifactory section lists workers with a predefined action.
The Generic section lists workers that do not have a predefined action.
Click Add on the required type of worker.
Configure the worker in the Generic Event Worker screen.
Enter the name and description of the worker.
Create your worker code in the the code editor area.
As you type in the code, the editor provides you an auto-complete function that boosts your productivity.
Click Add Secret.
The Secrets screen appears, where you can add secrets to the worker.
Enter the name and a value for a secret.
Click Add Secret if you want to add more secrets.
You can edit the JSON payload in the GenericEventRequest pane.
You can use this payload to be injected as the second parameter in your worker function. You can use this to simulate the payload the worker receives in the event.
Click Run Test to test the worker.
The results appear in the Execution Results pane.
You can enable the worker with the Enabled switch.
You can also save the worker and enable it only when required. You can enable the worker by editing the workers from the Configured tab in the Workers screen.
Click Save to save the worker.