Automation Library
Ready-to-import workflow automations powered by People.ai
Setup Guides About LLM Skills
← Back to Library
← Back to Library

About the People.ai Automation Library

This library contains ready-to-import workflow automations that leverage the People.ai MCP (Model Context Protocol) integration alongside AI models, CRM data, and communication tools to deliver actionable sales intelligence.

Each workflow is a complete automation that can be imported into your preferred platform. Workflows combine People.ai's engagement data with Claude AI to generate insights like daily sales digests, meeting briefs, pipeline coaching reports, and account risk alerts.

Supported Platforms:
Any (JSON import) Workato — Coming Soon Zapier — Coming Soon Others — Coming Soon

How it works:
1. Browse the library and pick a workflow
2. Download the workflow JSON
3. Import into your automation platform
4. Connect your credentials (People.ai MCP, Anthropic, Slack, etc.)
5. Configure schedule and channel settings
6. Activate the workflow

Prerequisites:
• An automation platform instance (self-hosted or Cloud)
• People.ai MCP credentials
• Anthropic API key for Claude AI
• Slack Bot token (for most workflows)
• Additional credentials as noted per workflow

Maintained by: AI Innovation Team
Slack: #automation-workflows

← Back to Library

Setup Guides

Step-by-step configuration guides for the services that power these workflows.

Data Source

🧠
People.ai MCP
Core data source for all workflows. MCP server setup, authentication, available tools, and platform integration.
Required for all workflows

Delivery Platforms

💬
Slack
Bot token scopes, app creation, channel invites, and DM delivery setup.
9 scopes covered
🟦
Microsoft Teams
Incoming Webhooks for channels, Bot Framework with Azure AD for DMs and adaptive cards.
Webhooks + Bot Framework
🟢
Google Chat
Space webhooks for alerts, Chat App with GCP service account for proactive DMs.
Webhooks + Chat App
📧
Email (SMTP)
Gmail, Outlook/M365, and SendGrid setup. Universal fallback for any workflow.
4 providers compared
← All Guides

People.ai MCP Setup Guide

The People.ai Model Context Protocol (MCP) server is the core data source for every workflow in this library. It provides AI agents with direct access to account activity, engagement data, opportunity status, and contact intelligence.

What is MCP? Model Context Protocol is an open standard that lets AI agents call external tools and data sources. People.ai's MCP server exposes sales intelligence as tools that agents can invoke during reasoning — no custom API integration code needed.
Prerequisites: An n8n instance (cloud or self-hosted v1.19.0+) and an active People.ai account with MCP API access enabled. For the official People.ai guide, see Connect n8n to People.ai.

What You Can Do

Available MCP Tools

The People.ai MCP server exposes these tools to connected agents:

Tool Description Used By
find_account Search for accounts by name or domain All workflows
get_account_status Account health, engagement score, risk signals Silence Monitor, Churn Risk
get_recent_account_activity Meetings, emails, calls in a time window Sales Digest, Channel Pulse
get_opportunity_status Deal stage, amount, close date, activity Forecast Coach, Deal Hygiene
get_recent_opportunity_activity Recent deal-level interactions and changes Opportunity Discovery, Win/Loss
get_engaged_people Contacts with recent engagement on an account Meeting Brief, Sponsor Tracker
get_scorecard Rep and team performance metrics Activity Gap, Forecast Coach
ask_sales_ai_about_account Natural language queries about any account (10-30s response) Executive Inbox, QBR Prep
ask_sales_ai_about_opportunity Natural language queries about any deal (10-30s response) Forecast Coach, Competitive Alert
top_records Top accounts/opps by activity, risk, or value Territory Heat Map
account_company_news Recent news about an account's company Meeting Brief, QBR Prep

1. Obtain MCP Credentials

  1. Contact your People.ai administrator or CSM to request MCP API access
  2. You'll receive two credentials:
    • Client ID — your organization's MCP client identifier (e.g., Yl1JnBI...)
    • Client Secret — authentication secret (e.g., 2rT0SWrgR...)
  3. Store these credentials securely — you'll need them for configuration
Important: MCP credentials are different from People.ai REST API credentials. Make sure you request MCP-specific access.

2. Configure in n8n

n8n v1.19.0+ has a built-in MCP Client tool. Here's the exact configuration:

  1. Create a new workflow or open an existing one
  2. Add an AI Agent node (Claude is recommended for complex sales analysis; OpenAI GPT-4 also works)
  3. In the AI Agent node, click Add Tool and select MCP Client
  4. Configure the MCP Client:
    Connection Name People.ai MCP Multi-Header
    Server URL https://mcp.people.ai/mcp
    Authentication Multiple Headers Auth
  5. Configure three authentication headers:
    Header Name Value
    Header 1 PAI-Client-Id [Your Client ID]
    Header 2 PAI-Client-Secret [Your Client Secret]
    Header 3 Content-Type application/json
  6. Under Allowed HTTP Request Domains, select All or add mcp.people.ai
  7. Click Save to create the credential
Header names are case-sensitive. Use exactly: PAI-Client-Id (not PAI-Client-ID or pai-client-id).
Tip: When importing library workflows (full.json), the MCP Client Tool node is already configured — just add your credentials.

3. Configure Your AI Agent

Add a system prompt to your AI Agent that instructs it how to use People.ai tools:

You are a sales intelligence assistant with access to People.ai CRM data.
When users ask about accounts, opportunities, or customer activity:
1) Use People.ai MCP tools to search and retrieve data
2) Analyze the information and provide strategic insights
3) Highlight risks, next steps, and key topics
4) Format responses clearly and actionably

4. Other Platforms

LangGraph (Python)

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
    "peopleai": {
        "url": "https://mcp.people.ai/mcp",
        "transport": "sse",
        "headers": {
            "PAI-Client-Id": os.environ["PEOPLEAI_CLIENT_ID"],
            "PAI-Client-Secret": os.environ["PEOPLEAI_CLIENT_SECRET"],
            "Content-Type": "application/json",
        }
    }
})
tools = await client.get_tools()
# Bind tools to your LLM: llm.bind_tools(tools)

Claude Agent SDK (Python)

pip install claude-agent-sdk anthropic

from claude_agent_sdk import Agent
import anthropic

agent = Agent(
    client=anthropic.Anthropic(),
    model="claude-sonnet-4-20250514",
    system="You are a sales intelligence assistant...",
    tools=[...],  # local tools
    mcp_servers=[{
        "name": "peopleai",
        "url": "https://mcp.people.ai/mcp",
        "headers": {
            "PAI-Client-Id": os.environ["PEOPLEAI_CLIENT_ID"],
            "PAI-Client-Secret": os.environ["PEOPLEAI_CLIENT_SECRET"],
            "Content-Type": "application/json",
        }
    }],
)

OpenAI Agents SDK (Python)

pip install openai-agents

from agents import Agent
from agents.mcp import MCPServerSse

peopleai_mcp = MCPServerSse(
    name="peopleai",
    url="https://mcp.people.ai/mcp",
    headers={
        "PAI-Client-Id": os.environ["PEOPLEAI_CLIENT_ID"],
        "PAI-Client-Secret": os.environ["PEOPLEAI_CLIENT_SECRET"],
        "Content-Type": "application/json",
    },
)

agent = Agent(
    name="Sales Intelligence",
    instructions="You are a sales intelligence assistant...",
    tools=[...],  # local tools
    mcp_servers=[peopleai_mcp],
)

Make / Power Automate / Zapier

MCP is not natively supported on Make, Power Automate, or Zapier. Options:
  1. n8n as middleware — n8n handles MCP, exposes results via webhook that Make/PA/Zapier can call
  2. MCP-to-REST bridge — Deploy a lightweight proxy that translates MCP tool calls to HTTP endpoints
  3. People.ai REST API — Use the Insights Export REST API for bulk data, combined with MCP for deep intelligence on specific items

5. Environment Variables

Set these for Python-based workflows (LangGraph, Claude Agent, OpenAI Agent):

export PEOPLEAI_MCP_URL="https://mcp.people.ai/mcp"
export PEOPLEAI_CLIENT_ID="your-client-id"
export PEOPLEAI_CLIENT_SECRET="your-client-secret"

# Also needed for the LLM:
export ANTHROPIC_API_KEY="sk-ant-..."   # for Claude Agent / LangGraph (recommended)
export OPENAI_API_KEY="sk-..."          # for OpenAI Agent

6. Test Your Connection

Try these example queries in n8n or your agent to verify the connection:

Check the execution log to verify: MCP tools appear in available tools, AI Agent calls them successfully, and data is returned.

7. Troubleshooting

Issue Cause Fix
Can't find MCP Client tool n8n version below 1.19.0 Update n8n to v1.19.0 or later
Connection failed / server not responding Wrong URL or network issue Verify URL is exactly https://mcp.people.ai/mcp (no trailing slash). Check firewall/proxy settings for self-hosted n8n.
Authentication failed Wrong credentials or header names Header names are case-sensitive: PAI-Client-Id, PAI-Client-Secret. Verify MCP-specific credentials (not REST API keys). Check for extra spaces.
AI Agent not using People.ai tools Prompt too vague or MCP tool not connected Be explicit in prompts: "Use the find_account tool to search for [company]." Verify MCP Client is connected to the AI Agent node.
Workflow times out AI-powered tools (ask_sales_ai_*) take 10-30s Increase workflow timeout. Use simpler tools like get_account_status for faster responses.
Tool returns empty data Account name mismatch or no activity Use exact account names from Salesforce; widen the lookback window

8. Combining MCP with REST API

For best results, use the People.ai Insights Export REST API for bulk data extraction and MCP tools for deep intelligence on specific items. Example pattern:

  1. REST API pulls all opportunities closing this quarter
  2. n8n logic calculates risk scores
  3. MCP tools analyze the top 10 high-risk opportunities
  4. n8n formats and sends the report

This hybrid approach combines the efficiency of bulk APIs with the intelligence of AI-powered analysis.

Security: Your People.ai data never leaves the secure People.ai environment — n8n workflows only send queries and receive specific responses. All communication uses HTTPS/TLS encryption. Store credentials using n8n's built-in credential system, never in workflow code. The integration respects your People.ai permissions. Rotate Client ID and Secret regularly.
Need help? For People.ai API issues, contact your CSM or email support@people.ai. For n8n-specific questions, consult the n8n Community Forum.
← All Guides

Slack Bot Setup Guide

Most workflows in this library deliver results via Slack. Follow these steps to create and configure a Slack bot with the right permissions.

1. Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New AppFrom scratch
  3. Name it (e.g., Automation Catalog Bot) and select your workspace
  4. Click Create App

2. Configure Bot Token Scopes

Navigate to OAuth & Permissions in the sidebar, scroll to Bot Token Scopes, and add:

Scope Purpose Required By
chat:write Send messages to channels and DMs All workflows
chat:write.customize Send messages with custom bot name/icon All workflows
channels:read List public channels Channel-targeted workflows
groups:read List private channels the bot is in Private channel delivery
im:write Open and send direct messages DM-based workflows (Sales Digest, Meeting Brief)
users:read Look up user IDs by name/email Subscriber-based workflows
users:read.email Look up users by email address Email-to-Slack user mapping
files:write Upload files and snippets Workflows with file attachments (QBR Prep)
reactions:write Add emoji reactions to messages Optional — status indicators

3. Install to Workspace

  1. Scroll up on the OAuth & Permissions page
  2. Click Install to Workspace
  3. Review the permissions and click Allow
  4. Copy the Bot User OAuth Token (starts with xoxb-)

4. Invite Bot to Channels

The bot can only post to channels it's been invited to:

5. Configure in Your Platform

n8n

  1. Go to Settings → Credentials → Add Credential
  2. Select Slack API
  3. Paste your xoxb- token in the Access Token field
  4. Click Save — the credential is now available to all Slack nodes

LangGraph / Claude Agent / OpenAI Agent (Python)

export SLACK_BOT_TOKEN="xoxb-your-token-here"

Make / Power Automate / Zapier

6. Bot Display Name & Icon

To customize how the bot appears in Slack:

  1. Go to your app at api.slack.com/apps
  2. Click Basic Information in the sidebar
  3. Scroll to Display Information
  4. Set the app name, description, icon, and background color
  5. Each workflow in this library uses a unique bot name (Aria, Watchdog, Prospector, etc.) via the chat:write.customize scope

7. Troubleshooting

Error Cause Fix
not_in_channel Bot hasn't been invited to the channel /invite @BotName in the channel
channel_not_found Wrong channel ID or channel is private Use channel ID (not name) — find it in channel details
missing_scope Required scope not added Add the scope, then reinstall the app to workspace
invalid_auth Token is wrong, expired, or revoked Reinstall app and copy the new token
ratelimited Too many API calls Add delays between messages; Slack allows ~1 msg/sec per channel
Security Tip: Never commit your xoxb- token to source control. Store it as an environment variable or in your platform's credential store. Rotate tokens immediately if exposed.
← All Guides

Microsoft Teams Setup Guide

Workflows in this library can deliver results to Microsoft Teams via two methods: Incoming Webhooks (quick setup, channel-only) or a Bot Framework bot (full-featured, supports DMs and adaptive cards).

Which method should I use?
Incoming Webhook — Best for channel alerts (Silence Monitor, Opportunity Discovery, Channel Pulse). 5-minute setup, no app registration.
Bot Framework — Best for DM-based workflows (Sales Digest, Meeting Brief) and rich adaptive cards. Requires Azure AD app registration.

Option A: Incoming Webhooks

Fastest way to post messages to a Teams channel. No Azure registration needed.

1. Create a Webhook in Teams

  1. Open the target Teams channel
  2. Click (more options) next to the channel name → Connectors (or Manage channel → Connectors)
  3. Search for Incoming Webhook and click Configure
  4. Name it (e.g., Automation Catalog) and optionally upload an icon
  5. Click Create
  6. Copy the Webhook URL — it looks like:
    https://outlook.office.com/webhook/...

2. Send Messages via Webhook

POST a JSON payload to the webhook URL. Teams supports two formats:

Simple Text (MessageCard)

POST {webhook_url}
Content-Type: application/json

{
  "@type": "MessageCard",
  "summary": "Silence Alert",
  "themeColor": "FF6B6B",
  "title": "🔴 SILENCE ALERT — 3 accounts need attention",
  "text": "**Globex Industries** — 18 days silent..."
}

Adaptive Card (richer formatting)

POST {webhook_url}
Content-Type: application/json

{
  "type": "message",
  "attachments": [{
    "contentType": "application/vnd.microsoft.card.adaptive",
    "content": {
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "type": "AdaptiveCard",
      "version": "1.4",
      "body": [
        { "type": "TextBlock", "text": "Sales Digest", "weight": "Bolder", "size": "Large" },
        { "type": "TextBlock", "text": "Your daily summary...", "wrap": true }
      ]
    }
  }]
}

3. Configure in Your Platform

n8n

  1. Add an HTTP Request node
  2. Method: POST
  3. URL: paste your webhook URL
  4. Body: JSON with MessageCard or Adaptive Card payload

Python (LangGraph / Claude Agent / OpenAI Agent)

import os, json
from urllib.request import Request, urlopen

webhook_url = os.environ["TEAMS_WEBHOOK_URL"]
payload = json.dumps({
    "@type": "MessageCard",
    "summary": "Alert",
    "title": "🔴 Silence Alert",
    "text": message_content,
}).encode()

req = Request(webhook_url, data=payload,
              headers={"Content-Type": "application/json"})
urlopen(req)

Make / Power Automate / Zapier

Option B: Bot Framework (Azure AD)

Full-featured bot with DM support, adaptive cards, and proactive messaging. Required for workflows that deliver personalized content to individual users.

1. Register an Azure AD App

  1. Go to Azure Portal → App Registrations
  2. Click New registration
  3. Name: Automation Catalog Bot
  4. Supported account types: Single tenant (your org only)
  5. Click Register
  6. Note the Application (client) ID and Directory (tenant) ID
  7. Go to Certificates & secrets → New client secret — copy the secret value

2. API Permissions

In your app registration, go to API permissions → Add a permission → Microsoft Graph:

Permission Type Purpose
ChatMessage.Send Application Send messages to chats and channels
Chat.Create Application Create 1:1 chats for DM delivery
Chat.ReadWrite.All Application Read/write to chats (proactive messaging)
User.Read.All Application Look up users by email for DM targeting
ChannelMessage.Send Application Post to specific team channels
Team.ReadBasic.All Application List teams and channels

Click Grant admin consent after adding permissions (requires admin role).

3. Create a Bot Channel Registration

  1. In Azure Portal, search for Azure Bot and click Create
  2. Link it to the app registration you created in Step 1
  3. Under Channels, enable Microsoft Teams
  4. Under Configuration, set the messaging endpoint if using a custom bot service

4. Install Bot in Teams

  1. Go to Teams Developer Portal
  2. Create a new app or import the bot
  3. Under App features → Bot, link your Azure Bot registration
  4. Publish to your org or sideload for testing
  5. Users can then find and chat with the bot, or add it to channels

5. Configure in Your Platform

n8n

  1. Add a Microsoft Teams node
  2. Create a credential with your Client ID, Client Secret, and Tenant ID
  3. Select action: Send Message to channel or chat

Python (LangGraph / Claude Agent / OpenAI Agent)

export TEAMS_TENANT_ID="your-tenant-id"
export TEAMS_CLIENT_ID="your-client-id"
export TEAMS_CLIENT_SECRET="your-client-secret"

# Python example — send via Graph API
import msal, requests

app = msal.ConfidentialClientApplication(
    os.environ["TEAMS_CLIENT_ID"],
    authority=f"https://login.microsoftonline.com/{os.environ['TEAMS_TENANT_ID']}",
    client_credential=os.environ["TEAMS_CLIENT_SECRET"],
)
token = app.acquire_token_for_client(
    scopes=["https://graph.microsoft.com/.default"]
)

requests.post(
    f"https://graph.microsoft.com/v1.0/teams/{team_id}/channels/{channel_id}/messages",
    headers={"Authorization": f"Bearer {token['access_token']}"},
    json={"body": {"content": message_content}},
)

Power Automate (native)

6. Troubleshooting

Error Cause Fix
403 Forbidden Missing admin consent on Graph permissions Azure Portal → API permissions → Grant admin consent
404 Not Found Wrong team/channel ID or bot not installed Verify IDs via Graph Explorer; ensure bot is added to the team
InvalidAuthenticationToken Expired or malformed token Re-acquire token via MSAL; check client secret expiry
Webhook returns 400 Malformed JSON payload Validate against Adaptive Cards Designer
Messages not appearing Webhook URL expired or connector removed Recreate the Incoming Webhook connector in the channel
Throttled (429) Rate limit exceeded Graph API allows ~30 msgs/sec per app; add retry with backoff
Security Tip: Store your Client Secret in a vault (Azure Key Vault, env var, or platform credential store). Client secrets expire — set a calendar reminder to rotate before expiry. Never embed secrets in workflow JSON files.
Power Automate Users: You likely don't need any of the above! Power Automate's native Teams connector handles authentication automatically. Just use the "Post message in a chat or channel" action and sign in with your Microsoft account.
← All Guides

Google Chat Setup Guide

Workflows can deliver results to Google Chat via Incoming Webhooks (quick, space-only) or a Google Chat App (DM support, cards, slash commands).

Which method should I use?
Webhook — Best for channel/space alerts (Silence Monitor, Opportunity Discovery). 2-minute setup.
Chat App — Best for DM workflows (Sales Digest, Meeting Brief) and interactive cards. Requires Google Cloud project.

Option A: Incoming Webhooks

1. Create a Webhook in Google Chat

  1. Open the Google Chat space you want to post to
  2. Click the space name at the top → Apps & integrations
  3. Click + Add webhooks
  4. Name it (e.g., Automation Catalog) and optionally set an avatar URL
  5. Click Save
  6. Copy the Webhook URL — it looks like:
    https://chat.googleapis.com/v1/spaces/.../messages?key=...&token=...

2. Send Messages via Webhook

Simple Text

POST {webhook_url}
Content-Type: application/json

{
  "text": "🔴 *SILENCE ALERT* — 3 accounts need attention\n\n*Globex Industries* — 18 days silent..."
}

Card Message (richer formatting)

POST {webhook_url}
Content-Type: application/json

{
  "cardsV2": [{
    "cardId": "silence-alert",
    "card": {
      "header": {
        "title": "Silence Alert",
        "subtitle": "3 accounts need attention",
        "imageUrl": "https://example.com/icon.png"
      },
      "sections": [{
        "header": "🔴 Critical",
        "widgets": [{
          "decoratedText": {
            "topLabel": "Globex Industries — $340,000",
            "text": "18 days silent (normally 3-day cadence)"
          }
        }]
      }]
    }
  }]
}

3. Platform Configuration

n8n

  1. Add an HTTP Request node
  2. Method: POST, URL: your webhook URL
  3. Body: JSON with text or cardsV2 payload

Python (LangGraph / Claude Agent / OpenAI Agent)

import os, json
from urllib.request import Request, urlopen

webhook_url = os.environ["GOOGLE_CHAT_WEBHOOK_URL"]
payload = json.dumps({"text": message_content}).encode()

req = Request(webhook_url, data=payload,
              headers={"Content-Type": "application/json"})
urlopen(req)

Make / Power Automate / Zapier

Option B: Google Chat App

Full-featured app with DM support, interactive cards, and slash commands. Required for personalized delivery to individual users.

1. Create a Google Cloud Project

  1. Go to Google Cloud Console → Create Project
  2. Name it (e.g., automation-catalog-bot)
  3. Enable the Google Chat API: search in APIs & Services → Library

2. Configure the Chat App

  1. Go to Google Chat API → Configuration
  2. Set the App name and Avatar URL
  3. Under Functionality, enable:
    • Receive 1:1 messages
    • Join spaces and group conversations
  4. Under Connection settings, choose App URL (for webhook-driven) or Cloud Pub/Sub
  5. Set Visibility to your organization

3. Service Account for Proactive Messaging

To send DMs without user interaction (proactive messaging), you need a service account:

  1. Go to IAM & Admin → Service Accounts → Create
  2. Name it chat-bot-sender
  3. Create a JSON key and download it
  4. Enable domain-wide delegation in Google Workspace Admin if needed

4. API Scopes

Scope Purpose
https://www.googleapis.com/auth/chat.bot Send and manage messages as the Chat app
https://www.googleapis.com/auth/chat.spaces List and manage spaces the app belongs to
https://www.googleapis.com/auth/chat.messages.create Create messages in spaces and DMs
https://www.googleapis.com/auth/chat.memberships Look up space members for DM targeting

5. Sending DMs via Chat API

from google.oauth2 import service_account
from googleapiclient.discovery import build

creds = service_account.Credentials.from_service_account_file(
    os.environ["GOOGLE_CHAT_SA_KEY"],
    scopes=["https://www.googleapis.com/auth/chat.bot"],
)
chat = build("chat", "v1", credentials=creds)

# Create or find DM space with user
dm = chat.spaces().setup(body={
    "space": {"spaceType": "DIRECT_MESSAGE"},
    "memberships": [{"member": {"name": f"users/{user_email}", "type": "HUMAN"}}],
}).execute()

# Send message
chat.spaces().messages().create(
    parent=dm["name"],
    body={"text": digest_content},
).execute()

6. Troubleshooting

Error Cause Fix
403 PERMISSION_DENIED Chat API not enabled or missing scopes Enable Chat API; verify service account scopes
404 NOT_FOUND Space doesn't exist or app not added Add the Chat app to the space first
FAILED_PRECONDITION App can't DM users who haven't interacted with it User must message the app first, or use spaces().setup() with domain-wide delegation
Webhook returns 400 Invalid JSON or card schema Validate with Card Builder
Rate limited Exceeding Chat API quotas Default: 60 msgs/min per space; add batching with delays
Security Tip: Store the service account JSON key securely — never commit it to source control. Use environment variables or a secret manager. Rotate keys periodically via Google Cloud Console.
← All Guides

Email Delivery Setup Guide

Email is the universal fallback — every workflow can deliver via SMTP. This guide covers Gmail, Outlook/M365, SendGrid, and generic SMTP.

When to use email delivery: When recipients don't share a common messaging platform, for formal reports (QBR Prep, Forecast Coach), as a fallback alongside Slack/Teams, or for stakeholders outside your organization.

Option A: Gmail / Google Workspace

1. Create an App Password

Google blocks "less secure app" logins. Use an App Password instead:

  1. Go to myaccount.google.com/security
  2. Ensure 2-Step Verification is enabled
  3. Go to App Passwords
  4. Select app: Mail, device: Other (name it Automation Catalog)
  5. Click Generate — copy the 16-character password

SMTP Settings

Host smtp.gmail.com
Port 587 (STARTTLS) or 465 (SSL)
Username Your full Gmail address
Password The 16-character App Password (not your Google password)
Daily limit 500 emails (personal) / 2,000 (Workspace)

Alternative: Gmail API (OAuth)

For Google Workspace orgs, the Gmail API with a service account avoids App Passwords:

  1. Enable the Gmail API in Google Cloud Console
  2. Create a service account with domain-wide delegation
  3. Grant the https://www.googleapis.com/auth/gmail.send scope
  4. Use the service account to send on behalf of users

Option B: Outlook / Microsoft 365

1. SMTP Settings

Host smtp.office365.com
Port 587 (STARTTLS)
Username Your full email address
Password Account password (or App Password if MFA enabled)
Auth SMTP AUTH must be enabled per-mailbox by M365 admin

2. Enable SMTP AUTH (Admin)

M365 disables SMTP AUTH by default. An admin must enable it:

  1. Go to Microsoft 365 Admin Center → Users → Active Users
  2. Select the sending account → Mail → Manage email apps
  3. Check Authenticated SMTP and save

Alternative: Microsoft Graph API

For production use, the Graph API with app-only auth is more reliable:

POST https://graph.microsoft.com/v1.0/users/{sender}/sendMail
Authorization: Bearer {token}

{
  "message": {
    "subject": "Weekly Forecast Coaching",
    "body": { "contentType": "HTML", "content": "<h1>Report...</h1>" },
    "toRecipients": [{ "emailAddress": { "address": "leader@company.com" } }]
  }
}

Requires the Mail.Send application permission with admin consent.

Option C: SendGrid (Transactional Email)

Best for production — high deliverability, no per-user mailbox needed, generous free tier (100 emails/day).

1. Get an API Key

  1. Sign up at sendgrid.com
  2. Verify a Sender Identity (single sender or domain authentication)
  3. Go to Settings → API Keys → Create API Key
  4. Grant Mail Send permission
  5. Copy the key (starts with SG.)

SMTP Settings

Host smtp.sendgrid.net
Port 587 (STARTTLS) or 465 (SSL)
Username apikey (literally the word "apikey")
Password Your SendGrid API key

Or use the SendGrid API directly

POST https://api.sendgrid.com/v3/mail/send
Authorization: Bearer SG.your-api-key
Content-Type: application/json

{
  "personalizations": [{"to": [{"email": "leader@company.com"}]}],
  "from": {"email": "automation@company.com", "name": "Automation Catalog"},
  "subject": "Weekly Forecast Coaching",
  "content": [{"type": "text/html", "value": "<h1>Report</h1>"}]
}

Platform Configuration

n8n

  1. Go to Settings → Credentials → Add Credential
  2. Select SMTP (or SendGrid / Gmail for those providers)
  3. Enter host, port, username, password from above
  4. Use the Send Email node in your workflow

Python (LangGraph / Claude Agent / OpenAI Agent)

export SMTP_HOST="smtp.gmail.com"      # or smtp.office365.com, smtp.sendgrid.net
export SMTP_PORT="587"
export SMTP_USER="you@company.com"      # or "apikey" for SendGrid
export SMTP_PASS="your-app-password"    # or API key for SendGrid

# Python example
import os, smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

msg = MIMEMultipart("alternative")
msg["Subject"] = "Weekly Forecast Coaching"
msg["From"] = os.environ["SMTP_USER"]
msg["To"] = "leader@company.com"
msg.attach(MIMEText(plain_text, "plain"))
msg.attach(MIMEText(html_content, "html"))

with smtplib.SMTP(os.environ["SMTP_HOST"], int(os.environ["SMTP_PORT"])) as s:
    s.starttls()
    s.login(os.environ["SMTP_USER"], os.environ["SMTP_PASS"])
    s.send_message(msg)

Make / Power Automate / Zapier

Provider Comparison

Provider Free Tier Best For Setup
Gmail 500/day Prototyping, small teams 5 min
Outlook / M365 10,000/day Microsoft shops 10 min (+ admin)
SendGrid 100/day Production, high deliverability 15 min
Amazon SES 62,000/mo (from EC2) AWS-native orgs, volume 30 min

Troubleshooting

Error Cause Fix
535 Authentication failed Wrong password or App Password needed Use App Password (Gmail) or enable SMTP AUTH (M365)
Connection refused (port 25) ISP or cloud provider blocks port 25 Use port 587 (STARTTLS) or 465 (SSL) instead
Emails going to spam Missing SPF/DKIM/DMARC records Set up domain authentication with your email provider
Daily sending limit reached Exceeded provider quota Upgrade plan or switch to SendGrid/SES for volume
HTML not rendering Sent as plain text instead of HTML Set content type to text/html or use multipart/alternative
Security Tip: Never use your primary account password for SMTP. Always use App Passwords, API keys, or OAuth tokens. Store credentials in environment variables or your platform's secret store.