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:
-
From the Workflows templates page, enter versioning for flows and folders in the Search field.
-
Click the Versioning for Flows and Folders with GitHub template in the search results.
-
On the template's page, click Add template to download it into your environment.
-
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.
-
After downloading the Versioning for Flows and Folders with GitHub template, open the flow named Export Flow and Make Commit to GitHub.
-
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.
-
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.
-
Edit the comment to add to the commit history, so that other users in this repository understand why you made the commit.
-
For the Update File Content card, create a connection for the GitHub connector:
-
Establish your connection and follow the OAuth prompts to authorize Workflows to access this GitHub repository on your behalf.
-
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.
-
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.
-
-
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
-
Click Test Flow.
-
In GitHub, select the file that you created or updated.
-
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.