When creating actions, an understanding of how variables work is important and not always immediately obvious. To the right of the editor, the Variables pane is found, as shown below, where the variables available to the file currently open in the editor are defined.
In the Variables pane, you see the Inputs section and the Outputs section, as outlined below.
The following variables are defined in the Inputs section.
During the runbook run, the input parameters outlined above are accessible via the inputs variable, shown below, which you can rename to any name, but is always received in the signature of the operation, from where it can be processed:
def execute(inputs):
# Retrieve parameters
input_param = inputs.get("input_param")
The execute operation is special because you are able to define outputs, as can be seen in the lower part of the Variables pane above, where the Outputs section is found. The Outputs section shows what your operation is going to output.
Currently, if you create a new operation, the Outputs section will be shown, without content. This is a bug because these outputs do not do anything because the newly created untitled operation is not the execute operation, which is one specific operation marked as such in the Deploy tab. However, to be able to access values from the input in any operation, you need to define those inputs in the Inputs section of the newly created untitled operation, as well as any other operation, such as the execute operation.