Set up a template for flow back up

Back up for flows and folders allows you to store and back up your flows on an on-demand or automated basis to an external platform such as GitHub or Google Drive.

This set of tasks demonstrates how to export a flow. You can also swap the Export Flow function card with the Export Folder function card to export a set of flows within a folder instead of a single flow.

Before you begin

Verify that you have the following:

  • Access to an Okta tenant with Okta Workflows enabled for your org

  • Access to a GitHub tenant

  • Access to a GitHub repository in which you have rights to either make a commit or open a pull request

Download a template for flow back up

New templates are available on the Templates page in your Workflows instance.

To find examples of templates for flow back up:

  1. From the Workflows templates page, enter versioning for flows and folders in the Search field.

  2. Click the Versioning for Flows and Folders with GitHub template in the search results.

  3. On the template's page, click Add template to download it into your environment.

  4. Optionally, repeat these steps to download multiple templates for running flow back up.

Set up a template

This task includes the steps that are necessary to set up one of the two flows that are provided with the Versioning for Flows and Folders with GitHub template. In this task, you'll set up the flow named Export Flow and Make Commit to GitHub.

  1. After downloading the Versioning for Flows and Folders with GitHub template, open the flow named Export Flow and Make Commit to GitHub.

  2. On the Export Flow function card, select a flow in your environment that you'll export. All the elements of that flow are exported as a JSON file.

  3. Select the name of the file that you're exporting. The default is exportedFlow.flow. You can change the file name, but make sure that the file extension is .flow.

  4. Edit the comment to add to the commit history, so that other users in this repository understand why you made the commit.

  5. For the Update File Content card, create a connection for the GitHub connector:

    1. Establish your connection and follow the OAuth prompts to authorize Workflows to access this GitHub repository on your behalf.

    2. Select the organization, repository, and branch to use for testing. Make sure you have the appropriate privileges in your repository settings to the Manage Access menu for your repository.

    3. Make sure that the following fields are populated:

      • Message: The commit comment

      • File Content: The exported JSON file

      • Path: The folder path and the file name. If you want to create or update a file within a folder or sub-folder, you'll need to define the path in addition to the file name; for example, MainFolder/SubFolder1/exportedFlow.flow. This string serves as the value to the Path input.

    4. If the file doesn't exist, this flow returns an error and then attempts to create a new file. To resolve this issue:

      • Click If Error within the Try/If Error block and establish a connection to the same repository as above.

      • Make sure that the Message, File Content, and Path fields have the correct inputs.

See also the flow named Export Flow and Open PR in GitHub, in which you can create a branch and open a pull request instead of committing directly to a GitHub repository branch.

Test the template flow

  1. Click Test Flow.

  2. In GitHub, select the file that you created or updated.

  3. For the file, select History and verify that you can see the history of commits. The last commit should appear to be made by Okta Workflows and include the comment that you previously submitted with the commit.