powered by

Let each user connect their own account

Give each user their own integration connection, such as their Google Calendar or an API key, so a workflow acts as the user who triggered it.

Last updated

A connection belongs either to the whole project or to one user. A project connection is available to every workflow. A user connection belongs to one user, and only jobs that user triggers can use it. When that user triggers a workflow, an Integration step set to Current User (first connection) can act on their account. For example, a booking workflow can put the event on the booker's own Google Calendar.

How integrations work explains project and user connections.

Create a user connection

In the Anythink dashboard

The Settings › Integrations page creates project connections only. Use the CLI, or build a "connect your account" page in your own app that calls the integrations API as the signed-in user with is_user_connection: true. The user's role needs anythink_integrations:read and anythink_integrations:create.

With the CLI

The connection belongs to the user signed in to the current CLI profile:

bash
anythink integrations oauth connect google-calendar --user-connection --name "My calendar"
anythink integrations connect openai --user-connection --name "My OpenAI key"

integrations connect prompts for the API key without echoing it. OAuth providers need their OAuth client set up first. See Connect Google Calendar to create events and Connect Slack to send workflow messages.

With an AI assistant (MCP)

text
Connect my own Google Calendar to this project as a user connection, using the anythink CLI.

The assistant calls the cli tool with integrations oauth connect google-calendar --user-connection, and Google's consent screen opens in your browser. This needs the MCP server running locally in stdio mode. The hosted MCP server doesn't run integration commands.

Note: For API-key providers, run integrations connect in your own terminal. Through an assistant, the key would have to be passed in the command and would end up in your conversation.

Use it in a workflow

Set the Integration step's Credential Source to Current User (first connection). The step looks for an enabled connection visible to the user who triggered the job: their own user connection, or a project connection for the same provider.

The triggering user is whoever caused the event: the user whose API call created or updated the record, who pressed a workflow button, or who called the workflow's API route. Test Workflow runs as you.

Limit: When both a user connection and a project connection exist for the provider, Anythink doesn't guarantee which one Current User (first connection) picks. For a provider you use per user, keep only user connections.

Limit: Timed workflows have no triggering user, so Current User (first connection) can only find project connections.

Verify

  1. Run anythink integrations connections list --provider google-calendar while signed in as the user. Their connection is listed. Signed in as a different user, it isn't.
  2. Trigger the workflow as that user and confirm it acted on their account: the event is on their calendar, not a shared one.

Each user sees their own connections and the project's, never other users'.

Variations

  • Pick the connection explicitly. Store each user's connection ID on a record and use Specific Connection (by ID) with a template such as {{ $anythink.trigger.data.connection_id }}.
  • Pause or remove one. Disable a connection to stop workflows using it, or disconnect it to delete its credentials. See Rotate, pause or disconnect an integration.

Next steps