Managing SL1 PowerFlow Applications

Download this manual as a PDF file 

This section describes how to use the Applications page () of the PowerFlow user interface to view, run, and schedule PowerFlow applications. You can use the PowerFlow builder to create custom applications, and those applications can use "flow control" operators that enable logical branching and data transformation between steps.

PowerFlow and SyncPacks content not created by ScienceLogic is not supported by ScienceLogic. This includes custom steps, PowerFlow applications, and SyncPacks.

The following video explains how to build low-code integrations with PowerFlow builder:

Viewing the List of PowerFlow Applications

The Applications page () provides a list of available PowerFlow applications on your PowerFlow system. From this page you can schedule, edit, view, and create applications and steps.

You can search for a specific application by typing the name of that application in the Search field at the top of the Applications page. The user interface filters the list as you type. You can also filter the list by typing in the text box above a column header, and sort by clicking most column headers.

The Applications page displays the following information:

  • Application Name. Lists the name of the application.

  • Version. Lists the version of the application.

  • SyncPack. Lists the name of the SyncPack (or "SyncPack") to which a specific application belongs, where relevant. You can click the name of the SyncPack to which an application belongs to go to the SyncPack page for that pack.

  • Edited. List the date and time for when the application was last edited by a user.

  • Last Run. Shows the current status of all of the PowerFlow applications:

    Icon Status

    The application ran successfully.

    The application is currently running. An application can have one of the following statuses:

    • Started. The application is currently running. 
    • Pending. The application has not run or will not run.

    If you stop the application, the next tasks will not run.

    The application failed to run successfully.

    -

    The application has not been run.

  • Actions. Contains the following icons, or, if the browser window is not fully maximized, displays the Actions button () with the following options:

  • The Schedule button lets you use the Scheduler to define how often or at what time to run an application. A scheduled application displays a check mark in the Schedule button on this page. For more information, see Scheduling a PowerFlow Application.
  • The Favorite button () lets you select the applications that you want to see in the Favorite Applications widget on the PowerFlow Control Tower page.
  • The Actions button () for an application gives you the option to run, view, or delete that application. You cannot run an application in Debug Mode or run an application with custom attributes from this menu. Click View to open the Application detail page if you want to use Debug Mode and custom attributes.

Some of the applications on the Applications page are internal applications that you should not run directly. Instead, other "parent" applications run these internal applications. To view the internal applications, click the Filter icon () at the top right of the Applications page and select Show Hidden Applications. Internal applications are hidden by default.

To view the applications that belong to only one SyncPack or some of the SyncPacks, click the Filter icon () and select the SyncPacks that you want to view from the Filter by SyncPack drop-down. To go back to seeing all applications on the Applications page, click Clear selected items.

To open the Notification Center pane, which contains a list of all of the pop-up messages about PowerFlow applications that were run successfully or with warnings or failures, click your user name in the navigation bar in the top right and select Notifications. The different notifications are color-coded: green for success, yellow for warning, and red for failure. The number of notifications displays as a badge in the menu. For more information about a notification, click the link for the notification and review the Step Log and Step Data tabs for the application steps.

Elements of an Application Page

When you click the name of an application on the Applications page, an Application detail page appears:

The Application detail page contains the logic for the application. In the main viewing pane, the steps for the application are organized as a flowchart. Each rectangular block is a step, and the arrows indicate the order in which the steps will execute when you run the application. The color of each step changes to show the progress of the application run as it runs: green for success, red for failure, and blue for running.

If a step triggers a child application, a blue information icon () appears in the upper left corner of the step. Click the icon to display the triggered application's run as a link in a pop-up window, which lists the run IDs by Success, Failure, or In Progress. You can click the link in the pop-up window to view the detail page for the triggered application. If no run ID is present, the pop-up window displays "No runs available".

Also, you can click the eye icon () next to a step to open a smaller window, also called a "picture-within-a-picture", that displays the step or steps for the triggered application:

Buttons

The buttons at the top of an Application page include the following:

  • Open Editor. Opens the Steps Registry pane and launches the PowerFlow builder interface. The Steps Registry pane contains a list of all available steps in the PowerFlow builder.

    After you click Open Editor button, the following buttons appear in the top navigation bar:

    • Close Editor. Closes the Steps Registry pane.
    • Save. Lets you save any changes to the steps and application. You can also save the edited application as a new application with new metadata using the Save as option.
    • Metadata. Opens the Integration Metadata window for that application so you can update the description, version, or author of the application.

    For more information, see Editing an Application.

    If your current ScienceLogic SL1 solution subscription does not include the SL1 PowerFlow builder, contact your ScienceLogic Customer Success Manager or Customer Support to learn more.

  • Reports. Displays a report of the results of this application, where applicable. For more information, see Generating and Viewing Reports for PowerFlow Applications.

  • Timeline. Opens the Timeline view at the top of the window where you can view past runs of this application, and whether the application failed or succeeded. For more information, see Viewing Previous Runs of an Application.

  • Replay. Replays the last run of this application. If you hover over this, you can choose from the following options:

    • Info Replay. Replay the last run the application in Debug Mode, which provides more log data in the Step Logs to help you with troubleshooting.
    • Custom Replay. Replay the last run of the application with custom parameters for testing or troubleshooting.
  • Run. Runs the application if you click the button without hovering over it. If you hover over the Run button, you can choose from the following options:

    • Info Run. Run the application in Debug Mode, which provides more log data in the Step Logs to help you with troubleshooting.
    • Custom Run. Run the application with custom parameters for testing or troubleshooting.

    You can click Run to run an application and then navigate to another page in the PowerFlow, and the application will complete on its own.

    For more information, see Running a PowerFlow Application.

  • Configure. Opens the Configuration pane for the application, where you can change the configuration object aligned with the application and edit other configuration variables as needed. For more information, see Aligning a Configuration Object with an Application.

Click the Zoom icons (,) to change the size of the steps on the PowerFlow builder.

Click the Rotate icon () to turn the PowerFlow builder 90 degrees. Starting with PowerFlow Platform version 2.4.0, the flowcharts display horizontally by default instead of vertically.

Click the Manual refresh icon () to refresh the Application page.

Status Messages

In the bottom left-hand corner of the page, pop-up messages appear temporarily with the status of the application or an action. In the example above, the status is "Run: success". Click the close button on the message to close the message.

Step Pane

The Step pane at the bottom of an Application page displays two tabs:

  • Step Log. Displays the time, the type of log, and the log messages from a step that you selected in the main pane. All times that are displayed in this pane are in seconds.
  • Step Data. Displays the JSON data that was generated by the selected step.

Click the Step pane again to hide the pane.

For longer step log messages, click the down arrow icon () in the Message column of the Step Log tab to open the message. To copy a message, triple-click the text of the message to highlight the entire text block, and then click the Copy Message icon () next to that message. To copy the entire log, click the Copy Log button.

Creating a Basic PowerFlow Application

On the Applications page, you can create new applications using the PowerFlow builder interface.

To add a flow control operator to an application, such as a Condition, a Transform, or a Trigger Application operator, see Working with Flow Control Operators.

If your current ScienceLogic SL1 solution subscription does not include the SL1 PowerFlow builder, contact your ScienceLogic Customer Success Manager or Customer Support to learn more.

To create a basic PowerFlow application:

  1. From the Applications page (), click Create Application. A Create Application window appears.

  2. Complete the following fields:
  • Friendly Name. The name that you want users to see for this application. Required.
  • Description. A short description of what this application does.
  • Author. The name of the person or company that created this application. Use the same name for multiple applications. Required.
  • Version. The version for this application.
  • Configuration. Select a configuration object to align with the new application, or select Make New Configuration to create a new configuration object.
  1. Click Set Values. The PowerFlow builder interface appears:

  2. On the Steps Registry pane, search for a step or filter the list of steps to help you find the step you need:
  • Click the Search Steps tab () to search the entire list of steps from the Search Steps Registry field.
  • Click the Group Steps tab () to view the steps by SyncPack, by a tag, or to show all of the steps in one list.

    Click the Actions button () on a step in the Steps Registry pane to view more information about that step, including the step ID, the SyncPack for that step, the version, and creator of the step. You can also click Edit Step Code to edit the code for that step, and if the step does not belong to a published SyncPack, you can also delete that step from the registry.

  1. On the Steps Registry pane, select the step you want to add and drag it to the main viewing pane ("canvas"). The Configuration pane for that step appears.
  2. On the Configuration pane, type a new name for the step and update the other fields on the pane as needed. If needed, click the down arrow on the Advanced section to update the advanced fields.

    For example, if you are getting data from SL1, you would type the IP address for your SL1 system, along with the API endpoint in the prefix_url field, such as 10.10.10.1/api/device.

  3. To verify that the parameters you specified are correct and the step is configured correctly, click Run at the bottom of the pane to run the step. 

  4. On the Configuration pane, click Save to save the parameters for the new step. The Application detail page appears again.

    Clicking Save on the Parameters pane only saves the settings for this specific step; it does not save the new application.

  5. Click Save in the top navigation bar to save the new application.

  6. To test your application so far, click the Run button in the top navigation bar. Click the Step Log to view the results of the run on the Step Log and Step Data tab.

  7. Repeat steps 4-10 to add more steps to the application.

    To connect one step to another, click on the bottom of the first step and drag the mouse to the second step. An arrow appears between the two steps, which you can click and drag to reposition.

    To adjust the position of any step on the main viewing pane, click the step you want to move and drag it to its new location. To remove a step from the main viewing pane, click the ellipsis icon () on the step and select Delete.

  8. Click Save to save your work.

    To add a flow control operator to an application, such as a Condition, a Transform, or a Trigger Application operator, see Working with Flow Control Operators.

  1. On the Application detail page, add any additional steps and operators to the new application, and then click Save and the Close Editor button. The application is added to the Applications page.

Working with Flow Control Operators

When you are creating or editing a application in the PowerFlow builder interface, you can use "flow control" operators, including the following operators that you can drag and drop onto the step workflow on the canvas:

  • The Condition operator () lets you create for branching workflows, such as If-Else or If-Then-Else statements. The Conditional Wizard pane lets you modify the conditions that enable branching in the workflow. For more information, see Creating an Application with a Condition Operator.
  • The Transform operator () lets the application pull data gathered by a previous step and modify or transform that data to fit into the next step. The Transform Wizard pane lets you specify which data you want to use or transform from the previous steps. For more information, see Creating an Application with a Transform Operator.
  • The Trigger Application operator () lets you launch another PowerFlow application from within a new or existing PowerFlow application. The Trigger App Wizard pane lets you select the child application you want to launch from the current (parent) application and specify the data that you want to pull from the child application. For more information, see Creating an Application with a Trigger Application Operator.

You can add more than one type of operator to the same PowerFlow application, and you can add more than one operator with the same type as well.

The Flow Control SyncPack contains the "IfStep" step that enables the logical branching used by the PowerFlow builder. This SyncPack is included in PowerFlow.

Creating an Application with a Condition Operator

You can drag a Condition operator () onto an application workflow to create the option for branching flows, such as If-Else or If-Then-Else statements.

To create an automation that contains a Condition operator:

  1. From the Applications page (), click Create Application. A Create Application window appears.
  2. Complete the following fields:
  • Friendly Name. The name that you want users to see for this application. Required.
  • Description. A short description of what this application does.
  • Author. The name of the person or company that created this application. Use the same name for multiple applications. Required.
  • Version. The version for this application.
  • Configuration. Select a configuration object to align with the new application, or select Make New Configuration to create a new configuration object.
  1. Click Set Values. The PowerFlow builder interface appears.
  2. On the Steps Registry pane, search for a step or filter the list of steps to help you find the step you need.
  3. On the Steps Registry pane, click the step you want to add and drag it to the main viewing pane ("canvas"). The Configuration pane for that step appears.
  4. On the Configuration pane, type a new name for the step and update the other fields on the Configuration pane as needed. If needed, click the down arrow on the Advanced section to update the advanced fields.
  5. To verify that the parameters you specified are correct and the step is configured correctly, click Run at the bottom of the pane to run the step. 
  6. On the Configuration pane, click Save to save the parameters for the new step. The Application detail page appears again.
  7. Click Save in the top navigation bar to save the new application.
  8. To test your application so far, click the Run button in the top navigation bar. Click the Step Log to view the results of the run on the Step Log and Step Data tab.
  9. Repeat steps 4-10 to add more steps to the application.
  10. Click Save to save your work.
  1. Click the Run button to run the new application and gather data for the steps that will send data to the Condition operator.
  2. On the Steps Registry pane, click the Advanced tab (). The flow control operators appear.
  3. To add the option for branching flows, such as If-Else or If-Then-Else statements, drag the Condition operator () onto the canvas. The operator displays as a step with an "ifStep" label.
  4. Connect the steps for the branching workflow to the Condition operator by clicking the outline of each step and dragging the arrow that appears to the Condition operator. Repeat this process for all of the steps that should be part of the branching workflow.

    The arrows connecting the steps and the Condition operator display as green to show the flow of the data, based on the values in the application. In Edit mode, you can click the blue circle above a branched step to open the Conditional Wizard pane to see the conditions for that step.

  5. Click the [Save] button and then click the Run button to gather data again for all of the steps that will send data to the Transform operator.

  6. Click the ellipsis icon () on the Condition operator and select Configure. The Conditional Wizard pane for that operator appears.

  7. Click Add New Condition to configure the conditions for the operator:

  8. Complete the following fields on the Conditional Wizard pane for each step you want to include in the branching:
  • Bound to this Step. Specify the step connected to the Condition operator.

  • Label. Type a brief description of the branching condition, such as "Change Request Found". This text will display above the selected step when you are out of Edit mode.

  • Condition type. Select the condition that this step needs to meet to allow branching. The condition type you select here determines what options display in the field or fields below this field. You can use variables from the previous step, which you can find on the Step Data tab of the Step pane for that step. Your options include:

    1. equal. In the Equal to field, type True or False. In the Value field, specify the variable that should be true or false.

    2. numeric. In the Value field, specify the variable that should fall within the range specified by the Above and Below fields .

    3. template. In the Value field, type a condition that can include numeric or another kind or comparison. For example: ${step_name.stop_step} == true

    4. and. Joins two or more conditions with the AND logic operator, and these conditions can be simple or complex conditions. This is the default option.

    5. not. Inverts the result of the simple condition type. This condition can contain only one condition inside of it.

    6. or. Joins two or more conditions with the OR logic operator.

    In a Value field under the Condition type, you can also click the Actions button () and click Select property to use data from one of the previous steps, if available.

  1. You can add a sub-condition for the same step by clicking the Actions button () for the Condition type field and selecting Add sub-condition. You can also click the New condition button to add a sub-condition.
  2. To add another set of conditions in addition to the first set of conditions, click the Add New Condition button and repeat steps 20-21.
  3. Edit the remaining conditions on the Conditional Wizard pane, and then click Save. The Application detail page appears.
  4. Add additional steps and operators to the new application as needed, and then click the Save and the Close Editor buttons. The application is added to the Applications page.

Creating an Application with a Transform Operator

In the PowerFlow builder interface, you can drag a Transform operator () from the Steps Registry pane onto an application workflow.

The Transform operator can pull data gathered by a previous step, and then modify or transform the data to fit into the next step. The operator uses a Jinja2 template to merge the data from previous steps.

For example, you might want to use the Transform operator if a step in an application is pulling in a large amount of data, but you only want to focus on a specific sub-set of that data. The Transform operator lets you filter that data to show only the data you need, and you can use that data in the following steps of the application.

To create an application with a Trigger Application operator:

  1. From the Applications page (), click Create Application. A Create Application window appears.
  2. Complete the following fields:
  • Friendly Name. The name that you want users to see for this application. Required.
  • Description. A short description of what this application does.
  • Author. The name of the person or company that created this application. Use the same name for multiple applications. Required.
  • Version. The version for this application.
  • Configuration. Select a configuration object to align with the new application, or select Make New Configuration to create a new configuration object.
  1. Click Set Values. The PowerFlow builder interface appears.
  2. On the Steps Registry pane, search for a step or filter the list of steps to help you find the step you need.
  3. On the Steps Registry pane, click the step you want to add and drag it to the main viewing pane ("canvas"). The Configuration pane for that step appears.
  4. On the Configuration pane, type a new name for the step and update the other fields on the Configuration pane as needed. If needed, click the down arrow on the Advanced section to update the advanced fields.
  5. To verify that the parameters you specified are correct and the step is configured correctly, click Run at the bottom of the pane to run the step. 
  6. On the Configuration pane, click Save to save the parameters for the new step. The Application detail page appears again.
  7. Click Save in the top navigation bar to save the new application.
  8. To test your application so far, click the Run button in the top navigation bar. Click the Step Log to view the results of the run on the Step Log and Step Data tab.
  9. Repeat steps 4-10 to add more steps to the application.
  10. Click Save to save your work.
  1. Click Run to run the new application and gather data for the steps that will send data to the Transform operator.
  2. On the Steps Registry pane, click the Advanced tab (). The flow control operators appear.
  3. Drag the Transform operator () onto the canvas. The operator displays as a step with a "Jinja2Template" label.

  4. Locate the step or steps that contain data you want to send to the following step or steps. Connect the step or steps to the Transform operator by clicking the outline of each step and dragging the arrow that appears to the Transform operator.
  5. Connect the step or steps that will receive the transformed data by clicking the outline of the Transform operator and dragging the arrow that appears to those steps.

    The arrows connecting the steps and the Transform operator display as green to show the flow of the data, based on the values in the application.

  6. Click the Save button and then click the Run button to gather data from the step or steps that will send data to the Transform operator.
  7. Click the ellipsis icon () on the Transform operator. The Transform Wizard page appears.

  8. As needed, click the Jinja/UI toggle at the top right of the page to switch between the Jinja code-only view or the UI drag-and-drop view. The default view is UI.

     

    • If you are using the UI drag-and-drop view, see steps 21 to 26.
    • If you are using the Jinja code-only view, see steps 27 to 28.

    Use the Search field at the top of the left-hand pane to search for the data you want to transform. Use the up and down arrows to move through the search results.

  9. In the UI drag-and-drop view, search for the value that you want to transform in the first pane and drag and drop that value onto the middle pane. A new value box appears in the middle pane:

    You can drag and drop add multiple values from the first pane onto the middle pane. PowerFlow uses these values to create the Jinja template for this Transform step. You can also drag and drop a group of values onto the middle pane by clicking the blue oval at the top of the list of values.

    To edit the name of a value box in the middle pane , click the pencil icon () and type a new name. To see the link between a value from the first pane and the value in the middle pane, click the link icon (). To view the list of values from that value box that will be added to the Jinja2 template, click the Preview icon () .

  10. To delete a value box from the middle pane, drag the box toward the bottom of the middle pane. A "drop here to delete" rectangle appears, and when you drag the box into that rectangle, it turns red. Drop the value box into the red rectangle to delete the box.
  11. To create a new value box, click the New Value button and type a name for it in the middle pane. Then you can drag and drop data from the first pane into that value box.

  12. To use a Jinja filter on a value in the middle pane, drag one or more of the yellow filter ovals into the relevant value box in the middle pane. The user interface will show a "Not supported" message for any filters that are not compatible with certain value types, such as a "capitalize" filter with a number value. For more information about Jinja filters, see the List of Built-in Filters in the Jinja documentation.

    If you add a "select" or a "reject" filter to a value box, additional fields will appear at the bottom of the middle pane when you add one of those filters. Depending on the filter you chose, type the value you want to include or reject in the Name field that appears, and select String or Number as needed. Click Save to finish configuring the filter.

  13. When you are done adding values from the first pane and adding filters from the middle pane to the various value boxes, click Check Output Data. The data for the Jinja2 template you just created appears in the Output Data tab, while the actual code for the template appears in the Jinja Template tab.
  14. If you are satisfied with the results of the Jinja2 template the Jinja Template tab and the data on the Output Data tab, go to step 29.

  15. In the Jinja code-only view, on the first pane of the Transform Wizard page, you can view all of the data gathered from the steps that you selected to send to the Transform operator in step 13. You will use this data to create a Jinja2 template on the Jinja Template tab.

    The data on the first pane matches the data you would see if you selected each step connected to the Transform operator and clicked the Step Data tab.

  16. On the Jinja Template tab, you can use data from the first pane to create a Jinja2 template to manipulate and change that data to use in the next step of the application. A Jinja2 template lets you create complex, concatenated (linked) fields. For more information about Jinja2 Templates, see the Template Designer Documentation.

    Example 1

    For a simple example for a step that gathers specific data about a device, you could create the following Jinja2 template on the Jinja Template tab:

    {% set output =

    {"sys_name": input["name"],

    "sys_ip": input["ip"]} %}{{output|tojson}}

    Click Check the Output Data on the Jinja Template tab to run the Jinja2 template you created on the Jinja Template tab. The results of this process appear on the Output Data tab.

    After running the above Jinja2 template, you would see the following data on the Output Data tab:

    {

    "sys_ip": "10.2.11.154",

    "sys_name": "pm-aio-11-154"

    }

    Example 2

    For a more complicated example, you could create the following Jinja2 template to gather and merge data from the "GetIncidents" and the "GetCompletedCRs" steps:

    {% set d=dict() %} {% set crupdate =

    d.update(

    {'changeRequests': GetCompletedCRs,

    'correlation': GetIncidents.0.correlation,

    'device_id': GetIncidents.0.events.0.device.id,

    'event_id': GetIncidents.0.events.0.event_id,

    'device_name': GetIncidents.0.events.0.device.name,

    'device_sysid': GetIncidents.0.events.0.device.sys_id,

    'found_cr': GetIncidents.0.sys_id in GetCompletedCRs,

    'incident_number': GetIncidents.0.number,

    'incident_sys_id': GetIncidents.0.sys_id }) %} {{ d|tojson }} ]

    After running the above Jinja2 template, you would see the following data on the Output Data tab:

    {

    "changeRequests": [],

    "correlation": "Bus_Services_test+DEV+15+EVENT+3636",

    "device_id": "15",

    "device_name": "enagley-cmdr-34-242",

    "device_sysid": "7b01681edb1df300dc44f00fbf9619e7",

    "event_id": "12503",

    "found_cr": false,

    "incident_number": "INC0010104",

    "incident_sys_id": "06685154db35b300dc44f00fbf961933"

    }

  17. As needed, edit any other data on the Transform Wizard page, and then click the Save Template button. 

  18. Close the Transform Wizard page. The Application detail page appears again.

  19. Click the Save button to save your work.

    Click the Run button to test the new application. When the run completes, select the Transform operator and click the Step Data tab to view the filtered set of data.

  20. Add any additional steps and operators to the new application, and then click the Save button and then the Close Editor button. The application is added to the Applications page.

Creating an Application that Uses a Trigger Application Operator

In the PowerFlow builder interface, you can use the Trigger Application operator () to launch one or more PowerFlow applications from within a new or existing PowerFlow application. This operator uses the same functionality as the "Trigger Application" step from the Base Steps SyncPack.

The Trigger Application operator gathers data from a previous step in the application workflow, in the same way as the Transform operator. You can use the Trigger Application operator to organize specific data that will be used in the triggered application or applications.

  1. From the Applications page (), click Create Application. A Create Application window appears.
  2. Complete the following fields:
  • Friendly Name. The name that you want users to see for this application. Required.
  • Description. A short description of what this application does.
  • Author. The name of the person or company that created this application. Use the same name for multiple applications. Required.
  • Version. The version for this application.
  • Configuration. Select a configuration object to align with the new application, or select Make New Configuration to create a new configuration object.
  1. Click Set Values. The PowerFlow builder interface appears.
  2. On the Steps Registry pane, search for a step or filter the list of steps to help you find the step you need.
  3. On the Steps Registry pane, click the step you want to add and drag it to the main viewing pane ("canvas"). The Configuration pane for that step appears.
  4. On the Configuration pane, type a new name for the step and update the other fields on the Configuration pane as needed. If needed, click the down arrow on the Advanced section to update the advanced fields.
  5. To verify that the parameters you specified are correct and the step is configured correctly, click Run at the bottom of the pane to run the step. 
  6. On the Configuration pane, click Save to save the parameters for the new step. The Application detail page appears again.
  7. Click Save in the top navigation bar to save the new application.
  8. To test your application so far, click the Run button in the top navigation bar. Click the Step Log to view the results of the run on the Step Log and Step Data tab.
  9. Repeat steps 4-10 to add more steps to the application.
  10. Click Save to save your work.
  1. Click the Run button to run the new application and gather data for the steps that will send data to the Trigger Application operator.

  2. On the Steps Registry pane, click the Advanced tab (). The flow control operators appear.

  3. Drag the Trigger Application operator () onto the canvas. The operator displays as a step with a "TriggerApplication" label.

  4. Connect an existing step to the Trigger Application operator by clicking the outline of the step and dragging the arrow that appears to the operator.

  5. Add additional steps as needed and click the Save button.

  6. Click the Run button to run the new application and gather data for the Trigger Application operator.

  7. Click the ellipsis icon () on the Trigger Application operator. The Pick an App to Trigger window for the Trigger App Wizard page appears:

  8. Select the PowerFlow application that you want to trigger with this step.

  9. Click Close. The main Trigger App Wizard page appears, with the name of the application you selected added to the name (friendly name) and trigger_app (system name) fields of the Parameters tab on the far right of the window:

    To change the application that you want to trigger, click the application name in the trigger_app field, and the Pick an App to Trigger window appears again.

  10. In the first pane, search for the values that you want to use in the triggered application and drag and drop those values onto a value box in the middle pane:

  • foreach: Triggers one or more instances of the application you specified in step 16 for each value in the list or dictionary. To enable this feature, you will need to specify the input_iterator, key_as, and value_as parameters on the Advanced section of the Parameters tab. For more information, see the Parameters table.
  • app_vars: Values added to this box are used as application variables for the triggered application.

    The middle pane works as a "transform wizard" that adds data to the Output Data and Parameters tabs of the third pane.

    To edit the name of a value box in the middle pane, click the pencil icon () and type a new name. To see the link between a value from the first pane and the value in the middle pane, click the link icon (). To view the list of values from that value box that will be included in the output data, click the Preview icon ().

  1. To delete a value box from the middle pane, drag the box toward the bottom of the middle pane. A "drop here to delete" rectangle appears, and when you drag the box into that rectangle, it turns red. Drop the value box into the red rectangle to delete the box.
  2. To use a Jinja filter on a value in the middle pane, drag one or more of the yellow filter ovals into the relevant value box in the middle pane. The user interface will show a "Not supported" message for any filters that are not compatible with certain value types, such as a "capitalize" filter with a number value. For more information about Jinja filters, see the List of Built-in Filters in the Jinja documentation.

    If you add a "select" or a "reject" filter to a value box, additional fields will appear at the bottom of the middle pane when you add one of those filters. Depending on the filter you chose, type the value you want to include or reject in the Name field that appears, and select String or Number as needed. Click Save to finish configuring the filter.

  3. When you are done adding values from the first pane and adding filters from the middle pane to the various value boxes, click Check Output Data. The data you added in the middle pane is formatted and added to the Output Data tab.
  4. As needed, update the values on the Parameters tab for the triggered application. For more information, see the Parameters table.

    If you have a configuration object aligned with this application, that configuration object will also be used by the triggered applications. However, the values from the configuration object ill be overwritten by any of the parameters you set in the Trigger App Wizard page.

  5. Edit any other data on the Trigger App Wizard page, and then click Save. the Application detail page appears.

  6. Click the Save button to save your work.

    Click the Run button to test the new application. When the run completes, select the Trigger Application operator and click the Step Data to view the filtered set of data that will be sent to the triggered application.

  7. Add additional steps and operators to the new application as needed, and then click the Save and the Close Editor buttons. The application is added to the Applications page.

Parameters Table

The following table describes the different parameters you can set on the Parameters tab of the Trigger App Wizard page:

Parameter Name Default Value Description

name

TriggerApplication

Unique name of this step. Edit this field as needed.

trigger_app

N/A

The name of the PowerFlow application you want to run or "trigger" from the current application. This value is automatically set to the system name for the application you selected from the Pick an App to Trigger window.

value_as

N/A

  • If the input in the foreach value box in the middle pane of the wizard page is a dictionary, specify the name of the application variable for those values.
  • If the input in the foreach value box is a list, the application variable will be set with the elements of the list.
Advanced parameters

retry_countdown

180

The interval between retries, in seconds.

retry_max

0

The maximum number of times the PowerFlow system will retry to execute the step before it stops retrying and logs a step failure.

retry_backoff

unselected

Instead of using a defined interval between retries, the PowerFlow system will incrementally increase the interval between retries.

retry_jitter

unselected

Instead of using a defined interval between retries, the PowerFlow system will retry the step execution at random intervals.

retry_backoff_max

600

The maximum time interval for the retry_backoff option, in seconds.

template

N/A

Displays the Jinja2 template that is used for rendering the desired data.

foreach

N/A

The contents of the foreach value box in the middle pane of the Trigger App Wizard page triggers multiple applications for each value in that list or dictionary. Any values you specify in this text box will get overwritten if values are added to the foreach value box in the middle pane of the wizard.

input_iterator

false

  • Set to "true" if you want to execute an instance of the triggered application for each item in the set of input data from the previous step. The data is added as an application variable to the triggered application, and that variable is defined by the value_as parameter . This option is not compatible with the foreach parameter.
  • Set to "false" if you only want to trigger one instance of the triggered application.

key_as

N/A

If the input in the foreach value box is a dictionary, specify the name of application variable for the key.

app_vars

N/A

Specify any application variables you want to add to the triggered applications. Any values you specify in this text box will get overwritten if values are added to the app_vars value box in the middle pane of the wizard page.

exit_on_child_failure

 

Selected

 

If you select this option, if any triggered application fails, the step will be marked as a Failure. If you do not select this option, the step will not fail if a triggered application fails, but the step still wait until all triggered apps are completed. The wait_for_child_completion option, below, must be selected for this option to be enabled.

wait_for_child_completion

 

Selected

Select this option if you want PowerFlow to wait for the triggered applications to complete. If this parameter is not selected, the application ends as soon as the applications are triggered. In either case, if an error occurred with triggering an application, the state of the step is Failed.

If you receive an error running the step, select the step and click the Step Log tab. The error log should list which of the above parameters might be causing the error.

Editing a PowerFlow Application

In the PowerFlow builder interface, you can edit an existing application and its steps. You can also add and remove steps from that application.

You cannot overwrite applications where ScienceLogic, Inc. is listed as the "Author", but you can edit a ScienceLogic application and save it with a different name.

To edit an application:

  1. From the Applications page, select the application that you want to edit. The Application detail page appears.
  2. Click the Open Editor button. The PowerFlow builder interface appears, including the Steps Registry pane, which contains a list of all of the available steps.

  3. On the Steps Registry pane, you can search for a step or filter the list of steps to help you find the step you need:

  • Click the Search Steps tab () to search the entire list of steps from the Search Steps Registry field.
  • Click the Group Steps tab () to group the steps by SyncPack, by a tag, or to show all of the steps in one list.

    Click the Actions button () on a step in the Steps Registry pane to view more information about that step, including the step ID, the SyncPack for that step, the version, and creator of the step. You can also click Edit Step Code to edit the code for that step, and if the step does not belong to a published SyncPack, you can also delete that step from the registry.

  1. To create a step, click Create a Step () on the Steps Registry pane, type a file name, and edit the step code for the new step. For more information, see Creating a Step.
  2. To use existing steps, click the step or steps you want to add from the Steps Registry pane and drag them to the main viewing pane ("canvas") to add them to the application. Add any relevant information to the Configuration pane for that step, and click Save to close the Configuration pane.
  3. To adjust the position of any step in the application, click the step you want to move and drag it to its new location.
  4. To redirect the arrow between steps, click the arrow and drag it to reposition it.
  5. To edit the configuration for a step, click the ellipsis icon () on the step and update the fields as needed on the Configuration pane. You can also click the ellipsis icon () on a step to view he step code for the step or to delete the step.
  6. While editing a step, click Show JSON Configs to view the JSON configuration data for the step. Click Hide JSON Editor to view the fields instead.
  7. To remove a step, click the step to select it and press the Delete key on your keyboard.
  8. To edit the metadata for an application, click the Metadata button and update the fields in the pop-up as needed.
  9. To save the changes you made to the application, click Save. You can also click the Save as option to save the application with a new name.
  10. To stop editing and close the Search Steps Registry pane, click the Close Editor button.

Editing Mappings in a PowerFlow Application

Some PowerFlow applications have one or more mappings sections, which lets you sync specific data in a third-party application with SL1 data.

There are three types of mappings available on the Configuration pane for syncing data, and currently these mappings are only available for specific applications in the "ServiceNow CMDB" SyncPack:

  • Mappings. On this mapping page for Device Sync and CI Attribute Sync, you can connect an SL1 device class to a ServiceNow CI class, which determines the CI class that ServiceNow uses when creating the CI in ServiceNow. If no mappings are provided for CI Attribute Sync, the sync will only pull CI classes provided in the Device Sync Mappings section; if you add mappings for CI Attribute Sync, only CI classes that were included in its Mappings section will be returned from ServiceNow. For an Interface Sync, you can map SL1 interfaces to ServiceNow tables.
  • Company Mapping Override. On this mapping page, you can create a new mapping for the ServiceNow company field. You can override the company field with a different ServiceNow field where you can read and write the company_sys_id for CIs.
  • Attribute Mappings. On this mapping page, you can create mappings for any other custom attributes that you want to sync between SL1 and ServiceNow.

All three types of mapping pages have the following layout and options:

In the first column, you can select an existing item from the third-party application (like ServiceNow) to see a list of the items that are currently mapped to that item in SL1. You can also select a field from the list and click the Add button to start a new mapping. Click the delete icon to remove a mapping.

In the second column, you can review the items mapped with the item you selected in the first column, and you can also add an item to a mapping, or remove an item from a mapping.

When you are done editing the mappings, click Done to save your changes and return to the Configuration pane for that application.

If you are creating a PowerFlow application, you can use mappings in a similar way for your new application.

Enabling Run Book Automation Queue Retries

If you are using PowerFlow to sync incidents from a third-party application like ServiceNow or Cherwell, you can enable Run Book Action (RBA) queue retries to keep from losing any incidents if PowerFlow is unavailable. Those pending PowerFlow applications are added to an RBA queue that you can access to retry the applications that failed.

Requirements

The RBA queue retries feature has the following requirements:

  • PowerFlow version 2.3.0 or later
  • SL1 version 11.1.0 or later
  • "ServiceNow Base Pack" PowerPack version 106 or later
  • "Base Steps" SyncPack version 1.3.2 or later
  • "System Utils" SyncPack version 1.1.2 or later (this SyncPack is included when you install PowerFlow Platform

PowerFlow Applications

The "System Utils" SyncPack version 1.1.2 or later includes two PowerFlow applications that handle Run Book Action retries:

  • Read SL1 RBA Queue and Retry PowerFlow Applications. Pulls and retries any PowerFlow applications that were not able to be executed by Run Book Actions because PowerFlow was not available.
  • Run PowerFlow Application and Remove It from SL1 RBA Queue. Runs any pending PowerFlow applications from the RBA queue, and then removes those applications from the RBA queue. This application gets triggered by the "Read SL1 RBA Queue..." application, so no configuration is needed for this application.

Configuration Object

The "System Utils" SyncPack also includes "PF RBA retry Configuration Example." You can make a copy of this example configuration object to use with the two applications listed above.

SL1 Action Type

The "ServiceNow Base Pack" PowerPack version 106 or later includes a new Run Book Action Type, "ServiceNow: Send to PowerFlow". You can add the following snippet code from that Action Type into the snippet code for the Run Book Action policy you want to use (if the Run Book Action policy does not already contain that code):

payload = {"name": "application_name",
           "params": {"configuration": "config_name", "app_var1": "app_var1"}} 

For example:

payload = { "name": "pf_controltower_healthcheck",
                    "params": {
                        "pf_host": "https://10.2.11.234",
                        "cmdb_integration": "cmdb_integration"
                    },
                }

You should also add the following snippet code to the Run Book Action policy if the code is not already present:

EM7_RESULT = {'EM7_RETRY': True, 'EM7_EXTRA_PARAMs': payload}

The Run Book Action policies in "ServiceNow Base Pack" PowerPack version 106 or later contain this snippet code by default.

Enabling RBA Queue Retries

To enable RBA queue retries:

  1. If you need to copy the snippet code, open SL1, navigate to the Action Types page (Registry > Run Book > Action Types), and click the edit icon () for the "ServiceNow: Create, Update, Clear Incident or Event" Action Type or the "ServiceNow: Send to PowerFlow" Action Type. The Action Type Editor modal appears:

  2. Scroll down and copy the payload section and close the Action Type Editor modal without saving it.

  3. Go to the Actions page (Registry > Run Book > Action Types) and click the edit icon () for the Run Book Action policy you want to use. The Action Editor modal appears.

  4. In the Input Parameters pane, paste the payload section from step 2, along with the following required code:

  5. In the Input Parameters pane, update the parameters in the payload section as needed. The following parameters are examples:

    • name. Specifies the system name of the PowerFlow application you want to use for retries. The system name displays at the end of the URL, after /integrations/.

    • configuration. Specifies the system name of the configuration object aligned with the PowerFlow application. The system name displays in the Configuration field on the Configuration pane of any application aligned with that configuration object.

    • queue. Specifies the worker queue on which the application runs.

  6. Make sure that the following snippet code is present in the Input Parameters pane; copy and paste it into the pane if it is not present:

    EM7_RESULT = {'EM7_RETRY': True, 'EM7_EXTRA_PARAMs': payload}

    You can also add the snippet code from steps 2 and 3 to the Input Parameters pane of a Run Book Action policy.

  7. Go to the Actions page (Registry > Run Book > Actions) and click the edit button () for the Run Book Action for which you want to enable retries.

  8. Make sure that the "ServiceNow: Create, Update, Clear Incident or Event" Action Type is selected as the Action Type for that Run Book Action policy.

  9. In PowerFlow, go to the Applications page and select the "Read SL1 RBA Queue and Retry PowerFlow Applications" application.

  10. Click the Configuration tab and align the corresponding configuration object in the Configuration field.

  11. Update the following fields as needed:

    • limit_failover actions. Specifies the number of rows that will be read from the RBA queue. The default is 1000.

    • generate_report. Select this option to generate a report of all of the triggered PowerFlow applications read from the RBA queue.

  12. Click Save.

  13. Click the Run button. The application pulls and retries any PowerFlow applications that were not able to be executed by Run Book Actions because PowerFlow was not available.

    This application triggers the "Run PowerFlow Application and Remove It from SL1 RBA Queue" application, so you do not need to configure the "Run PowerFlow..." application.

  14. If you selected the generate_report option, you can view the report for "Read SL1 RBA Queue and Retry PowerFlow Applications" and select an application in the report to see if any child applications failed to get triggered.

Creating a Step

On the Applications page, you can create new steps using Python that you can add to new or existing PowerFlow applications.

You cannot edit a step in a published SyncPack. If you want to customize a step in a published SyncPack, you need to create a new step using the code from the existing step.

All Python step code should be Python 3.7 or later.

To create a step:

  1. From the Applications page (), click the down arrow () next to the Create Application button and select Create Step. A Create Step window appears.

    You can also create a step in an existing application by navigating to the Application detail page for that application. Click the Open Editor button and Clicking the Create Step icon () on the Steps Registry pane.

  2. In the File Name field, type a name for the step. The name cannot include spaces, and PascalCase, such as "CacheRead", is recommended. Also, the file name must match the class name in the Python code.
  3. In the Edit Step Code text box, add or update the Python code for the step as needed, including the metadata information for the new step in the def __init__(self): section. For more information, see Creating a Step in the "Application Service for Developers" section
  4. To test the new step and view its output, click the Run Step button. The Available Parameters and Output Data will update with data, including error messages, where relevant.
  5. When you are done editing the step, click the Save button. The step is added to the Steps Registry pane. 

Defining Retry Options for a Step

The following parameters allows you to define multiple retry options for a step. You can specify that the PowerFlow system try to re-run a step if that step fails. Retries work following the rules of exponential backoff: the first retry will have a delay of 1 second, the second retry will have a delay of 2 seconds, the third retry will delay 4 seconds, the fourth retry will delay 8 seconds, and so on.

As a best practice, you should only edit the retry_max parameter and avoid editing any of the other retry parameters. Only advanced users who understand how the retries work and their side effects when they are not set correctly should change the other retry parameters.

You can include the following retry options in the PowerFlow application file, where you define parameters for each step:

  • retry_max . The maximum number of times the PowerFlow system will retry to execute the step before it stops retrying and logs a step failure. For example, if retry_max is 3, PowerFlow will retry after 1 second, then 2 seconds, then 4 seconds, and stop if the last retry fails. The default value is 3.
  • retry_backoff. Instead of using a defined interval between retries, the PowerFlow system will incrementally increase the interval between retries. Possible values are True or False. The default value is False.
  • retry_jitter. Instead of using a defined interval between retries, the PowerFlow system will retry the step execution at random intervals. Possible values are True or False. The default value is False.
  • retry_backoff_max. The maximum time interval for the retry_backoff option, in seconds. For example, This means, if you have retry_max set to 15, the delays will be 1, 2, 4, 8, 16, 32, 64, 120, 240, 480, 600, 600, 600, 600, and 600. The default value is 600 seconds.
  • retry_countdown. The interval between retries, in seconds. If you enabled retry_backup, the PowerFlow system will incrementally increase this interval. The default value is 180.

    Use caution when editing the retry_countdown option. If you set it to a value smaller than the default of 180 seconds, PowerFlow might experience collisions between task executions, and PowerFlow might stop unexpectedly. If you set this option to a value larger than the default, you might have to wait longer for a task to execute.

Aligning a Configuration Object with an Application

Before you can run a PowerFlow application, you must align the application with a configuration object from the Configurations page. A configuration object defines global variables, such as endpoints and credentials, that can be used by multiple steps and applications. Each variable in a configuration object is set up as a name and value pair. You can also encrypt a variable to protect sensitive data like a password.

You can "align" the configuration object you want to use with an application from the Configuration pane for that application.

To align a configuration object with an application:

  1. From the Applications page (), select the application that you want to align with a configuration object. The Application page for that application appears.
  2. Click the Configure button. The Configuration pane opens on the right side of the Application page. For example:

    To view a pop-up description of a field on the Configuration pane for an application, hover over the label name for that field.

  3. Select a configuration object from the Configuration drop-down to "align" to this application. This step is required for all applications.

    You can select none from the Configuration drop-down to clear or "un-align" the selected configuration object from an application. Also, if you did not select a configuration object when editing fields on the Configuration pane, the previously set configuration object will remain aligned (if there was a previously set configuration object).

  4. If you have a configuration object already selected, you can edit it by clicking the Edit Configuration button. The Configuration pane for that object displays to the left of the application Configuration pane. Add or edit the values on that pane and click the Save button.

  5. For any of the application variables with a gear icon () in the right-hand corner, you can click that icon to open the Available Configuration Values pop-up, which contains a list of all available variable values in the configuration object you selected in step 3. Select a value from the list to replace the value in the existing application variable. For more information, see Working with Application Variables for Configuration Objects.

    If an application variable is using a value stored in the configuration object, the corresponding code for that variable displays underneath the box for that value, such as ${config.pf_username}.

  6. Click Show JSON Configs to view the JSON configuration data for the configuration object. Click Hide JSON Editor again to view the fields instead.

  7. As needed, edit the other application variables on the Configuration pane.

  8. Click Save. The Configuration pane automatically closes.

Running a PowerFlow Application

You can run an application directly from the Applications page (the list view) or from an Application page (the detail view). If you run the application from the Application page, you have the following additional options:

  • Run. Executes the application normally, with a log level of 1. This is the default, and it is the same as the Run Now option from the Applications page.
  • Debug Run. Executes the application in Debug Mode with a log level of 10.
  • Custom Run. Executes the application using a logging level that you specify (Error, Warning, Info, or Debug). You can also add any customer parameters that you might want to use to test specific features in the application.

When you run an application, PowerFlow generates a unique task ID for the application and each of its tasks. Using the task IDs, you can poll for the status of the application and the status of each individual running step in the application. For more information, see Querying for the State of a PowerFlow Application.

To run an application:

  1. From the Applications page (), click the Actions button () for the application you want to run and select Run Now.

    You can also select an application from the Applications page and click the Run button from the Application page. If you hover over the Run button, you can select Debug Run or Custom Run.

  1. As the application runs, the color of the border around each step represents whether it is running, is successful, or has failed:

    Step Color Icon State
    Blue

    Running
    Green Successful
    Red Failed
    Yellow Warning

Pop-up status messages also appear in the bottom left-hand corner of the Application page to update you on the progress of the application run.

After you start a run, you can click Stop () next to the Run button to stop that application and end all running tasks for that application.

  1. If a step triggers a child application, a branch icon () appears in the upper left-hand corner of the step. Double-click the branch icon to open the child application. Click the branch icon once to display the triggered application's run ID as a link in a pop-up window. If no run ID is present, the branch icon displays "NONE".

Viewing Previous Runs of an Application with the Timeline

The Application detail page for a selected application contains a Timeline button that displays a history of previous runs of that application.

Also, you can click the Replay button to replay the last run of an application, such as when an application failed. You can also choose from the following options

  • Info Replay. Replay the last run the application in Info Mode, which provides more log data in the Step Logs to help you with troubleshooting.
  • Custom Replay. Replay the last run of the application with custom parameters for testing or troubleshooting.

To view and filter the Timeline:

  1. From an Application detail page, click the Timeline button. The Timeline displays above the steps for that application:

  2. The default view for the Timeline shows the last two hours of runs for that application. The image above shows the last two hours of runs. Use the left arrow icon () and the right arrow icon () to move through the Timeline in 15-minute increments:

    The Timeline displays colored dots at a specific time that represent the last time this application was run. A green icon means a run was successful, a blue icon means a run is in progress, and a red icon means a run failed. 

  3. You can hover over or click an icon for a run on the Timeline to view a pop-up window that displays the run ID, the configuration object and the queue used for that run:

    Click the link for the run ID or click View Run to open the Application page for that specific run of the application. The run ID also displays in the Step Log pane for the "triggering" step for that application, and it also appears at the end of the URL for that application. On that page, you can select a step and open the Step Log to view any issues.

  4. Click the Filter icon () to filter or search the list of previous runs for this application. A Filter window appears:

  5. Edit the following fields on the Filter window as needed:
  • Date. The date for the history of previous runs you want to view. Click the field to open a pop-up calendar.
  • Start Time. The starting time for the history, using local time instead of UTC time. Click the field to open a pop-up time selector.
  • Window Size. The length of the history, in hours. The default history view for the Timeline is two hours.
  • Run State. Select the type of previous runs you want to view. Your options include all, success, failure, and pending. The default is all.
  • Configuration. Select a configuration file to filter for application runs using that configuration only.
  • Queue. Type a queue name to filter for application runs that use that queue.
  • UTC Time. Select UTC if you do not want to use local time. The Schedule feature uses UTC time.
  1. Click Search to run the filter or search.

    If the Timeline is open and you want to close it, click the Timeline button.

Scheduling a PowerFlow Application

You can create one or more schedules for a single application in the PowerFlow user interface. When creating each schedule, you can specify the queue and the configuration file for that application.

To schedule an application:

  1. On the Applications page (), click the Schedule button for the application you want to schedule. The Scheduler window appears.

  2. In the Schedule List pane, click the down arrow icon () next to an existing schedule to view the details for that schedule.
  3. In the Schedule Creator pane, complete the following fields for the default Frequency setting:

  • Schedule Name. Type a name for the schedule.
  • Frequency in seconds. Type the number of seconds per interval that you want to run the application.
  • Custom Parameters. Type any JSON parameters you want to use for this schedule, such as information about a configuration file or mappings.
  1. To use a cron expression, click the Switch to Cron Expression toggle to turn it blue. If you select this option, you can create complicated schedules based on minutes, hours, the day of the month, the month, and the day of the week:

    As you update the cron expression, the Schedule window displays the results of the expression in more readable language, such as Runs app: "Every 0 and 30th minute past every hour on Sat", based on 0,30 in the Minutes field and 6 in the Day of Week field.

  1. Click Save Schedule. The schedule is added to the Schedule List pane. Also, on the Applications page, the Schedule button now displays with a dark blue background:

After you create a schedule, it continues to run until you delete it. Also, you cannot edit an existing schedule, but you can delete it and create a similar schedule if needed.

To view or delete an existing schedule:

  1. On the Applications page, click the Schedule button for the application that contains a schedule you want to delete. The Scheduler window appears.
  2. Click the down arrow icon () to view the details of an existing schedule.
  3. To delete the selected schedule, click the Actions icon () and select Delete.

On the Scheduler window for a PowerFlow application, you can click the Copy as button from the Schedule List pane to make a copy of an existing schedule.

Backing up and Restoring PowerFlow Data

You can use PowerFlow to back up and recover data in the Couchbase database.

This option uses the "Backup" application in the PowerFlow user interface to create a backup file and send that file using secure copy protocol (SCP) to a destination system. You can then use the "Restore" application to get a backup file from the remote system and restore its content.

The backup and restore applications are application-level backup and restore tools. For full-system backups, you will need to do a filesystem-level backup to ensure that you get the encryption key that was used to encrypt configuration objects as well as other files used to describe the environment, including the /etc/iservices directory, the docker-compose.yml file and the docker-compose-override.yml file.

Creating a Backup

To create a backup:

  1. To add the relevant configuration information, go to the Configurations page () and click the Edit button or click the Actions button () and select Edit for the "PF - System Backup Configuration Example" configuration object. The Configuration pane appears:

  1. Click the Copy as button and provide values for the following fields in the Create Configuration pane:
  • Friendly Name. Name of the configuration object that will display in the user interface.

  • Description. A brief description of the configuration object.

  • Author. User or organization that created the configuration object.

  • Version. Version of the configuration object.

  • backup_destination. The location where the backup file is created. The default is /usr/tmp.

  • remote_host. The hostname for the remote location where you want to send the backup file via SCP from the backup_destination location.

  • remote_user. The user login for the remote location.

  • remote_password. The user password for the remote location. Encrypt this value.

  • remote_destination. The remote location where the application will send the backup file.

  • remote_ssh_key. The remote SSH key you want to use in place of a password for the remote location. Use the newline character \n as a separator. If the SSH key needs a paraphrase to be decrypted, set the paraphrase by creating a remote_password variable in the configuration object aligned with the applications.

    You will need to edit the SSH Key values in the JSON Editor for this release to ensure the key is properly set. For example:"{config.ssh_key}". This is a known issue that will be addressed in a future release.

    To get a one-line string of the SSH key, run the following command:
    sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' ~/.ssh/id_rsa

  1. Click the Save button.

  2. Go to the Applications page and select the "PowerFlow Backup" application.

  3. Click the Configure button. The Configuration pane appears:

  4. On the Configuration pane, provide values for the following fields:

  • Configuration. Select the configuration object you created in steps 1-3.

  • cluster_node. Specify the node from which you want to make the backup (for a single-node backup only). You can specify the order of the nodes that you are backing up by listing each node in order of preference, separated by commas. If one of the nodes fails or is unavailable, the backup application continues down the list of nodes in the order you specified in this field. For example: couchbase-worker.isnet,couchbase-worker.isnet2,couchbase.isnet. To use the ordered backup option, you must also check the single_node field.

  • use_ssh_key. Select this option if you want to run the backup application using an SSH key for authentication instead of using a password. You will need to provide a remote_ssh_key value in the configuration object you aligned with this application, such as config.remote_ssh_key.

  • single_node. Select this option if you want to back up from a single node in the cluster. Specify the node in the cluster_node field. You should also select this option if you want to specify the order of the nodes that you are backing up, and list each node in order of preference in the cluster_node field

  • data_only. Select this option if you only want to restore bucket data.

  • compress. Select this option to compress backups using Gzip.

  • include_syncpacks. Select this option if you want to back up the SyncPacks on the PowerFlow system.

  • installed_only. Select this option if you want to back up only SyncPacks that have been installed. If you do not select this option, the application will also back up SyncPacks that have been uploaded to the PowerFlow system.

  • bucket. Select which bucket in Couchbase you want to back up. Your options include:

    • all. Back up all buckets.

    • content. Back up only buckets that have content in them.

    • logs. Back up only the logs.

    To keep backups as small as possible, ScienceLogic recommends selecting only data_only, single_node, and bucket > content. These settings will keep backups to <5mb each, and contains all essential data (configuration objects, applications, and steps).

  • document_key: Select whether you want to back up all record or CI and device cache records.

    The options you select affect the name of the backup file that this application generates. For example, is_couchbase_backup-data_only-2019-04-01T185527Z.tar is a uncompressed data only backup, while is_couchbase_backup-data_only-cache-logs-couchbase.isnet-2019-04-01T185937Z.tar.gz is a compressed data-only backup of the CI and device cache from the couchbase.isnet node in a cluster.

  1. Click the Save button. The Configuration pane automatically closes.
  2. On the Application detail page, click the Run Now button. When the application completes, a file named "is_couchbase_backup-<date>.tar" is added to the remote server in the specified remote backup destination.
  3. To ensure that the backup was created, select the "Create IS Backup" step and open the Step Log section.
  4. Look for entries related to backup and make a note of the of the backup file name, which you will need when you run the "PowerFlow Restore" application:

You can schedule the "PowerFlow Backup" application to run on a regular basis, or you can run the application as needed. To schedule the application, click the Schedule button for the "PowerFlow Backup" application on the Applications page. For more information, see Scheduling a PowerFlow Application.

Restoring a Backup

After you have created a backup using the "PowerFlow Backup" application in the PowerFlow user interface, you can use the "PowerFlow Restore" application to restore that file.

Do not restore the PowerFlow backup to a system that uses a different encryption key.

To restore a backup:

  1. In the PowerFlow user interface, go to the Applications page and select the "PowerFlow Restore" application. The Application page appears.
  2. Click Configure. The Configuration pane appears:

  3. In the Configuration pane, provide values for the following fields:
  • Configuration. Select the same configuration object you aligned with the "PowerFlow Backup" application. Required.

  • use_ssh_key. Select this option if you ran the backup application using an SSH key for authentication instead of using a password. You will need to provide a remote_ssh_key value in the configuration object you aligned with this application.

    You will need to edit the SSH Key values in the JSON Editor for this release to ensure the key is properly set. This is a known issue that will be addressed in a future release.

  • data_only. Select this option if you only want to restore bucket data.

  • include_syncpacks. Select this option if you want to restore the SyncPacks you backed up with the "PowerFlow Backup" application.

  • force_syncpack_upload. Select this option if you want to force upload SyncPacks if the files already exist in the PowerFlow system.

  1. Click Save. The Configuration pane automatically closes.

  2. On the Application detail page, click Run.

  3. To ensure that the backup was restored, click to open the Step Log section and look for entries related to restoring the backup:

After running the "PowerFlow Restore" application, the "PowerFlow Backup" application might display as "Run status pending". This issue occurs because at the time of the last backup from Couchbase, the logs for the "PowerFlow Backup" application showed a pending state. This message is addressed during the next run, and it does not cause any issues with the backup or restore processes.

In addtion, after restoring a backup that contains installed SyncPacks, the SyncPacks page in the PowerFlow user interface will show that the versions of the restored SyncPacks were installed successfully, but their virtual environments might not be in place. This issue will be addressed in a future release of the PowerFlow Platform.

To address this issue, perform one of the following actions to make sure that the environments for the SyncPacks are recreated successfully:

  • Force the syncpacks_steprunner service to restart, using the following command:

    docker service update --force syncpacks_steprunner

  • Execute the following powerflowcontrol (pfctl) cluster or node action:

    reinstall_syncpack_venv

  • Reinstall the SyncPacks in place using the PowerFlow user interface.