# Script Executer Job

The Script Executor job is designed to execute code snippets or scripts written in various programming languages such as Go, Julia, and Python. This job allows users to fetch code from their Git repository and execute it seamlessly.

## **Creating a Script Executer Job**

* Navigate to the ***Data Pipeline*** module homepage.&#x20;
* Open the pipeline homepage and click on the **Create** option.

<figure><img src="/files/G7N8V5eH5UYazhTAojRo" alt=""><figcaption></figcaption></figure>

* The new panel opens from right hand side. Click on ***Create*** button in Job option. &#x20;

  * Enter a name for the new Job.&#x20;
  * Describe the Job (Optional).&#x20;
  * **Job Baseinfo:** Select ***Script Executer*** from the drop-down.&#x20;
  * **Trigger By:** There are 2 options for triggering a job on success or failure of a job:&#x20;
    * **Success Job:** On successful execution of the selected job the current job will be triggered.
    * **Failure Job:** On failure of the selected job the current job will be triggered.&#x20;
  * **Is Scheduled?**&#x20;
    * A job can be scheduled for a particular timestamp. Every time at the same timestamp the job will be triggered.&#x20;
    * Job must be scheduled according to UTC.&#x20;
  * **Docker Configuration:** Select a resource allocation option using the radio button. The given choices are:&#x20;
    * **Low**&#x20;
    * **Medium**&#x20;
    * **High**
  * Provide the resources required to run the python Job in the limit and Request section.
    * **Limit:** Enter max CPU and Memory required for the Python Job.&#x20;
    * **Request:** Enter the CPU and Memory required for the job at the start. &#x20;
    * **Instances:** Enter the number of instances for the Python Job. &#x20;
  * **Alert:** Please refer to the [***Job Alerts***](/data-pipeline-5/getting-started/homepage/create/creating-a-new-job/job-alerts.md) page to configure alerts in job.
  * Click the ***Save*** option to save the Python Job.
  * The ***Script Executer*** Job gets saved, and it will redirect the users to the ***Job Editor*** workspace.

  <figure><img src="/files/t3z54VhUlgL9aTThBQpx" alt=""><figcaption><p><em><strong>Cresting a Script Executer Job</strong></em></p></figcaption></figure>

{% hint style="success" %}
*Please go through the demonstration given-below to configure the Script Executor.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6ZP8JhQPMmuTgMyLMcCU%2Fuploads%2FLE3UcSwpDWKC3b3m8BaR%2Fsript%20executor.mp4?alt=media&token=ed446736-89d5-4ef5-abab-a5007e222b62>" %}
***Configuring Script Executer***
{% endembed %}

### **Configuring the Meta Information tab**&#x20;

<figure><img src="/files/daN7Z4BrO1YGLuLHouuk" alt=""><figcaption><p><em><strong>Meta information for the Script Executer</strong></em></p></figcaption></figure>

* **Git Config:** Select an option from the drop-down.
  * **Personal:** If this option is selected, provide the following information:
    * **Git URL:** Enter the Git URL.
      * **URL for Github:** [https://github.com](https://github.com/)
      * **URL for Gitlab:** [https://gitlab.com](https://gitlab.com/)
      * **User Name:** Enter the GIT username.
      * **Token:** Enter the Access token or API token for authentication and authorization when accessing the Git repository, commonly used for secure automated processes like code fetching and execution.
      * **Branch:** Specify the Git branch for code fetching.
      * **Script Type:** Select the script's language for execution from the drop down:
        * **GO**
        * **Julia**
        * **Python**
      * **Start Script:** Enter the script name (with extension) which has to be executed.
        * For example, if Python is selected as the Script type, then the script name will be in the following format: ***script\_name.py***.
        * If ***Golang*** is selected as the Script type, then the script name will be in the following format: ***script\_name.go***.
      * **Start Function:** Specify the initial function or method within the Start Script for execution, particularly relevant for languages like Python with reusable functions.
      * **Repository:** Provide the Git repository name.
      * **Input Arguments:** Allows users to provide input parameters or arguments needed for code execution, such as dynamic values, configuration settings, or user inputs affecting script behavior.
  * **Admin:** If this option is selected, then ***Git URL, User Name, Token & Branch*** fields have to be configured in the platform in order to use Script Executor.
    * **In this option, the user has to provide the following fields:**
      * **Script Type**
      * **Start Script**
      * **Start Function**
      * **Repository**
      * **Input Arguments**

{% hint style="info" %}
*<mark style="color:green;">**Please Note:**</mark>* Follow the below given steps to configure ***GitLab/GitHub*** credentials in the ***Admin Settings*** in the platform:

* Navigate to ***Admin >> Configurations >> Version Control***.
* From the first drop-down menu, select the *Version*.
* Choose '***DsLabs***' as the module from the drop-down.
* Select either ***GitHub*** or ***GitLab*** based on the requirement for Git type.
* Enter the host for the selected Git type.
* Provide the ***token key*** associated with the Git account.
* Select a ***Git project***.
* Choose the ***branch*** where the files are located.
* After providing all the details correctly, click on '***Test***,' and if the authentication is successful, an appropriate message will appear. Subsequently, click on the '***Save***' option.
* To complete the configuration, navigate to ***My Account >> Configuration***. Enter the ***Git Token*** and ***Git Username***, then save the changes.
  {% endhint %}

<figure><img src="/files/UaJmISoWeU6JvmI33Cug" alt=""><figcaption><p><em><strong>Setting GitLab/GitHub credentials under My Account</strong></em></p></figcaption></figure>

<figure><img src="/files/kzUVw3r3Uol8SUB1eMnC" alt=""><figcaption><p><em><strong>Setting GitLab/GitHub credentials under My Account>>Configuration</strong></em></p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bdb.ai/data-pipeline-5/getting-started/homepage/create/creating-a-new-job/script-executer-job.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
