SGO Mistika: Python Extension
Loading...
Searching...
No Matches
Workflows Node Property Schemas (.xsd)

Overview

In Workflows, a Python node typically relies on three kinds of artifacts:

  • Node code (nodeName.py): defines behavior and creates properties/connectors (usually in init()).
  • Property schema (nodeName.xsd): defines which properties are visible in the GUI and which editor widget is used.
  • Node defaults (nodeName.xml): stores the default values that appear in Preferences for that node.

The important distinction is:

  • The Python code defines the properties (name, existence, runtime behavior).
  • The XSD defines the UI (visibility, ordering, and widget type).
  • The XML defines default values for node preferences.

Naming & folder locations

XSD schema files

XSD files are stored under:

  • SGO AppData/shared/config/schemas/nodeName.xsd

The file name must match the node name. A common approach is to start from an existing schema (for example the standard python.xsd) and add/remove the properties you want.

Python node files

Python node implementations are commonly stored under:

  • SGO AppData/shared/workflowsLibrary/nodeName.py

Node default values (Preferences)

Default values are stored per node in a dedicated XML file under:

  • SGO AppData/shared/users/nodeName.xml

This is what makes the node appear in the Preferences area for editing default values.

Minimal XSD anatomy

A typical node schema is a standard XSD document using the SGO namespace (http://www.sgo.es/xsd/2026/sgo.xsd) and defining a root element with a sequence of property elements.

<xsd:schema xmlns:sgo="http://www.sgo.es/xsd/2026/sgo.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element sgo:categoryType="categoryCollapsible"
name="MyNode"
sgo:visibility="0"
sgo:sortOrder="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="objectName" type="xsd:string" sgo:visibility="0" sgo:sortOrder="0"/>
<xsd:element name="color" type="color" sgo:visibility="0" sgo:sortOrder="1"/>
<!-- Your custom properties go here -->
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Core attributes used in practice

The examples shipped in the Workflows documentation commonly use these attributes:

  • name: the Python property id (must match a property created by code).
  • type: the widget/editor type (SGO custom type names + XSD built-ins).
  • sgo:sortOrder: controls ordering in the Properties panel.
  • sgo:visibility: typically 0 for visible fields in examples.
  • sgo:properties: a pipe-separated list of extra widget flags/settings.

Visibility rules

Showing a property in the GUI

To show a property in the Properties panel, two conditions must be true:

1) The property must exist in the node code (typically added in init() with addProperty() or addEncryptedProperty()).

2) The property must be present as an xsd:element in the node XSD file.

If the property exists in code but is missing from the XSD, it remains usable from Python but it will not be visible/editable in the GUI.

Hiding internal properties

The simplest way to hide internal properties is to remove them from the XSD (or never add them). This is commonly used to hide advanced fields such as code or schemaName once a node is finished and intended for non-programmer users.

Dynamic visibility at runtime

Workflows can change visibility at runtime from Python code using:

self.setPropertyVisible("someProperty", False)
self.setPropertyVisible("someProperty", True)

Important: the property must already exist in the XSD, otherwise there is no widget to hide/show.

Common widget types

This section lists widget types that are explicitly shown in the public Workflows documentation. Additional widget types may exist in your installed version; use existing .xsd files in the schemas folder as reference for the full set.

Basic scalar types

  • xsd:string: free text field.
  • xsd:boolean: checkbox.
  • xsd:anyURI: file/path-like fields are often represented as URIs in some cases.

color

  • color: a color picker field (used by the standard color property).

textEditor

  • textEditor: multi-line editor (commonly used for the code property).

universalPath

  • universalPath: a path selector widget that supports file/folder selection patterns.

Example:

<xsd:element name="dstFile"
type="universalPath"
sgo:visibility="0"
sgo:sortOrder="10"
sgo:properties="pathNameFilters('All Files (*.*)')|fileDialogWindowTitle('Select a File')"/>

Pulldown widgets (combo boxes)

integerPulldown

A fixed list of labeled integer values:

<xsd:element name="myTime"
type="integerPulldown"
sgo:integerPulldownValues="One second$$$1|One minute$$$60|One hour$$$3600"
sgo:visibility="0"
sgo:sortOrder="10"/>

stringPulldown

A string pulldown whose values are obtained dynamically from another property. In Python, you populate a property (typically a hidden/internal one) with the list of options, and then configure the GUI property to pull from it:

def init(self):
self.addProperty("bet")
self.addProperty("_championsLeagueFinalists")
self._championsLeagueFinalists = ["Real Madrid", "Chelsea"]
return True
<xsd:element name="bet"
type="stringPulldown"
sgo:actionType="getDataFromProperty"
sgo:actionTypeProperties="_championsLeagueFinalists"
sgo:visibility="0"
sgo:sortOrder="10"/>

sgo:properties flags (common patterns)

The sgo:properties attribute is a pipe-separated (|) list of widget flags and settings. The public documentation provides examples such as:

  • readOnly: makes the UI control read-only.
  • urlVisibleButtonBrowser: shows a browser-style button for URL/path widgets.
  • pathNameFilters('...'): sets file type filters for the file dialog.
  • fileDialogWindowTitle('...'): customizes the dialog title.

Example:

<xsd:element name="inputFile"
type="universalPath"
sgo:properties="readOnly|urlVisibleButtonBrowser|pathNameFilters('All Files (*.*)')|fileDialogWindowTitle('Select a File')"
sgo:visibility="0"
sgo:sortOrder="11"/>

Encrypted (masked) properties

If you need to obfuscate a value such as a password, create it from Python as an encrypted property:

self.addEncryptedProperty("pwd")

Encrypted properties are stored encrypted and are not displayed in clear text.

Note: the encryption/masking behavior is defined by the node API (property creation) rather than by XSD. The XSD still controls whether the property is visible in the GUI.

Tooling: editing schemas

For simple cases, editing XSD files manually is often sufficient. For more complex schemas (many properties, groups, and layout design), Workflows provides a "Properties editor" panel where you can drag & drop properties and build the schema visually.

Troubleshooting checklist

If a property does not appear (or behaves oddly) in the Properties panel:

  • Verify the property is created in init() (or elsewhere before first GUI render).
  • Verify the property is present in the node XSD file with the exact same name.
  • Verify the XSD file is in SGO AppData/shared/config/schemas and matches the node name.
  • If using runtime visibility (setPropertyVisible), verify the property exists in XSD first.

Discovering available widget types

The most practical way to discover all available widget types in your installed version is:

1) Inspect the shipped schemas in SGO AppData/shared/config/schemas. 2) Search for type="..." occurrences across the folder. 3) Use existing node schemas as reference when adding new properties.

This approach ensures you document and use only the types that your deployed Workflows build supports.


Generated for SGO Mistika: Python Extension by SGOdocBot