n8n API Calling, Collaboration, Workflow Sharing & Credential Management

Learn n8n API Calling, Collaboration, Workflow Sharing & Credential Management in this comprehensive n8n tutorial. Step-by-step guide with video, code examples, and expert tips from the n8n Zero to Hero course.

Table of Contents

Overview

This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 8. Enterprise Features & Conclusion.

Watch the video above for the full tutorial, or read the written guide below.

What is n8n's role-based access and workflow sharing system?

n8n's role-based access system assigns three roles to control who can do what in a shared workspace. The owner holds full access and is limited to one per instance. Admins can manage users, workflows, and credentials but cannot modify the owner role. Members manage only their own workflows. Workflows are private by default and must be explicitly shared, granting collaborators an editor role on that specific workflow.

How to share workflows, credentials, and control n8n via API

Adding users and sharing workflows

User management lives under Settings > Users. Click Invite, enter the recipient's email address, and they receive an invitation link. Once they accept, their account appears in the Users panel. To share a workflow, open it and click the Share button at the top of the canvas. Select users who have joined your instance, confirm they appear with an editor role, and click Save. To remove access, return to Share, click the delete icon next to the user, and save again. Admin roles require the Pro plan; on the Starter plan, additional invited users default to the member role.

Sharing credentials without exposing secrets

Credential sharing lets team members use API keys and OAuth tokens in workflows without ever seeing the underlying values. Navigate to your personal space, click the Credentials tab, open a credential such as an ElevenLabs API key, and click Sharing. Select a project to grant everyone in that project access, or pick individual users, then click Save. To revoke access, click the delete icon next to the user and save. Only the owner and admins can revoke credential access from other users.

Controlling n8n programmatically via the API

The n8n API is accessible under Settings > n8n API. Click Create an API key, provide a name, and set an expiration (7, 30, 60, or 90 days; no expiration is not recommended). Review the available scopes: users, workflows (create, read, update, delete, activate, deactivate), executions, credentials, tags, and variables. To call the API from an HTTP Request node, set the method to GET and form the URL as <your-instance-url>/api/v1/users. Add a Header Auth credential named x-n8n-api-key with the API key as its value, plus an Accept: application/json header. For in-workflow control, use the dedicated n8n node under the same credential; it wraps the same endpoints in a UI-driven interface and eliminates manual URL construction.

Key Takeaways

  • The owner role is capped at one per instance with full access. Admins can manage users, workflows, and credentials but cannot modify the owner. Members control only their own workflows with no global instance access.
  • Workflows are private by default. Sharing requires opening the workflow, clicking Share, selecting invited users who receive an editor role, and clicking Save. Access is revoked the same way using the delete icon.
  • Credential sharing lets collaborators use API keys such as ElevenLabs or Google Sheets tokens inside workflows without being able to view or extract the actual key values. Only the owner and admin accounts can revoke this access.
  • The n8n API enables programmatic workflow activation and deactivation, making it practical to build a meta-workflow that turns other workflows on at 8 a.m. and off at 6 p.m., preventing wasted execution credits outside business hours.
  • The x-n8n-api-key header authenticates external code calling the n8n REST API. For in-workflow orchestration, the dedicated n8n node exposes the same actions without requiring manual URL construction.

Next Steps

Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.

Frequently Asked Questions

Workflow sharing and credential sharing in n8n are completely separate actions. Sharing a workflow grants collaborators an editor role on that workflow but gives them no access to the credentials it uses. To let them execute the workflow successfully, you must also open each credential under Settings > Credentials, click Sharing, select the user, and save. Without this step, the workflow will fail for anyone who tries to run it.

The n8n API key scope system restricts which actions a generated key is permitted to perform. Available scopes cover user management, workflow operations (create, read, update, delete, activate, deactivate), execution log retrieval, credential management, tags, variables, and source control. On the Starter plan, scope selection is disabled and the key receives full access by default. The Pro plan and above let you restrict a key to specific scopes before saving it.

The HTTP Request node makes raw REST calls to the n8n instance URL formatted as `/api/v1/`, authenticated via an `x-n8n-api-key` header. This approach works identically to any external application or programming language targeting the same API. The dedicated n8n node wraps those same endpoints in a UI-driven interface with a credential selector, making it faster to configure from inside a workflow. Use HTTP Request for external integrations; use the n8n node for in-workflow orchestration.

n8n API keys with no expiration remain valid indefinitely, which widens the damage window if a key is ever leaked or compromised. The API key creation screen under Settings > n8n API offers 7, 30, 60, and 90-day presets plus a custom option. The instructor explicitly flags no-expiration keys as not recommended and advises rotating credentials regularly as a standard security practice to limit the period any single key stays valid.

Dheeraj Sharma

Dheeraj Sharma

AI Systems Builder
Creator of the n8n Zero to Hero course (42 lessons, 31+ hours). I help solopreneurs build AI systems that grow revenue without growing workload.

Get the n8n Mastery Bundle

All workflows, cheat sheets, and premium resources from the entire course in one package.

Get Premium Resources