Skip to main content

Secrets vs. connections

Blokkio has two places for sensitive values, and they do different jobs.

ConnectionSecret
HoldsCredentials to one service: an OAuth sign-in, an API key, a database loginA single value your workflows need
Used byBlocks with a connection picker: HTTP Request, App Action, App Trigger, AI blocks, Database Query, Send Email and the database, email and SFTP triggersExpressions, {{ $secrets.NAME }}, and connection fields
Does for youAdds the right auth headers, refreshes OAuth tokens, pins credentials to allowed domains, applies the base URL, tests and reports healthEncrypts the value, masks it in outputs and logs, warns before it expires
Per environmentEnvironment overridesEnvironment values

Use a connection for anything that signs you in to a service: API keys, tokens, OAuth apps, usernames and passwords, database and mail server logins.

Use a secret for values that aren't credentials to a service, for example a webhook signing key you verify in a Code node, an account ID, or a setting that differs per environment.

The two combine: a connection field can reference a secret instead of holding the value itself.

Referencing a secret from a connection​

In the connect dialog, every text and password field has a Use secret button. Pick a secret (or create one from the picker) and the field shows it as a chip. The connection stores a reference instead of the value:

secret://GITHUB_TOKEN

The reference is resolved every time the connection is used, so rotating the secret updates every connection that references it, without editing them. Click the × on the chip to go back to typing a value.

This is useful when:

  • one credential is shared by several connections, or by a connection and a Code node;
  • the credential is rotated by someone who manages secrets but shouldn't edit connections;
  • the credential must differ per environment: give the secret an environment value and every connection that references it follows.

Secret names are case-sensitive and must match exactly. A reference is stored and shown as-is: the API never returns the secret's value.

Which fields can reference a secret​

Connection typeFields that accept secret://NAME
Apps and HTTP connections (token, key, OAuth, Basic Auth)Every text field, unless the app's definition turns it off with allowSecretRef: false
DatabaseHost, Database, Username, Password
SFTPHost, Username, Password, Private key, Key passphrase, Host key fingerprint
IMAPHost, Username, Password
SMTPHost, Username, Password, From address, From name

Port and select fields such as SSL mode or Security can't reference a secret. Saving a reference in a field that doesn't allow one fails with 'Port' can't reference a secret.

How a connection's values are resolved​

When a node uses a connection, Blokkio computes the effective values in this order. Later steps win:

  1. Base configuration: the values you entered on the connection, including its encrypted fields.
  2. Environment override: if the run executes in an environment for which the connection has an override, the override's fields replace the same fields from step 1.
  3. Secret references: every field that holds secret://NAME is replaced by the secret's value, using the run's environment. The secret's environment value wins; without one, its default value is used.
  4. Platform OAuth credentials: for one-click OAuth apps, Blokkio's client ID and secret are added. You never see or enter these.

For example, a Stripe connection whose Secret key is secret://STRIPE_KEY, with the secret's default value sk_test_… and a Production environment value sk_live_…, uses the live key only in runs that execute in Production.

An environment override can itself contain references, for example { "token": "secret://STAGING_TOKEN" }.

To check the result for one environment, use ⋯ → Test connection → In … on the Connections page. The test resolves the values exactly as a run in that environment would.

Missing secrets​

If a referenced secret doesn't exist in the project, or has expired, the node fails before any request is sent:

Connection 'GitHub (acme bot)': field 'token' references the secret 'GITHUB_TOKEN', which doesn't exist in this project (or has expired).

Create the secret, fix its name, or renew its value. Only the project's own secrets can be referenced.

Seeing where a secret is used​

Open a secret on the Secrets page. Its Used by list shows both the workflows whose expressions use it and the connections whose fields reference it; for connections, the field name is shown next to the connection, for example GitHub (acme bot) · token. References in a connection's environment overrides are included. Check this list before renaming or deleting a secret: renaming it breaks every secret://OLD_NAME reference.