workflow — Python Integration for Editorial Workflows

The workflow module defines functions that can be used in Run Python Script and Custom Action (Advanced) workflow actions.

workflow.get_input()

Returns the input that was passed to this action as output from the previous action.

workflow.get_parameters()

Returns the parameter values of the currently running custom action as a dictionary. In regular script actions, it simply returns an empty dictionary.

The type of each value depends on the parameter type: Text parameters are represented as unicode strings (with all variables already resolved), switch parameter values are True or False, and single choice parameter values are the (zero-based) index of the selected option.

workflow.set_output(string)

Sets the text that is passed to the next workflow action.

workflow.get_variable(name)

Gets the value of a variable that was set with a Set Variable action elsewhere in the workflow.

workflow.get_view()

If a “Custom UI” action is currently running, return its root view (otherwise None).

workflow.set_variable(name, value)

Sets the value of a workflow variable.

Note

In order to be able to use this variable in other actions, it has to be defined in a regular Set Variable action as well.

workflow.stop()

Stops the workflow after the script has finished running. To stop the workflow immediately, you can raise a KeyboardInterrupt.