Creating a sub-playbook

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.

  1. Open the playbook where you plan to create the sub-playbook.
  2. Click the Sub-playbooks icon in the Library.
  3. Click Create sub-playbook.
    If you have any unsaved changes to the parent playbook, you are prompted to save or discard them.
  4. 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.
  5. Provide a description for the sub-playbook. Make sure that the description is unique and descriptive.
  6. 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.
  7. Click Create inputs at the end of the panel.
  8. 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.
    1. In Form element type, select the type of field.
    2. 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.
    3. In Requirement, select Optional if the user does not need to complete the field or Always if the user must complete the field.
    4. 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.
    5. 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.
    6. 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.
    7. 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.
    8. If you need extra inputs, you can repeat these steps.
  9. 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.
  10. If you choose, you can provide the users with information about the expected output result of the sub-playbook, as described in Outputs.
  11. Click Done.
  12. Use the library to create your sub-playbook as you would a standard playbook. For more information, see Building the playbook.
  13. 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.
    1. Click the End point to open its panel.
    2. In the End point panel, click Create playbook result.
      If the End point was previously configured, click Edit playbook result.
    3. 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.
      For more information, see Playbook operations.
    4. When finished, click Done.
  14. Click Save to save your changes.
  15. 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.