AI Email Composer: Complete Lab Solution
Explore the full solution to the AI Email Composer lab, including the full workflow, configuration steps, and answers.
Email tool used in this version: Gmail (Send a message in Gmail)How to Access AIX Workspace
Create your account
- Open your browser and go to www.aixworkspace.net.
- On the home page, click Access Platform.
- You will land on a page titled Access AIX Workspace. Scroll down a little until you see Create your AIX Workspace Account.
- Fill in your Full name and Email address.
- Under I’m registering as, choose Individual (not Company / Organization).
- Click Create My Account.
Get your credentials from email
After you create the account, you will receive an email from register@aixworkspace.net. This email gives you three sets of credentials:
n8n login
PostgreSQL database
AI model
n8n · Automation platform login
https://n8n.…/signinyou@example.com••••••••PostgreSQL · Database
your-host5432your_dbyour_user••••••••AI Model · Credentials
https://…/v1sk-••••••••qwen3-8-27bLog in to n8n
- In the email, find the n8n section and click the Sign-in URL.
- Log in using the email and password from that same email.
- You are now on the n8n dashboard.
Verify your credentials inside n8n
Your Credentials are already configured inside n8n please verify. On the dashboard, open Credentials and add two credentials using the details from your email:
- Your PostgreSQL database credentials.
- Your AI model credentials (Base URL and API key).
Build Your First Workflow: Email Dictation Model
In this part you will build a simple automation. You talk to an AI agent in chat, and it writes and sends an email for you. The workflow has four pieces: a chat trigger, an AI agent, a memory, and an email tool.
Create the workflow
- Click Create Workflow. You will see an empty canvas.
- Name the workflow Email Dictation Model.
Add the chat trigger
- Click the plus (+) button in the middle of the canvas, or at the top-right.
- Select the Chat Trigger node — it is called When chat message received.
Add the AI Agent
- Click the plus (+) after the trigger and add the AI Agent node.
Set the Chat Model
- Under the AI Agent, click Chat Model and select OpenAI Chat Model.
- Your credentials are already filled in (you set the AI model credential in Part 1).
- Open the node and select the model qwen3-8-27b.
Set the Memory
- Under the AI Agent, click Memory and select Postgres Chat Memory.
- Its credentials are already filled in (your PostgreSQL credential from Part 1).
Add the email tool (Gmail — Send a message in Gmail)
6.1 Add the Gmail tool
- Under the AI Agent, click Tool (the + under Tool) and search for Gmail.
- Select the Gmail Tool. Choose the action Send a message. The node will appear on the canvas named Send a message in Gmail.
6.2 Connect your Gmail account (one-time setup)
Because n8n is self-hosted, “just connect your account” will not work here. You first make your own Google login (a Client ID and a Client Secret), then connect. This is a one-time setup.
- Create the OAuth client in Google Cloud. Go to console.cloud.google.com/auth/clients. Click Create client, choose Web application, and give it a name (for example n8n).
Google Cloud → Clients. Click Create client and choose Web application. - Create the credential in n8n and copy the Redirect URL. In n8n, open the Send a message in Gmail node. Under Credential to connect with, click Create new credential and choose Gmail OAuth2 API. Copy the OAuth Redirect URL shown at the top.
The n8n Gmail credential — copy the OAuth Redirect URL, and later paste your Client ID and Client Secret here. - Paste the Redirect URL in Google. Open your new client in Google. Under Authorized redirect URIs, click Add URI, paste the URL you copied from n8n, and click Save.
Paste the redirect URL under Authorized redirect URIs. The Client ID is on this same page. - Copy the Client ID and Client Secret. The Client ID is on the client page (see the previous screenshot). The Client Secret is in the Client secrets section. Google shows the secret only when it is created, so copy it right away. If you missed it, click Add secret to create a new one.
Client secrets — copy the Client Secret (you see it only when it is created). - Paste them into n8n. In the n8n credential window, paste the Client ID and Client Secret into their fields.
- Add yourself as a test user. In Google, go to Audience → Test users → Add users, and add your own Gmail address. Without this, sign-in will be blocked.
Audience → Test users — add your own Gmail as a test user, or sign-in will be blocked. - Enable the Gmail API. In Google Cloud, open APIs & Services → Library, search for Gmail API, and click Enable (direct link: console.cloud.google.com/apis/library/gmail.googleapis.com). Make sure your own project is selected at the top.
- Sign in with Google. Back in n8n, click Sign in with Google and allow access.
Important — permissions: On the Google permission box, tick Read and Compose only. Do NOT tick the option that can permanently delete emails.
- Save the credential. When n8n shows the account as connected, save and close the credential window.
6.3 Configure the Gmail node
- Leave the Tool Description set to Automatic.
- Set Resource to Message and Operation to Send.
- For To, let the AI Agent decide (use the option to let the model define this parameter).
- Let the Subject and the Message be written by the agent as well.
- Set Email Type to Text.
- Under Options, you can switch off Append n8n attribution so the email does not carry the n8n footer.
Note: you do not enter a “From” address. Gmail sends the email from the Google account you connected in step 6.2.
Test the workflow
- Open the Chat panel at the bottom-left of the canvas.
- Type a message like “Hello, send an email …” and watch the agent write and send it.