AI Agent Examples

Each example demonstrates one safe Mailrith workflow, lists its required permissions, and keeps reads, retries, writes, and stored data bounded.

5 min read

Example Workflows

The repository includes three small examples built on the official SDK and CLI contract. Each example has one task, lists its Work Profile, limits pagination, carries request IDs, and uses a task-specific credential.

  • Reporting agent: bounded capability, Subscriber, Broadcast, and progress reads.
  • Subscriber-sync agent: idempotent upserts with stable source keys and no bulk status changes.
  • Broadcasts agent: creates and reads a draft, runs preflight, and can send once with a stable idempotency key when the requested task includes delivery.

Run An Example Safely

  1. Use a dedicated test workspace and a dedicated OAuth connection or task-specific key.
  2. Read the example's required permissions and remove any permission the test does not need.
  3. Set secrets in the environment. Do not edit secrets into the example source or configuration.
  4. Run capability discovery before the example's first operation.
  5. Keep the default page and polling limits during the first run.
  6. For examples that change workspace data, read the saved resource or progress endpoint to confirm the result. Delete test resources when the run is complete.
Example Directory
examples/agents/reporting
examples/agents/subscriber-sync
examples/agents/broadcasts

Need Help Shipping an Integration?

Reach the Mailrith team if you need help planning a sync, validating a webhook flow, or troubleshooting a request.

Contact Mailrith

On this page

Jump to the section you need.