- 20 Dec 2024
- 2 Minutes to read
- Print
- DarkLight
Python Module
- Updated on 20 Dec 2024
- 2 Minutes to read
- Print
- DarkLight
Module Details | |
Core or Github Module | Core |
Restart Required | No |
Steps Exposed | Yes |
Step Location | Integration > Python |
Settings Location | System > Settings Python Module Settings |
Prerequisites |
|
The Python Module allows custom scripts written in Python to be created and used as steps inside a Flow. In order the utilize the module the file path must contain the Python executable to be ran. For example, C:\Program Files\Python\python.exe will be entered in Python Module Settings.
Settings
Navigate to System > Settings. Click on Python Module Settings and enter the full file path to the Python executable. Click SAVE once the file path has been configured. In order to update the file path, Decisions must be restarted.
Feature Details | |
Introduced in Version | 8.10 |
Modified in Version | 9.6 |
Location | System > Settings > Python Module Settings |
Python Module in Container
/usr/bin/python3
.After installing the Python Module, users need to point Python Module Settings path to
/usr/bin/python3
.Creating Script Projects
Script Projects house Python Scripts that will be generated as steps. They are mainly used for organization, as the name of the Script Project will appear as a sub-category under Integrations > Python in the step Toolbox.
- Navigate to [Project Name] > Manage > Integrations > Scripting > Python. Right-click Python Script Projects and select Add Script Project. Name the project and click SAVE. This action is not available in v9.0 or v9.1.
Python Scripts as Flow steps
- To add the Python Script to a Flow, navigate to Integrations > Python. Then, select the Python project and select the script and click ADD.
- With the step selected, change the input value mappings to Constant and enter "Hello" for string1 and "World" for string2.
- Add a Show Popup step to the Success path. Enter "Message" as the Subject. Click Unknown next to the Message field and select Select From Flow. Select Script Output [String] and click DONE.
- Connect the Error path and Done path to the End step.
- Click Save to save changes to the Flow. In the Flow Designer select Debug and view inputs/outputs to the step. If the step succeeded, the output will display the configured result in the script.
Execute Python Script Step
The Execute Python Script step allows Python Scripts to be executed without the need to create a Script Project. However, only parameter values can be passed to the script, the values cannot be defined in the Flow.
Input | Description |
---|---|
Parameter(s) | The parameter inputs to the Script. |
Script File | Similar to the File input when configuring a Script as a Flow step, this will be the file containing the Python script. |
Working Directory | The input controls the first location used to search for the Python executable, along with being the location custom files will be outputted from the script. |
Feature Changes
Description | Version | Release Date | Developer Task |
---|---|---|---|
Added the right click action "Add Script Project" to the Python folder. | 9.2 | August 2024 | [DT-041379] |
Script folders now have a delete action. | 9.6 | January 2025 | [DT-042782] |