Service accounts for automations
A service account is access for an automation — an n8n workflow, an externally run AI agent or a script of your own. It uses the same access as your own AI applications, but does not sign in as a person; it signs in with a client ID and client secret.
You find service accounts under Settings → AI → External applications, card Service accounts. Only tenant admins can create and manage them.
Prerequisite
Section titled “Prerequisite”Service accounts use the switch Allow external applications (Enabling external AI applications). While it is off, no service account gets access and running connections end. The accounts themselves remain — switch it back on and they continue working.
Creating an account
Section titled “Creating an account”- Name — how the account appears in the log and in drafts, for example “n8n onboarding”.
- Acts for — an agent or a person in your tenant. The account sees exactly what this agent or person may see. It therefore reaches confidential entries only through their connections in the graph.
- Roles — what the account may do, just like a member. Without a role it may do nothing. With the role “Observer” it only reads; with a role that allows drafts it proposes changes.
After saving, roleALPHA shows the credentials once: client ID, client secret, token URL and MCP URL. Copy the secret into your automation right away — only its fingerprint is stored, and it cannot be shown again.
Setting it up in n8n
Section titled “Setting it up in n8n”- Add an MCP Client Tool node (on the AI Agent) or an MCP Client node, enter the MCP URL as endpoint, transport HTTP Streamable.
- Under Authentication choose “MCP OAuth2 API” and create a new credential.
- Turn off Use Dynamic Client Registration and choose Grant Type “Client Credentials”.
- Enter the token URL as Access Token URL, plus client ID and client secret; Authentication “Header”.
n8n then fetches new access every 60 minutes by itself. The same details work in any automation that supports OAuth 2.0 with “Client Credentials”.
If n8n reports “The client is not authorized …”, the account may not act right now: it is deactivated, “External AI access” is off or its anchor was deleted. If it reports HTTP 503 “The installation of this organisation is not responding” instead, nothing is wrong with the account — the installation that holds your organisation’s data is temporarily unreachable. Let the node retry (Retry On Fail); as soon as the installation answers again, it carries on without any change.
Running agents (runners)
Section titled “Running agents (runners)”A service account can also work as one of your agents, run by run. This is meant for a runner, such as an n8n workflow that runs several agents with one set of credentials, or for Claude: the Claude runner runs one agent with Claude and gives it only the roleALPHA tools.
- Give one of the account’s roles the permission “Run AI agents”.
- In the account’s dialog, select the agents under “May run these agents” — or tick “All agents of this organisation, including future ones”. Then every agent can be run, including ones you create later; your selection stays saved and applies again once you untick the box.
- For each run, the runner exchanges its account token for an agent run token. It is valid for 15 minutes and carries exactly that agent’s view.
During the run, the account sees only what the agent may see, nothing more. It proposes changes as drafts only: approving and administration are blocked during a run, even if the account otherwise has admin rights.
The runner gets no run token if
- the agent is not selected,
- the permission is missing,
- the agent is not Active (draft or retired), or
- its budget per period is used up.
Each of these cases returns its own reason to the runner. If an agent is retired or deselected during a run, the run ends with the next call.
An agent’s weekly hours do not block a run: they are a plan, not a measurement. Only the budget blocks, and only if the runner reports consumption. It reports it per run with this account’s token and calculates the cost itself; that still works when the budget has just been used up (AI agents have limits). If demand planning is unreachable, the run starts anyway, and this is noted in the log.
On an agent’s page, each account shows whether it acts for it or may run it. The technical integration for runner developers is described in the document Connecting runners (doc/AGENT-LAUF-RUNNER.md).
Reacting to changes
Section titled “Reacting to changes”An automation that reacts to changes in roleALPHA does not have to query every object again and again. The tool list_changes tells it which objects have effectively changed since its last look:
- Approved changes only. A draft appears only once it has been approved and applied.
- Relationships count. When a relationship is added, changed or removed, each of its ends counts as changed — also when an object was deleted and its relationships went with it.
- Own changes are recognisable. If the account itself proposed or applied a change, it is marked. This way an automation does not react to what it wrote itself.
- The ID, not the content. The automation gets the object ID, type, time and kind of change. It then fetches the content it needs.
- The same view as always. Whatever the account may not see does not appear here either, nor do modules that are not released for AI. Deleted objects appear only as long as their visibility can still be checked. For an account that acts for an agent or a person, that is no longer the case after deletion.
On the first call the automation passes a point in time (the current one if it needs no history), afterwards the cursor from the previous answer. Ideally it keeps the cursor in an n8n data table and asks once every few minutes. How far back the list reaches depends on your organisation’s retention period.
What the account may do — and what not
Section titled “What the account may do — and what not”- Permissions from its roles. If you change the roles, this applies from the next call, without new credentials.
- Visibility from its anchor. If the agent or person disappears, the account stops working.
- Approving through its roles. If the account has approval rights (for example as tenant admin), it can approve drafts. It never votes in consensus or consent and never takes the role of the highlander person — even if its anchor is that person. Those are decisions for people.
- Never as a person. The log, drafts and time travel show “Service account ‹name›”, never the name of the person it acts for.
- This tenant only. A service account belongs to exactly one organisation.
- No administration. A service account does not create or change service accounts — not even with an admin role.
Changing the secret, deactivating, deleting
Section titled “Changing the secret, deactivating, deleting”- New secret creates an additional secret; the old one keeps working. This lets you switch without downtime: enter the new one, then revoke the old one.
- Revoke takes effect immediately — including on access already obtained with that secret.
- Deactivate blocks the account on the next call and ends running connections; activating releases it again without a new secret.
- Delete removes the account and its secrets permanently.
Service accounts are not backed up: after restoring the tenant, create them again. This way no backup can silently give an automation access again.
What is logged
Section titled “What is logged”Creating, changing, deactivating, deleting and every new or revoked secret appear in the change history, with the person who did it. Every started or refused agent run appears there too, with the agent, the run ID and, where applicable, the reason for refusal. Changing calls during a run name the acting agent, the executing account and the run ID. Every call of the account appears in usage analytics just like external applications; changing calls also appear in the change history. On an agent’s page, everyone who may see the agent sees which service accounts act for it.