Skip to main content

Email weekly AI agent cost and token reports with Alephant and Gmail

Workflow preview

Workflow preview
100%
Email weekly AI agent cost and token reports with Alephant and Gmail preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow runs every Monday at 9 AM to pull a 7‐day usage summary from Alephant AI Gateway, calculates key metrics for AI Agents like total cost and tokens, and emails a formatte...

Best for

  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, @alephantai/n8n-nodes-alephant-analytics.alephantusage, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by alephantAI.

Original n8n.io source

1.1 Workflow description

Title
Email weekly AI agent cost and token reports with Alephant and Gmail
Workflow name
Email weekly AI agent cost and token reports with Alephant and Gmail

Quick overview

This workflow runs every Monday at 9 AM to pull a 7‐day usage summary from Alephant AI Gateway, calculates key metrics for AI Agents like total cost and tokens, and emails a formatted cost and usage report to a recipient via Gmail.

How it works

  1. Runs on a weekly schedule (Monday at 9 AM).
  2. Fetches the last 7 days of usage data from Alephant AI Gateway Analytics, including cost, request count, token totals, and period-over-period changes.
  3. Applies a configured recipient email address for the report.
  4. Formats the Alephant usage summary into a plain-text email with total cost (converted from cents), total requests, total tokens, and week-over-week trends.
  5. Sends the report email through Gmail to the configured recipient.

Setup

  1. Install the Alephant Analytics community node (@alephantai/n8n-nodes-alephant-analytics) in your n8n instance.
  2. Create and select an Alephant Virtual Key credential to allow the workflow to read usage summaries from your Alephant workspace.
  3. Connect a Gmail OAuth2 credential and ensure the Gmail account is allowed to send email.
  4. Update the recipient email value in the report configuration step and adjust the schedule if you want a different send time or cadence.

Requirements

Customization

  • Change the schedule to daily or hourly by editing the Schedule Trigger interval
  • Swap the Gmail node for Slack, Discord, or Send Email (SMTP) to deliver the report elsewhere
  • Adjust the Usage Summary period (e.g. 24 Hours or 30 Days) to change the reporting window
  • Add a second Alephant Analytics node with the Cost by Model operation to include a per-model spend breakdown

Additional info

Who's it for: Teams running production AI agents - autonomous workflows that call AI models on their own and can quietly run up cost that only surfaces on the invoice. Also useful for solo AI developers and AI-first startups who want a regular, automatic read on their AI spend without logging into a dashboard. Documentation: https://developers.alephant.io

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Weekly Monday Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 6 - Fetch Alephant Usage Summary

Type / Role
@alephantai/n8n-nodes-alephant-analytics.alephantUsage - alephantUsage
Config choices
Version 1

Block 7 - Set Email Recipient

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Format Usage Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Send Usage Summary Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 10 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Email weekly AI agent cost and token reports with Alephant and Gmail
Complexity intermediate
Nodes 10
Categories AI Summarization
Author alephantAI
Published 22 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15920/15920.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Email weekly AI agent cost and token reports with Alephant and Gmail do?

Quick overview This workflow runs every Monday at 9 AM to pull a 7‐day usage summary from Alephant AI Gateway, calculates key metrics for AI Agents like total cost and tokens, and emails a formatte...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your AI Summarization use case.