Skip to main content
Use gmail in twins and put this configuration under seed_config.gmail. Gmail mailbox with labels, messages, threads, and drafts.

Example seed

This is the complete Scenario request body for creating a Scenario. You can also import it with arga test-runner scenarios import --file scenario.json.

Parameters

Top-level fields: seed_config.gmail

Messages: gmail.messages[]

Behavior:
  • Messages without dates are distributed oldest-first within the preceding 30 days relative to base_time, or the seeding time when base_time is omitted.
  • Imported MIME Date headers are preserved. A missing header is filled from the explicit or generated date.
  • Ordinary messages default to INBOX; send: true messages default to SENT. Add UNREAD explicitly when needed.
  • Name-based labels normally include the default location label. SENT, DRAFT, TRASH, or SPAM suppress that addition. An explicit empty label list seeds no labels.
  • Thread aliases are resolved as messages are created. Linked drafts should follow the messages they reference.

Drafts: gmail.drafts[]

Drafts accept the same composition fields as messages: subject, body / body_text / text, from / from_email / sender, to, cc, bcc, reply_to / replyTo, date, thread_id / threadId, message_id / messageId, in_reply_to / inReplyTo, references, attachments, and raw. Draft defaults differ: subject defaults to Draft, and sender and recipient default to the owner. Drafts do not apply send, labels, or labelIds. Drafts without a date do not receive the message list’s automatic date distribution.

Attachments: messages[].attachments[] or drafts[].attachments[]

For HTML email, supply raw MIME with the desired HTML body.

Profile: gmail.profile

Test credentials: gmail.tokens[]

The seeder also installs its owner credential automatically.

Browser accounts: gmail.browser_accounts.<email>

Map keys must be trimmed, lowercase email addresses. Unknown account fields are rejected.

Browser connections: gmail.browser_connections.<service>

Writing assistant: gmail.gemini

Each gemini.responses[] entry accepts:

Snapshot restore

You can alternatively supply the complete exported object containing runtime_snapshot and mailboxes. Reuse the export intact.

API coverage and limitations

Twin name: gmail CLI quickstart: Use the Google Workspace CLI with Arga twins Supports
  • Gmail API workflows for inboxes, threads, messages, drafts, labels, attachments, search, send behavior, and watch events.
  • Authorization-code OAuth, S256 PKCE, offline refresh, and signed OIDC ID tokens. See Google OAuth and OIDC setup for callback registration and token verification.
  • Seeded mailbox state, deterministic message/thread IDs, and resettable state for repeatable email-agent tests.
  • File attachment metadata and download flows for agents that inspect or transform message attachments.
Known limitations
  • Mailboxes start empty unless seeded or populated by the app under test.
  • Delivery, spam classification, and provider reputation behavior are deterministic approximations rather than live Gmail infrastructure.
  • The twin focuses on Gmail API-compatible agent workflows; broad Google Workspace admin behavior is outside the primary fidelity target.
MCP tools: get_twin_catalog, provision_twins, start_url_validation, get_validation_results. See Scenario seeding for saving, provisioning, and resetting fixtures.