Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
12c3765
feat(credential-groups): people status chips, send reminder, integrat…
waleedlatif1 Dec 3, 2026
2c72a59
feat(credential-groups): Slack return allowlist, specific enrollment …
waleedlatif1 Dec 3, 2026
22cd894
feat(credential-groups): enrollment links stop rotating invitations
waleedlatif1 Dec 3, 2026
53b3880
Merge branch 'feat/credgroups-w4' into feat/credential-groups-connect
waleedlatif1 Dec 3, 2026
4fded61
Merge branch 'feat/credgroups-w2a' into feat/credential-groups-connect
waleedlatif1 Dec 3, 2026
b71d562
feat(credential-groups): workflow connection status and requests
waleedlatif1 Dec 3, 2026
0fe496b
feat(credential-groups): connect page, focused links, auto-complete
waleedlatif1 Dec 3, 2026
c821e6c
fix(credential-groups): store workflow request policy apart from Access
waleedlatif1 Dec 3, 2026
f678919
fix(credential-groups): link lifecycle and Slack return audit findings
waleedlatif1 Dec 3, 2026
6c41e7b
Merge branch 'feat/credgroups-w3' into feat/credential-groups-connect
waleedlatif1 Dec 3, 2026
9cfee8e
fix(credential-groups): connect page audit findings and wave seams
waleedlatif1 Dec 3, 2026
9e2a87e
fix(credential-groups): connect UI, copy, and docs review findings
waleedlatif1 Dec 3, 2026
9f23d7e
refactor(credential-groups): split enrollment links and the connect f…
waleedlatif1 Dec 3, 2026
17c8484
refactor(credential-groups): prune connect history from its own cron job
waleedlatif1 Dec 3, 2026
425db45
fix(credential-groups): safer connection request emails and a Slack r…
waleedlatif1 Dec 3, 2026
10537db
Merge branch 'feat/credgroups-laneb' into feat/credential-groups-connect
waleedlatif1 Dec 3, 2026
bf78ffd
test(credential-groups): connect flow proofs and merge reconciliation
waleedlatif1 Dec 3, 2026
9809eae
refactor(credential-groups): simplify and cleanup pass
waleedlatif1 Dec 3, 2026
f8136df
Merge origin/staging into feat/credential-groups-connect
waleedlatif1 Dec 3, 2026
fd9b1e0
feat(credential-groups): lane E connect states, people statuses, poli…
waleedlatif1 Dec 3, 2026
00b1ce8
refactor(credential-groups): one link expiry rule, revoked check, and…
waleedlatif1 Dec 3, 2026
0b1e70f
feat(credential-groups): read-only connect page, start POST, and one …
waleedlatif1 Dec 3, 2026
17fa43d
feat(credential-groups): workflow request cap, reminders, policy effe…
waleedlatif1 Dec 3, 2026
9c4f7cb
fix(credential-groups): renew a member's expired request from the con…
waleedlatif1 Dec 3, 2026
a86fb2b
refactor(credential-groups): make the link table the only invitation …
waleedlatif1 Dec 3, 2026
26e3896
fix(credential-groups): harden connect flow, people status, and reque…
waleedlatif1 Dec 3, 2026
641e7a0
Merge remote-tracking branch 'origin/staging' into feat/credential-gr…
waleedlatif1 Dec 3, 2026
55c9b1f
fix(credential-groups): type the enrollment detail's bound and workfl…
waleedlatif1 Dec 3, 2026
243c947
fix(credential-groups): narrow expired OAuth attempts in tests, bump …
waleedlatif1 Dec 3, 2026
4e1ab69
fix(credential-groups): address connect-flow review findings
waleedlatif1 Dec 3, 2026
cf65cd3
Merge remote-tracking branch 'origin/staging' into feat/credential-gr…
waleedlatif1 Dec 3, 2026
5d63872
fix(credential-groups): deliver a request email only while its reques…
waleedlatif1 Dec 4, 2026
d26f758
chore(ci): retrigger checks after runner infrastructure failures
waleedlatif1 Dec 4, 2026
62316b8
Merge remote-tracking branch 'origin/staging' into feat/credential-gr…
waleedlatif1 Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions apps/docs/content/docs/platform/connected-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ Open the organization's **Settings → Credential Groups**. If no pool exists, s
| Tab | Purpose |
| --- | --- |
| **Integrations** | Add providers and manage their shared configuration |
| **People** | Request connections, inspect accounts, resend invitations, and revoke access |
| **People** | Request connections, inspect accounts, send reminders, and revoke access |
| **Access** | Grant a workspace all or selected integrations |

### 1. Add integrations

In **Integrations**, select **Add integration**, search the catalog, and complete any required setup. Use **Configure** to change an added provider's settings or **Remove** in its menu to remove it.
In **Integrations**, select **Add integration**, search the catalog, and complete any required setup. Use **Configure** to change an added provider's settings, **Copy connect link** in its menu to share a link people open to connect it, or **Remove** in its menu to remove it. A copied link works for organization members and for people you or a workflow asked to connect; anyone else is told no connection was requested.

| Provider | Required organization setup |
| --- | --- |
Expand Down Expand Up @@ -62,7 +62,22 @@ On first use, the invitation email must match the signed-in user's verified Sim

The verified Sim user who starts authorization must complete it. The provider account may have a different email; its contribution belongs to the bound Sim user. Managed MCP connections use that person's authorization too. Search separately checks current provider identity and source-specific access requirements.

Use **Resend** in a person's menu when they need the invitation again. **Revoke** stops the organization from using their contributions. They cannot undo an administrator's revocation by reconnecting themselves.
Each person shows one status:

| Status | Meaning |
| --- | --- |
| **Invited** | Sim emailed a request the person has not accepted yet |
| **Requested** | A workflow asked, but Sim did not email the person |
| **Expired** | The request went unaccepted for 7 days; send a reminder to renew it |
| **Email failed** | Sim could not deliver the request email |
| **Not connected** | The person accepted but has no connected account |
| **Connected** | At least one account is connected |
| **Needs reconnect** | An account stopped working and must be reconnected |
| **Revoked** | An admin revoked the person |

People asked by a workflow are also marked **Requested by workflow**.

Use **Send reminder** in a person's menu while any integration they were asked for is not connected; it also renews an expired request. A reminder for a workflow's request stays attributed to the workflow. **Revoke** stops the organization from using their contributions. They cannot undo an administrator's revocation by reconnecting themselves; use **Re-invite** to ask them again.

### 3. Grant workspace access

Expand Down
1 change: 1 addition & 0 deletions apps/docs/content/docs/platform/enterprise/self-hosted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Persist the same value as `CRON_SECRET` on the application and its scheduler. Ea
| Retention: Chat tasks | `GET /api/cron/cleanup-tasks` | Daily | No |
| Retention: file versions | `GET /api/cron/cleanup-file-versions` | Daily | No |
| OAuth token cleanup | `GET /api/cron/cleanup-oauth-tokens` | Hourly | Yes |
| Credential Group link cleanup | `GET /api/cron/cleanup-credential-group-links` | Hourly | Yes |
| Workspace source staging cleanup | `GET /api/cron/cleanup-source-staging` | Hourly | Yes |
| Retention: activity history | `GET /api/cron/cleanup-activity-history` | Daily | Yes |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Create a workflow with a Schedule trigger set to every minute, deploy it, and wa
| Table row TTL cleanup | `/api/cron/cleanup-table-row-ttl` | `*/15 * * * *` | Deletes table rows whose TTL column has expired |
| Stale execution cleanup | `/api/cron/cleanup-stale-executions` | `*/30 * * * *` | Fails runs whose worker died without finishing — workflow executions, background jobs, table jobs and table runs — so they stop showing as running |
| OAuth token cleanup | `/api/cron/cleanup-oauth-tokens` | `0 * * * *` | Deletes access and refresh tokens after the retention tail |
| Credential Group link cleanup | `/api/cron/cleanup-credential-group-links` | `20 * * * *` | Deletes workflow connection-request log rows after two days and connect or self-enrollment links a day after they expire |
| Activity history cleanup | `/api/cron/cleanup-activity-history` | `45 4 * * *` | Deletes organization adoption history past its retention: daily member activity, daily Search integration counts and Search MCP call metadata after 400 days |
| Workspace source staging cleanup | `/api/cron/cleanup-source-staging` | `30 * * * *` | Deletes binary files staged for a workspace source apply a day after they were last staged |
| SCIM reconciliation | `/api/cron/scim-reconcile` | `17 * * * *` | Re-applies directory group mappings |
Expand Down
49 changes: 39 additions & 10 deletions apps/docs/content/docs/workflows/blocks/credential.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ A credential ID is a reference, not a token. The downstream block resolves and a
| Operation | Behavior |
| --- | --- |
| **Select Credential** | Return one workspace OAuth credential reference. |
| **List Credentials** | Return workspace OAuth credential references, optionally filtered by providers. |
| **Find Organization Account** | Find exactly one active OAuth contribution by invitation email and provider. |
| **List Organization Accounts** | Page through active OAuth contributions, optionally filtered by email and providers. |
| **Find Organization MCP Connection** | Find exactly one active managed MCP connection by invitation email and MCP provider. |
| **List Credentials** | Return workspace OAuth credential references, optionally filtered by integrations. |
| **Find Organization Account** | Find the first active OAuth contribution matching an invitation email and integration. |
| **List Organization Accounts** | Page through active OAuth contributions, optionally filtered by email and integrations. |
| **Get Connection Status** | Report whether a person has connected an integration, with a link they can open to connect it. |
| **Request Connection** | Ask a person to connect an integration, when an organization admin allows workflow requests. |
| **Find Organization MCP Connection** | Find the first active managed MCP connection matching an invitation email and MCP provider. |
| **List Organization MCP Connections** | Page through active managed MCP connections, optionally filtered by email and provider. |

These operations do not select secrets or service accounts. Function can read a returned ID string, but does not automatically resolve it to a token.
Expand All @@ -39,7 +41,7 @@ These operations do not select secrets or service accounts. Function can read a

For **Select Credential**, choose **Credential** from the workspace's connected OAuth accounts. Advanced mode accepts a **Credential ID** copied from Credentials settings or resolved from an earlier output.

For **List Credentials**, optionally select one or more **Provider** values. The picker shows providers with connected credentials; leave it empty for all workspace OAuth credentials.
For **List Credentials**, optionally select one or more **Integrations**. The picker shows integrations with connected credentials; leave it empty for all workspace OAuth credentials.

### Organization accounts [#organization-accounts]

Expand All @@ -49,16 +51,18 @@ Authorized workflows in an allowed workspace can discover active contributions f

| Operation | Required | Optional |
| --- | --- | --- |
| Find Organization Account | **Email**, **Provider** | — |
| List Organization Accounts | — | **Email**, **Providers**, **Limit**, **Cursor** |
| Find Organization Account | **Email**, **Integration** | — |
| List Organization Accounts | — | **Email**, **Integrations**, **Limit**, **Cursor** |
| Get Connection Status | **Email**, **Integration** | **Return to** |
| Request Connection | **Email**, **Integration** | **Return to** |
| Find Organization MCP Connection | **Email**, **MCP provider** | — |
| List Organization MCP Connections | — | **Email**, **MCP provider**, **Limit**, **Cursor** |

**Email** means the invitation address associated with the person's verified Sim account. It can differ from the OAuth provider's account email. See [email association](/platform/connected-accounts#how-the-email-is-associated-with-a-sim-user).

List **Limit** defaults to 100 and accepts 1–100. **Cursor** accepts the previous page's `nextCursor` with the same filters. The block does not fetch all pages automatically.

Find fails unless exactly one active connection matches. List returns empty results when none match. Disconnected accounts, revoked invitations, and accounts needing reconnection are excluded; multiple accounts contributed by one person stay separate.
Find returns the first active connection that matches and fails when none do; use List when a person may have contributed more than one account. List returns empty results when none match. Disconnected accounts, revoked invitations, and accounts needing reconnection are excluded; multiple accounts contributed by one person stay separate.

## Outputs

Expand Down Expand Up @@ -86,6 +90,31 @@ Pass `<credential.credentialId>` to compatible credential fields. A deleted cred

For example, name the block **Account**, choose Find Organization Account, set Email to `alex@example.com`, and select Gmail. Use `<account.credentialId>` in a Gmail block to act with that contribution.

### Connection status and requests [#connection-requests]

**Get Connection Status** returns:

| Output | Meaning |
| --- | --- |
| `status` | `connected`, `not_connected`, or `needs_reconnect` |
| `connected` | Whether a usable account exists |
| `credentialId` | The account Find Organization Account would return, or `null` unless connected |
| `connectUrl` | A link the person opens to sign in to Sim and connect this integration |

The status never says whether the person was invited, removed, or never asked. `connectUrl` carries no secret: the page checks that the signed-in person is the one with that email before anything is connected, so it is safe to post, for example as a Slack button.

A `connectUrl` from Get Connection Status alone works only for members of your organization. Anyone else must be asked first, by **Request Connection** or by an admin in **People**; otherwise the page tells them no connection was requested. So when `connected` is false, call **Request Connection** first, then show `connectUrl`.

Set **Return to** to **Slack** when the person starts in Slack: once their account is connected, the page offers a **Return to Slack** button. It opens the Slack app, so someone using Slack in a browser instead closes the tab, and the page says so. With **None** the page tells them they can close the tab. Someone who opens the link again after connecting is told the account is already connected.

**Request Connection** returns `requested` and `connectUrl`. It works only when an admin turns on **Allow workflow requests** under **Workflow connection requests** in **Settings → Credential Groups → Access**, for the workflow's workspace, the person's email domain, and the integration. That setting is the only gate: any run of the workflow can request a connection, including a manual run by a workspace member with read access. A request outside those settings, or past the daily limit, fails with an error. Otherwise the result is the same whether the person was already asked, already connected, or removed; a removed person is never re-invited. Use the person's primary address: an address with a `+` alias is refused.

The daily limit counts each new person asked per day, across all workspaces; below the limit, asking again for someone already asked that day does not count. Once the limit is reached, every request fails, including one for someone already asked that day. A request the person has not accepted expires after 7 days; asking again renews it.

Sim emails the person only when the admin turned on **Also email the person**. The email carries the link and the workflow's name. Sim sends up to 3 reminders, each only when a workflow asks again after a day with no request for that person, and none after 30 days. Runs from the workflow editor are real: they send real emails and count toward the daily limit.

To continue once the person connects, deploy a workflow listening for both **Credential Added** and **Credential Reconnected**: someone who connected before and was then disconnected comes back as a reconnection.

### Managed MCP

| Field | Meaning |
Expand All @@ -103,7 +132,7 @@ Use `credentialId` to select the person's connection in an MCP Tool block. `mcpS

## List accounts and process each one

1. Name the Credential block **Accounts**. Select **List Credentials** and filter **Provider** to Gmail, or use **List Organization Accounts** and filter **Providers** to Gmail.
1. Name the Credential block **Accounts**. Select **List Credentials** and filter **Integrations** to Gmail, or use **List Organization Accounts** and filter **Integrations** to Gmail.
2. Pass `<accounts.credentials>` into a For Each loop.
3. Inside the loop, set the Gmail credential to `<loop.currentItem.credentialId>`.
4. For organization lists, repeat with `nextCursor` while `hasMore` is true, preserving filters.
Expand All @@ -126,7 +155,7 @@ Switch the block to trigger mode, select an **Event**, and deploy in an allowed
| Credential Reconnected | Existing contribution reconnected |
| Account Connections Submitted | Connection form submitted |

Events include `event`, `timestamp`, `email`, `enrollmentId`, `enrollmentStatus`, `credentialGroupId`, and `credentialGroupName`. Added/reconnected events also include account details such as `credentialId`, `provider`, and `displayName`; `mcpServerId` identifies shared MCP configuration and is null for OAuth accounts.
Events include `event`, `timestamp`, `email` (lower-cased), `enrollmentId`, `enrollmentStatus`, `credentialGroupId`, and `credentialGroupName`. Added/reconnected events also include account details such as `credentialId`, `provider`, and `displayName`; `mcpServerId` identifies shared MCP configuration and is null for OAuth accounts.

Every deployed workflow selecting that event in an allowed workspace can receive it. Removing workspace access stops later delivery. Replace legacy Credential Group blocks with Credential; they are not automatically converted.

Expand Down
14 changes: 14 additions & 0 deletions apps/sim/app/(auth)/auth-redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ export function isOAuthAuthorizationCallback(callbackUrl: string, origin: string
}
}

/**
* Whether sign-in continues into a Credential Group connect or enrollment page, written either as
* a path or as an absolute URL on this origin.
*/
export function isCredentialGroupConnectCallback(callbackUrl: string, origin: string): boolean {
if (!callbackUrl) return false
try {
const callback = new URL(callbackUrl, origin)
return callback.origin === origin && callback.pathname.startsWith('/credential-groups/')
} catch {
return false
}
}

interface AuthCrossLinkParams {
/** Validated post-auth destination to carry over, or null to drop it. */
callbackUrl: string | null
Expand Down
51 changes: 36 additions & 15 deletions apps/sim/app/(auth)/login/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { client } from '@/lib/auth/client'
import { validateCallbackUrl } from '@/lib/core/security/input-validation'
import { getBaseUrl } from '@/lib/core/utils/urls'
import { quickValidateEmail } from '@/lib/messaging/email/validation'
import { DEFAULT_POST_AUTH_ROUTE, POST_AUTH_REDIRECT_STORAGE_KEY } from '@/app/(auth)/auth-redirect'
import {
DEFAULT_POST_AUTH_ROUTE,
isCredentialGroupConnectCallback,
POST_AUTH_REDIRECT_STORAGE_KEY,
} from '@/app/(auth)/auth-redirect'
import {
AuthDivider,
AuthEmailInput,
Expand Down Expand Up @@ -118,6 +122,10 @@ export default function LoginPage({
logger.warn('Invalid callback URL detected and blocked:', { url: callbackUrlParam })
}
const callbackUrl = isValidCallbackUrl ? callbackUrlParam! : DEFAULT_POST_AUTH_ROUTE
/** Invitees connecting accounts mostly arrive from a link; Google and Microsoft come first. */
const connectFlow =
isValidCallbackUrl &&
isCredentialGroupConnectCallback(callbackUrl, new URL(getBaseUrl()).origin)

const [forgotPasswordOpen, setForgotPasswordOpen] = useState(false)
const [forgotPasswordEmail, setForgotPasswordEmail] = useState('')
Expand Down Expand Up @@ -381,6 +389,18 @@ export default function LoginPage({
const passwordFieldErrors = showValidationError && passwordErrors.length > 0 ? passwordErrors : []
const canSubmit = email.trim().length > 0 && password.length > 0

const socialButtons = (
<SocialLoginButtons
view='login'
googleAvailable={googleAvailable}
githubAvailable={githubAvailable}
microsoftAvailable={microsoftAvailable}
callbackURL={callbackUrl}
ssoEnabled={ssoEnabled && !hasOnlySSO}
disabled={isLoading}
/>
)

if (!emailPasswordEnabled && !ssoEnabled && !hasSocial)
return (
<AuthHeader
Expand Down Expand Up @@ -443,7 +463,18 @@ export default function LoginPage({
return (
<>
<div className='au:space-y-[var(--auth-group-gap)]'>
<AuthHeader title='Sign in' description='Welcome back to Sim.' />
{connectFlow ? (
<AuthHeader title='Sign in to connect your account' />
) : (
<AuthHeader title='Sign in' description='Welcome back to Sim.' />
)}

{connectFlow && showBottomSection && socialButtons}
{connectFlow && showDivider && (
<AuthDivider
label={emailPasswordEnabled ? 'Or sign in with email' : 'Or continue with'}
/>
)}

{showTopSSO && (
<SSOLoginButton callbackURL={callbackUrl} variant='primary' disabled={isLoading} />
Expand Down Expand Up @@ -514,19 +545,9 @@ export default function LoginPage({
</form>
)}

{showDivider && <AuthDivider label='Or continue with' />}

{showBottomSection && (
<SocialLoginButtons
view='login'
googleAvailable={googleAvailable}
githubAvailable={githubAvailable}
microsoftAvailable={microsoftAvailable}
callbackURL={callbackUrl}
ssoEnabled={ssoEnabled && !hasOnlySSO}
disabled={isLoading}
/>
)}
{!connectFlow && showDivider && <AuthDivider label='Or continue with' />}

{!connectFlow && showBottomSection && socialButtons}

<AuthLegalFooter action='signing in' />
</div>
Expand Down
Loading
Loading