You can use sub-playbooks to define repeatable activities to use within other
playbooks.
You can design a sub-playbook to act on input data from the parent playbook. You can also design
a sub-playbook to run an activity without reliance on input data.
You create a sub-playbook from a playbook or sub-playbook.
-
Open the playbook where you plan to create the sub-playbook.
- Click the Sub-playbooks icon in the
Library.
- Click Create sub-playbook.
If you have any unsaved
changes to the parent playbook, you are prompted to save or discard them.
- Provide a name for the sub-playbook. Make sure that the name is unique and
descriptive.
The API name field is automatically populated with
the same name as the Name field but with underscores for spaces. You can
change the API name to meet the need of your app developers, although it is not usually
done.
- Provide a description for the sub-playbook. Make sure that the description is unique and
descriptive.
- Click Create.
The Start Point
panel displays. Initially, the Inputs and Outputs tabs
are empty. When editing a sub-playbook, the Outputs tab contains static
information that is designed to assist the designer understand the expected output of the
sub-playbook. It does not contain the actual output result.
- Click Create inputs at the end of the panel.
- If you choose to have users enter data when the sub-playbook starts, create a form under
Declare inputs.
The form can consist of one or more fields.
- In Form element type, select the type of field.
- In Input field label, enter a name for the
field.
Make the name meaningful to assist the user in entering data.
The
API name field is used for programmatic access and is automatically populated
with the same name but with underscores for spaces. You can change the API name to meet the need of
your app developers, although it is not usually done.
- In Requirement, select Optional if the
user does not need to complete the field or Always if the user must complete
the field.
- In Tooltip, if needed, provide descriptive but brief text for a
tooltip.
The tooltip text displays after the input field in the sub-playbook details
panel.
- In Placeholder value, if needed, enter a value that is shown in
the field. The value can be a common entry or a value that helps the user to determine what data is
needed.
- For a select or multiselect field, click Edit by the
Values field then enter all the values that the user can choose from.
Afterward, click Save next to the field then choose the default
value.
- When done, click Add form element.
The field is
displayed in the Form elements section. If you have multiple fields, you can
change the order of the fields by dragging them.
- If you need extra inputs, you can repeat these steps.
- Scroll down or click Select object type in the navigation panel.
Then, choose the object type.
The object type defines the type of input data from the
parent playbook. The type is restricted by the parent playbook. If you select Data
Table as the object type, you must also select a specific data table.
- If you choose, you can provide the users with information about the expected output
result of the sub-playbook, as described in Outputs.
- Click Done.
- Use the library to create your sub-playbook as you would a standard playbook. For more
information, see Building the playbook.
- When done, configure each End point on the canvas with the result value, or configure the
End point to show that no result is expected.
For sub-playbooks only, the End point can
make the result of the sub-playbook available to the parent playbook.
- Click the End point to open its panel.
- In the End point panel, click Create playbook
result.
If the End point was previously configured, click Edit
playbook result.
- Provide a script where the sub-playbooks result is stored in
playbook.results
. If the sub-playbook does not provide a result by
design, enter playbook.results = None.
- When finished, click Done.
- Click Save to save your changes.
- Enable the sub-playbook, as described in Enabling a playbook.
The sub-playbook is available in the playbook where you created it. It also appears in the
library of every playbook. When you add a sub-playbook to a playbook, you need to configure its
inputs and outputs, as described in Sub-playbook.