Set up a template for flow backup

You can store and back up your flows on-demand or on a schedule to an external platform such as GitHub or Google Drive.

This set of tasks demonstrates how to export a flow. You can 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 backup

To find examples of templates for flow backup:

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

  2. Select 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 to your environment.

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. This task covers how to 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 to export. The card exports all the elements of that flow 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 subfolder, you need to define a full 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 file. Follow these steps to resolve this issue:

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

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

Also check the flow named Export Flow and Open PR in GitHub. In that flow, 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.