Elaris Docs / n8n Gmail Automation

n8n Gmail Automation

Laravel owns Google OAuth, token refresh, Gmail reads, and Gmail sends. n8n receives only safe email event payloads and should never receive Google access tokens or refresh tokens.

Event flow

  1. Gmail inbox sync detects a new email.
  2. Elaris saves the email log.
  3. Elaris sends a POST request to the configured n8n webhook URL.
  4. n8n processes the event.
  5. n8n calls back to Elaris when a reply or lead should be created.

Example n8n payload

{
  "email_log_id": 123,
  "from": "customer@example.com",
  "subject": "Need a quote",
  "snippet": "Can you call me today?",
  "received_at": "2026-06-01T12:00:00Z"
}

Rules

  • Keep the n8n webhook URL private.
  • Use a shared callback token for replies or lead creation.
  • Make callbacks idempotent so retries do not create duplicates.
  • Do not expose Google tokens to n8n.