AlteryxEngine
The AlteryxEngine class is a reference class to extend the class members of an Alteryx Engine object instantiated within the running Alteryx process.
Engine information

- info
- warning
- error
- complete
- field_conversion_error
- field_conversion_limit_reached
- disabled
- file_input
- file_output
- update_output_meta_info_xml
- update_output_config_xml
- request_auto_config_refresh
- document_temp_file
- temp_directory
- file_dependency
- cache_temp_file
- low_disc_warning
- safe_mode_error
- restricted_data_set_error
- choose_from_multiple
- preview_fail
- output_field_names
- output_record
- record_count_string
- simultaneous_too_many
- browse_everywhere_file_name
- data_profiling

field_conversion_error_limit: The maximum number conversion error messages to display. This limit value only affects the number of field conversion error messages that are displayed.
Methods

Converts the metadata dictionary into xml written to the Connect log.
CreateConnectMetaData(int nToolID, dict metadata) -> void
Metadata dictionary can contain any of the following keys:
- DatabaseVersion
- DriverType
- DriverVersion
- Host
- Port
- Query
- Database
- Schema
- Table
- PluginName

Returns a newly created unique temp file path from the Engine; the Engine cleans up the file later.
create_temp_file_name((str)extension='tmp', (int)options=0) -> str :
Supported options include:
- 0: A normal temp file.
- 1: A temp file for a GUI element, such as a browse, that the GUI is responsible for cleaning up.
-
2: A temp file for a GUI element, such as a browse, that the GUI is responsible for cleaning up. Additionally, the file name is not made to be unique. Use when the extension argument already contains a unique ID.
extension = 'InputCache_12345678.yxdb'

Returns a string of encrypted or decrypted text. Works with user and machine encryption.
decrypt_password(encrypted_password, mode) -> str :
encrypted_password: The text to be treated.
Supported options include:
0: Decrypt.
2: Machine encryption
3: User encryption

Returns the finite ordered list [str name, str alt_name, str value, bool is_numeric] where alt_name is based on the connection name.
get_constant((int)tool_id, (int)which) -> object :
Returns None if the which argument is invalid.

Returns the value of a global init_var from the Engine.
get_init_var((int)tool_id, (str)var_name) -> str :
Valid variables include:
- ActionApplies: Returns "True" or "False" if there is a wizard action referring to this tool.
- AllowDesktopInteraction: Returns "True" or "False".
- DefaultDir: Returns the directory that should be used for relative paths.
- EnablePerformanceProfiling: Returns"True" or "False".
- NumThreads
- OutputRecordCounts: Returns "True" to output record counts, False to not
- RunMode: Returns "Safe", "SemiSafe" or "Standard". Used for web "safe-ness".
- RunningAsWizard: Returns "True" or "False".
- RuntimeDataPath
- SerialNumber: Returns the Alteryx serial number
- SettingsPath
- TempPath: Returns a path for a temp file. Use create_temp_file_name for similar functionality that automatically deletes the temp file when Alteryx closes.
- UpdateMode: Returns "", "Quick", or "Full".
- UpdateOnly: Returns "True" or "False".
- Version: Returns the Alteryx Engine version in the form of "2.1.0.3".

Notifies the Alteryx engine of any messages generated by a tool. Set tool_id to -1 for a global error not related to a tool.
output_message((int)tool_id, (int)status, (str)message) -> int :
Returns 1 if the plugin should stop processing, otherwise returns 0.
status: A value of AlteryxPythonSDK.status.

Displays messages in the results grid or console window if the workflow user constant EnableDebugMessages is set to True.
If set to anything else, or not set, it will not output messages.
debug_message_out((int)tool_id, (int)status, (str)message) -> int :
Returns 1 if the plugin should stop processing, otherwise returns 0.
status: A value of AlteryxPythonSDK.status.

Notifies the Alteryx engine of a tool's progress.
output_tool_progress((int)tool_id, (float)percent_progress) -> int :
Returns 1 if the plugin should stop processing, otherwise returns 0.
- tool_id: The ID for the tool calling the function.
- percent_progress: The percent completion for the tool. The percentage must be in the range [0.0,1.0].
Progress update requests
A plugin is asked by upstream tools or the engine to update its progress through the ii_update_progress method. It is the responsibility of the plugin to request that any downstream tools likewise update their progress by calling update_progress on OutputAnchor.

Pre-sorts an incoming data connection. pre_sort may only be called during pi_add_incoming_connection.
pre_sort((str)incoming_connection_type, (str)incoming_connection_name,
(str)sort_info) -> None :
- incoming_connection_type: The type of the connection.
- incoming_connection_name: The name of the connection.
- sort_info: The XML text that defines the fields to sort and optionally filter the input data by.
Write the XML string in the format:
<SortInfo>
<Field field="SortField1" order="Asc" />
<Field field="SortField2" order="Desc" />
...
</SortInfo>
<FieldFilterList>
<Field field="FilterField1" />
<Field field="FilterField2" />
...
</FieldFilterList>
If the FieldFilterList section is not specified, all fields are passed through.