You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Credential block has two operations: **Select Credential** picks a single stored credential and outputs its ID reference for downstream blocks; **List Credentials** returns all credentials in the workspace (optionally filtered by type) as an array for iteration.
10
+
The Credential block has two operations: **Select Credential** picks a single OAuth credential and outputs its ID reference for downstream blocks; **List Credentials** returns all OAuth credentials in the workspace (optionally filtered by provider) as an array for iteration.
11
11
12
12
<divclassName="flex justify-center">
13
13
<Image
@@ -20,7 +20,7 @@ The Credential block has two operations: **Select Credential** picks a single st
20
20
</div>
21
21
22
22
<Callout>
23
-
The Credential block outputs credential **ID references**, not secrets. Downstream blocks receive the ID and resolve it securely during their own execution.
23
+
The Credential block outputs credential **ID references**, not secrets. Downstream blocks receive the ID and resolve the actual OAuth token securely during their own execution.
24
24
</Callout>
25
25
26
26
## Configuration Options
@@ -29,34 +29,18 @@ The Credential block has two operations: **Select Credential** picks a single st
29
29
30
30
| Value | Description |
31
31
|---|---|
32
-
|**Select Credential**| Pick one credential and output its reference — use this to wire a single credential into downstream blocks |
33
-
|**List Credentials**| Return all workspace credentials as an array — use this with a ForEach loop |
32
+
|**Select Credential**| Pick one OAuth credential and output its reference — use this to wire a single credential into downstream blocks |
33
+
|**List Credentials**| Return all OAuth credentials in the workspace as an array — use this with a ForEach loop |
34
34
35
35
### Credential (Select operation)
36
36
37
-
Select a credential from your workspace. The dropdown shows all credential types you have access to, grouped by category:
-**Environment Variables** — Workspace or personal environment variable references
41
-
-**Service Accounts** — Google service account JSON keys
37
+
Select an OAuth credential from your workspace. The dropdown shows all connected OAuth accounts (Google, GitHub, Slack, etc.).
42
38
43
39
In advanced mode, paste a credential ID directly. You can copy a credential ID from your workspace's Credentials settings page.
44
40
45
-
### Type Filter (List operation)
46
-
47
-
Filter the returned credentials by type. Defaults to **All**.
41
+
### Provider (List operation)
48
42
49
-
| Value | Description |
50
-
|---|---|
51
-
|**All**| Return all credential types |
52
-
|**OAuth**| Connected OAuth accounts only |
53
-
|**Env Variables (Workspace)**| Workspace environment variables only |
54
-
|**Env Variables (Personal)**| Personal environment variables only |
55
-
|**Service Accounts**| Google service account keys only |
56
-
57
-
### Provider (List operation, OAuth only)
58
-
59
-
Further filter OAuth credentials by provider. Select one or more providers from the dropdown — only providers you have credentials for will appear. Leave empty to return all OAuth providers.
43
+
Filter the returned OAuth credentials by provider. Select one or more providers from the dropdown — only providers you have credentials for will appear. Leave empty to return all OAuth credentials.
60
44
61
45
| Example | Returns |
62
46
|---|---|
@@ -72,13 +56,12 @@ Further filter OAuth credentials by provider. Select one or more providers from
72
56
|---|---|---|
73
57
|`credentialId`|`string`| The credential ID — pipe this into other blocks' credential fields |
74
58
|`displayName`|`string`| Human-readable name (e.g. "waleed@company.com") |
1. Drop a **Credential** block, set Operation to **List Credentials**
161
-
2. Optionally set a **Type Filter** (e.g. OAuth only)
162
-
3. Optionally select one or more **Providers** to narrow results (only your connected providers appear)
163
-
4. Wire `<credentialBlockName.credentials>` into a **ForEach Loop** as the items source
164
-
5. Inside the loop, reference `<loop.currentItem.credentialId>` in downstream blocks' credential fields
130
+
2. Optionally select one or more **Providers** to narrow results (only your connected providers appear)
131
+
3. Wire `<credentialBlockName.credentials>` into a **ForEach Loop** as the items source
132
+
4. Inside the loop, reference `<loop.currentItem.credentialId>` in downstream blocks' credential fields
165
133
166
134
## Best Practices
167
135
168
136
-**Define once, reference many times**: When five blocks use the same Google account, use one Credential block and wire all five to `<credential.credentialId>` instead of selecting the account five times
169
137
-**Outputs are safe to log**: The `credentialId` output is a UUID reference, not a secret. It is safe to inspect in execution logs
170
-
-**Use for environment switching**: Pair with a Condition block to route to a production or staging credential based on a workflow variable
138
+
-**Use for environment switching**: Pair with a Condition block to route to a production or staging OAuth credential based on a workflow variable
171
139
-**Advanced mode is required**: Downstream blocks must be in advanced mode on their credential field to accept a dynamic reference
172
-
-**Use List + ForEach for fan-out**: When you need to run the same action across all accounts of a type, List Credentials feeds naturally into a ForEach loop
140
+
-**Use List + ForEach for fan-out**: When you need to run the same action across all accounts of a provider, List Credentials feeds naturally into a ForEach loop
173
141
-**Narrow by provider**: Use the Provider multiselect to filter to specific services — only providers you have credentials for are shown
174
142
175
143
<FAQitems={[
176
-
{ question: "Does the Credential block expose my secret or token?", answer: "No. The block outputs a credential ID (a UUID), not the actual secret or token. Downstream blocks receive the ID and resolve it securely in their own execution context. Secrets never appear in workflow state, logs, or the canvas." },
177
-
{ question: "What credential types does it support?", answer: "All credential types: OAuth connected accounts, workspace environment variables, personal environment variables, and Google service accounts." },
144
+
{ question: "Does the Credential block expose my secret or token?", answer: "No. The block outputs a credential ID (a UUID), not the actual OAuth token. Downstream blocks receive the ID and resolve the token securely in their own execution context. Secrets never appear in workflow state, logs, or the canvas." },
145
+
{ question: "What credential types does it support?", answer: "OAuth connected accounts only (Google, GitHub, Slack, etc.). Environment variables and service accounts cannot be resolved by ID in downstream blocks, so they are not supported." },
178
146
{ question: "How is Select different from just copying a credential ID into advanced mode?", answer: "Functionally identical — both pass the same credential ID to the downstream block. The Credential block adds value when you need to use one credential in many blocks (change it once), or when you want to select between credentials dynamically using a Condition block." },
179
-
{ question: "Can I list all credentials in my workspace?", answer: "Yes. Set the Operation to 'List Credentials'. You can optionally filter by type (OAuth, environment variables, service accounts). Wire the credentials output into a ForEach loop to process each credential individually." },
147
+
{ question: "Can I list all OAuth credentials in my workspace?", answer: "Yes. Set the Operation to 'List Credentials'. Optionally filter by provider using the Provider multiselect. Wire the credentials output into a ForEach loop to process each credential individually." },
180
148
{ question: "Can I use a Credential block output in a Function block?", answer: "Yes. Reference <credential.credentialId> in your Function block's code. Note that the function will receive the raw UUID string — if you need the resolved token, the downstream block must handle the resolution (as integration blocks do). The Function block does not automatically resolve credential IDs." },
181
149
{ question: "What happens if the credential is deleted?", answer: "The Select operation will throw an error at execution time: 'Credential not found'. The List operation will simply omit the deleted credential from the results. Update the Credential block to select a valid credential before re-running." },
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx
+4-28Lines changed: 4 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,7 @@ import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/c
'Select a stored credential once and pipe its ID into any downstream block that requires authentication, or list all credentials in the workspace for iteration. No secrets are ever exposed — only credential IDs and metadata.',
28
+
'Select an OAuth credential once and pipe its ID into any downstream block that requires authentication, or list all OAuth credentials in the workspace for iteration. No secrets are ever exposed — only credential IDs and metadata.',
31
29
bestPractices: `
32
-
- Use "Select Credential" to define a credential once and reference <CredentialBlock.credentialId> in multiple downstream blocks instead of repeating credential IDs.
33
-
- Use "List Credentials" with a ForEach loop to iterate over all credentials of a given type (e.g. all OAuth accounts).
34
-
- Use the Type Filter in "List Credentials" to narrow results to a specific credential type.
35
-
- Use the Provider filter to further narrow OAuth results to specific services (e.g. Gmail, Slack).
30
+
- Use "Select Credential" to define an OAuth credential once and reference <CredentialBlock.credentialId> in multiple downstream blocks instead of repeating credential IDs.
31
+
- Use "List Credentials" with a ForEach loop to iterate over all OAuth accounts (e.g. all Gmail accounts).
32
+
- Use the Provider filter to narrow results to specific services (e.g. Gmail, Slack).
36
33
- The outputs are credential ID references, not secret values — they are safe to log and inspect.
37
34
- To switch credentials across environments, replace the single Credential block rather than updating every downstream block.
0 commit comments