# Automation based on runtime scripts
Automation based on runtime scripts consists of two parts:

a. The script itself, which performs the necessary actions

b. Creating and configuring an **event trigger** or **schedule trigger**

## I. Creating scripts

1. Write the necessary script in Python
2. Log in to Swarmica and go to the Settings > Scripts section, click Create and create a script entity
3. In the Script field, upload the previously created script

## II. Creating and configuring a trigger

1. Go to the Settings > Event Action section and click Create
2. Fill in the fields [event type](https://support.swarmica.com/article/ru/913-kody-sobytij-v-swarmica.html), for example TicketEvent for ticket events
3. Action type: Script
4. Action - select the previously created and uploaded script from the list![](https://support.swarmica.com/attachments/B/2/B2afP2v1HiqfW0iv_a/image.png)
5. Start the trigger by clicking ![](https://support.swarmica.com/attachments/L/Q/LQw5cdGASfXptqJH_a/image.png)