Chapter 5: n8n Cloud vs. Lab Playground Differences (API/Google Auth Setup)¶
Video: Watch this chapter on YouTube (45:06)
Overview¶
This chapter explains the key differences between using n8n Cloud and the CodeCloud lab playgrounds. It covers the specific configurations needed for each environment, particularly focusing on API key setup with CodeKey and Google OAuth authentication for services like Gmail.
Detailed Summary¶
Initial Lab Setup¶
When entering a lab environment for the first time:
- Enter credentials: Email, first name, last name, and password
- These are NOT saved anywhere permanent
- You can use different credentials for each lab instance
- Skip onboarding: Hit "Get Started" to bypass questionnaires
- Skip paid features: Click "Skip" for paid feature prompts
- Access dashboard: Similar to n8n Cloud environment
Building the Email AI Agent in Labs¶
Starting the Workflow¶
- Click "Start from scratch"
- Add a Chat Trigger node
- Add an AI Agent node
- Select OpenAI Chat Model
Using CodeCloud Keyspace in Labs¶
Finding CodeKey Access¶
- Look at the left-hand instruction panel in the lab
- Click the CodeKey link provided
- Hit "Launch Now"
- Click "Start Playground"
Configuring CodeKey Credentials¶
- Select the desired model (e.g., OpenAI GPT-4.1)
- Copy the API Key
- In n8n, create new credential
- Paste the API Key
- Important: Replace the base URL with CodeKey's base URL
- Click Save
Expected result: "Connection tested successfully"
The Model Selection Issue¶
When using CodeKey, the model dropdown won't work correctly:
Problem: - "Pick from list" shows incorrect/incompatible models - Selecting from list causes errors
Solution:
1. Change to "By ID"
2. Copy exact model name from lab instructions: openai/gpt-4.1
3. Paste word-for-word
Using OpenAI API Keys Directly¶
For comparison, using native OpenAI keys is more straightforward:
Getting OpenAI API Key¶
- Go to
platform.openai.com - Navigate to API Keys section
- Click "Create new secret key"
- Name it (e.g., "email integration")
- Copy the API key
Configuring in n8n¶
- Create new credential
- Name it (e.g., "OpenAI Account 2")
- Paste API key
- Leave base URL as default (don't modify)
- Click Save
Advantage: Model dropdown works correctly—you can pick from list normally.
Google OAuth Setup for Gmail (Lab Environment)¶
The major difference between n8n Cloud and labs is Google authentication:
n8n Cloud (Easy Method)¶
- "Sign in with Google" button available
- One-click OAuth if using Chrome browser
Lab Environment (Manual OAuth)¶
Requires manual Google Cloud Console setup:
Step-by-Step Google OAuth Configuration¶
Step 1: Create Google Cloud Project¶
- Go to
console.cloud.google.com - Click on project selector (top left)
- Click "New Project"
- Name it (e.g., "n8n Email App")
- Select "No organization"
- Click "Create"
- Select the new project
Step 2: Enable Gmail API¶
- Search for "Gmail API"
- Click on Gmail API
- Click "Enable"
Step 3: Configure OAuth Consent Screen¶
- Navigate to "OAuth consent screen"
- Click "Get Started"
- Enter App Information:
- App name: "n8n Email App"
- User support email: Your email
- Select "External" for audience
- Add contact information email
- Click Continue → Create
Step 4: Add Test Users¶
- Go to "Audience" section
- Add a test user (email you'll use for sending)
- Save
Step 5: Create OAuth Client ID¶
- Go to "API and Services" → "Credentials"
- Click "Create Credentials" → "OAuth client ID"
- Application type: "Web application"
- Name it (e.g., "n8n Email OAuth Client")
- Add Authorized Redirect URI:
- Copy from n8n credential setup screen
- Paste into Google Cloud Console
- Click "Create"
Step 6: Copy Credentials to n8n¶
- Copy Client ID from Google
- Paste into n8n Client ID field
- Copy Client Secret from Google
- Paste into n8n Client Secret field
- "Sign in with Google" button now appears!
Step 7: Complete OAuth Flow¶
- Click "Sign in with Google"
- Select your Google account
- See "Google hasn't verified this app" warning
- Click "Continue" (you created it, so it's safe)
- Select all permissions
- Click "Continue"
- See "Connection successful"
Testing the Gmail Integration¶
After setup: 1. Configure Gmail node for sending 2. Set fields to "Determine by model" 3. Test with a message: "Hi, can you send an email to [email] to just say hello" 4. Workflow sends email successfully
Key Differences Summary¶
| Feature | n8n Cloud | Lab Playground |
|---|---|---|
| Google OAuth | One-click sign-in | Manual OAuth setup required |
| CodeKey Models | By ID selection | By ID selection |
| Native OpenAI | Works normally | Works normally |
| Community Nodes | Full availability | May have limitations |
| Version Support | Latest features | May vary |
| Gmail Setup | Simple OAuth | Google Cloud Console required |
Troubleshooting Notes¶
If experiencing issues during builds, consider:
- Self-hosted vs Cloud differences: Some features are Cloud-only
- Version variations: Labs may run different n8n versions
- Community nodes: Availability may differ
- Workarounds exist: Most limitations have alternative solutions
Applying to Other Google Services¶
The same OAuth setup applies to: - Google Sheets - Google Drive - Google Docs - Other Google APIs
For each service: 1. Enable the specific API in Google Cloud Console 2. Use the same OAuth credentials 3. API must be enabled before use
Key Takeaways¶
-
Lab credentials are temporary: You don't need to remember passwords used in lab environments.
-
CodeKey requires "By ID" selection: Always type the exact model name rather than selecting from dropdown.
-
OpenAI direct keys work normally: Native OpenAI API keys allow normal model selection from lists.
-
Google OAuth differs by environment: n8n Cloud has one-click; labs require manual Google Cloud setup.
-
OAuth consent screen is required: Google requires app registration before OAuth access.
-
Test users must be added: For "External" apps, add your email as a test user.
-
Same OAuth works for all Google services: One setup enables Gmail, Sheets, Drive, and Docs.
-
Enable APIs individually: Each Google API must be explicitly enabled in Cloud Console.
-
Redirect URIs must match: Copy exact URI from n8n into Google Cloud Console.
-
Workarounds exist: Lab limitations don't prevent learning—alternative approaches are available.
Conclusion¶
Understanding the differences between n8n Cloud and lab environments prevents frustration during hands-on exercises. While n8n Cloud offers streamlined authentication with services like Google, the lab environment provides valuable experience with manual OAuth configuration—a skill needed for self-hosted deployments. The CodeKey integration works similarly in both environments but requires specific model naming conventions. By mastering both approaches, learners gain flexibility to work in any n8n environment, whether cloud-hosted, self-hosted, or in educational lab settings. This knowledge is particularly valuable for enterprise deployments where manual OAuth configuration is often required for security compliance.