Workflow 6

Running Scripts Using Script Executor Job

This workflow focuses on utilizing the Script Executor job to execute scripts written in various programming languages such as Go, Julia, and Python.The workflow demonstrates how to seamlessly fetch code from a Git repository and run it within the platform. This provides flexibility in handling diverse coding requirements while enabling efficient and automated script execution across different environments.

Create the Script Executor Job

· Navigate to the Data Pipeline module from the app menu.

· Select Jobs and Click the “Create” icon to begin job creation.

· In the job setup window, provide:

o Job Name: e.g., Workflow6

o Description: e.g., Script Executor Job

· From the job type dropdown, select Script Executor.

· Click Save.

You’ll now be directed to the Job Canvas to begin configuring components.

Configure the Script Executor Component

· Click on the newly created Script Executor job component.

· In the Meta Information tab, configure the Git connection:

o Git Configuration: Select Personal

o Git URL:

§ For GitHub: https://github.com

§ For GitLab: https://gitlab.com

o Username: Your Git username

o Access Token: Personal access token or API token

o Branch: Branch name where your script resides

o Script Type: Choose from Go, Julia, or Python

o Start Script: Filename of the script (e.g., main.py)

Start Function: Function to execute (e.g., execute_script)

o Repository Name: Name of the repository

Upload your script to the Git repository if not already available:

o Go to your GitLab or GitHub repository.

o Click Upload File.

o Select and upload your local script file.

· Return to the BDB platform and ensure all mandatory fields are configured correctly.

Activate the Script Executor Job

· Click the Update icon to save changes.

· Click the Activate icon (green button on the top right).

· The platform redirects you to the Advanced Job Status section.

Here, you can:

  • Monitor job status

  • Confirm all associated pods are running

  • Click Logs to view execution details

  • Identify any issues or errors during the run

Once the job runs successfully, a confirmation message will appear.

Check the execution logs to verify that the script was fetched and executed as expected.

Sample Python Script for Script Executor

Below is a sample Python script that adds two numbers. You can use this as a starting point for your own scripts:

# Example Python script for Script Executor component

def execute_script():

# Sample Logic: Adding two numbers

num1 = 10

num2 = 20

# Perform the addition

result = num1 + num2

# Print the result

print(f"The sum of {num1} and {num2} is {result}")

# Ensure that the script is executed when the file is run

if __name__ == "__main__":

execute_script()

Make sure the filename ( script.py) and the start function (execute_script) match the fields you configure in the platform.

Conclusion

Congratulations! You’ve successfully completed Workflow 6 using the Script Executor job on the BDB platform. You've learned how to:

  • Connect to a Git repository

  • Execute external scripts inside BDB

  • Monitor and verify execution through job logs

This workflow enables seamless integration of external logic into BDB, promoting reusable, scalable, and flexible solutions across data teams.

Last updated