Skip to main content

Secrets

A secret keeps a sensitive value, such as a password or an API key, out of the spec. You store it once in the Unstract Flow project and write its name where the value belongs, in any workflow of the project.

Add a secret​

Anyone who can open the project sees the names of its secrets. Adding a secret, setting its value and deleting it need the Owner, Admin or Member role and edit access to the project; Projects says who has it. Flow encrypts every value and shows it to nobody.

  1. On the project's page, open the Secrets tab and select Add secret.
  2. Enter a Name and a Value. A name holds the letters A to Z in either case, digits and underscores, up to 255 characters, and doesn't start with a digit.
  3. Select Add.

The tab lists each secret with when it last changed, and Not set marks a secret without a value. To set or replace a value, select the pencil on the secret's row, enter the value and select Save. To delete a secret, select the bin on its row, then Delete.

Secrets live on the project's page. The workflow editor used to repeat the same list in its Tools and configuration panel, which was the project's secrets shown a second time; the project page is now the one place they are managed, and the left bar's Secrets group under the project opens it.

Each name belongs to one secret in the project, and capitals count: PORTAL_KEY and Portal_Key are two secrets. On the project's page, adding a name the project already has fails with "Secret 'PORTAL_KEY' already exists in this project". A new value, a new secret and a deletion all reach the runs of every workflow in the project within about two minutes. After that, every step that uses a deleted secret fails when it runs. For up to two minutes after a workflow moves to another project, its runs can still use the old project's secrets and credentials.

Use a secret in the spec​

Write {{secret:NAME}} where the value goes:

Call the supplier portal's GET /orders endpoint with @rest_api, sending the header X-Portal-Key with the value {{secret:PORTAL_KEY}}.

Flow puts the value in place at the moment a step calls the connector. The spec and the prepared workflow hold only the name. Website and terminal steps mask a value of three or more characters in their logs; another connector's error or response can still contain it. Write the placeholder exactly, with no spaces. A step that names a secret the project doesn't have, or one marked Not set, fails, and its error names the secret. A secret name holds only letters, digits and underscores. A step whose placeholder holds anything else, such as the backslash in {{secret:PORTAL\_KEY}}, also fails without sending the value. Open the spec in the visual editor, which removes a backslash before an underscore, or correct the name, then select Prepare again. If a deployment runs the workflow, tag the new version and change the deployment's Version (Tagged) under Edit.

Moving a workflow to another project copies the secrets its spec names into the new project with their values, and a secret marked Not set stays Not set. Where the new project already has a secret of the same name with a value, it keeps that value; one it has marked Not set gets the old project's value. The old project keeps its secrets. The move dialog lists the secret names the spec uses that neither project has, under Secrets neither project has. Add them, and set a value for any secret marked Not set, before the workflow next runs; Projects covers the move.

Secrets in exports and copies​

An export carries the names of the project's secrets that the spec names as {{secret:NAME}}, without their values. An import adds each of those names to the project you import into, without a value, and the import lists a warning for each one: "Secret 'NAME' was imported as a placeholder; set its value before running any node that references it." When the project already has a secret of that name, that secret keeps its value, and the warning says "The project already has a secret named 'NAME', so it was kept as it is." Set every new value before you run the imported workflow.

Make a copy puts the name of every secret in the original's project into the copy's new project, without values.