Skip to main content

Protect workflows with Source Control

Learn how to protect workflows with Source Control.

Source Control for workflows operates similarly to how it does for apps, but with some key differences. Keep in mind the following considerations:

  • No version history. Protected workflows do not have a versioned history and you cannot deploy a specific version. Only the latest version can be enabled or disabled.
  • Cannot be moved or renamed. Protected workflows and the folders in which they're located cannot be renamed or moved. You must unprotect workflows before making name or location changes. Protected workflows must have a unique name.
  • Workflow triggers cannot be protected. Users can edit the trigger of a protected workflow without creating a commit.

Requirements

Before you begin, ensure Source Control is configured for your Retool instance. This guide uses GitHub, but Retool supports multiple remote SCM providers.

Source Control is available on the Enterprise plan. You must be an admin to configure Source Control.

1. Protect the workflow

In Retool, protected workflows are workflows checked into remote source control repositories. You can protect a workflow with Source Control in either the Workflows tab of your organization or the Workflow IDE:

  • Workflows tab: Click ••• to open the contextual menu for the workflow you want to protect, then select Protect workflow.
  • Workflow IDE: Click ••• in the toolbar to open the contextual menu, then select Protect workflow.

After reviewing the confirmation modal, click Protect workflow and create a pull request. Once merged, your workflow is protected.

Your workflow now shows a badge to the right of the name indicating that it is protected.

An workflow's name serves as a unique identifier when you use Source Control, so you can't rename a protected workflow. To change the name of a protected workflow, you must unprotect the workflow, rename it, and re-protect it.

3. Create a branch and make changes

Click Edit and select Create new branch. Give the branch a descriptive name for your changes. You can also select Make collaborative to allow other users to push changes to it.

After you create the branch, you're directed to the Workflow IDE. The branch on which you're editing appears in the lower left, along with the commit log for the branch. Changes made on branches are local to the branch.

Edit your workflow.

4. Commit your changes

After you finish making changes, you need to commit them and push them to GitHub.

  1. Click the Commit button in the top right corner.
  2. Write a description of your change.
  3. Optionally, select Review changes to preview the changes in your commit.
  4. Push your changes to GitHub by clicking Commit to <your-branch-name>.

5. Open a pull request and merge

After you commit all the changes you want to make, incorporate your changes back into the main branch.

  1. Click branch name in the lower left corner, and select Create pull request.
  2. Review any dependencies your workflow has on other protected objects, such as resources. Click Open pull request to visit the pull request on GitHub.
  3. Notice that the description is already populated with a link to preview your changes on your branch. Make any necessary changes, and create the pull request.
  4. Merge the changes into the main branch of your repository. The merge button label may differ depending on your repository's configuration for merging (e.g., Rebase and merge or Squash and merge).
  5. After a few seconds, your changes appear in the main branch of the workflow.

Remove workflow protection

You can remove protection for an workflow at any time. Click ••• to open the contextual menu for the workflow you want to unprotect, and select Remove protection. Confirm changes in the dialog box that appears.