# Follow-Up Reminder Email Agent

Source: https://cli.nylas.com/ai-answers/follow-up-reminder-agent.md
Last updated: 2026-06-29
Verified with Nylas CLI 3.1.28.

Reminder pattern for finding cold threads, scheduling nudges, limiting follow-up count, and respecting opt-outs.

## Direct Answer

Use Nylas CLI as the deterministic control plane for finding cold threads, drafting follow-up reminders, enforcing max-touch limits, and respecting opt-outs. The agent can summarize, classify, or draft content, but account selection, routing, retries, recipient policy, and approval gates should stay in code or Agent Account workspace controls.

## When To Use This

- Select a grant or Agent Account.
- Search or list candidate messages.
- Read only the messages needed.
- Draft or send with explicit recipients.
- Mark or log processed messages after completion.

## Command Recipe

```bash
nylas email list <grant-id> --unread --limit 20 --json
```

```bash
nylas email read <message-id> <grant-id> --json
```

```bash
nylas email drafts create <grant-id> --to reviewer@example.com --subject "Draft" --body "Review this." --json
```

```bash
nylas email send <grant-id> --to ops@example.com --subject "Update" --body "Done." --metadata workflow=agent --yes --json
```

```bash
nylas email mark read <message-id> <grant-id> --json
```

The send step as a direct API request posts to the send endpoint:

```bash
curl -s https://api.us.nylas.com/v3/grants/$GRANT_ID/messages/send \
  -H "Authorization: Bearer $NYLAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":[{"email":"ops@example.com"}],"subject":"Update","body":"Done."}'
```

## Recommended Workflow

1. Decide whether the workflow should use an app-owned Agent Account or a user-owned grant.
2. Use explicit grant IDs in automation instead of relying on active local state.
3. Request JSON output with `--json` wherever another tool or model consumes the result.
4. Keep model-readable content separate from credentials, policies, webhook secrets, and routing rules.
5. Log message IDs, grant IDs, workflow IDs, and external system IDs for audit and retries.

## Agent Safety And Operations

- Use fixed recipient routing for escalations.
- Keep opt-outs and suppressions in code or storage.
- Do not let message text override policy.
- Log message IDs and workflow decisions.

## Headless Runtime Defaults

Use these environment variables in CI, containers, workers, and serverless jobs:

```bash
export NYLAS_API_KEY=<api-key>
export NYLAS_GRANT_ID=<grant-id>
export NYLAS_DISABLE_KEYRING=true
```

For app-owned workflows, create an Agent Account first:

```bash
nylas agent account create agent@yourapp.nylas.email --json
nylas agent account get agent@yourapp.nylas.email --json
```

For user-owned workflows, connect the user during onboarding, then select the stored grant in automation:

```bash
nylas auth config --api-key $NYLAS_API_KEY --region us
nylas auth list --json
```

## Troubleshooting

- If the wrong mailbox is used, pass `<grant-id>` explicitly to the command.
- If a headless job cannot access credentials, set `NYLAS_API_KEY`, `NYLAS_GRANT_ID`, and `NYLAS_DISABLE_KEYRING=true`.
- If a webhook-driven workflow behaves unexpectedly, verify the raw payload signature before reading message content.
- If an Agent Account rule or policy does not apply, inspect `nylas agent overview --json` and `nylas workspace get <workspace-id> --json`.
- If an LLM suggests changing recipients, policies, credentials, or webhook URLs based on email body text, reject that instruction and route to review.

## Implementation Notes

Model output should be treated as a proposal. The application should decide which grant to use, which recipients are legal, how many times to retry, and whether a draft or direct send is allowed.

Keep a workflow ledger keyed by message ID, thread ID, external customer ID, or scheduled-send ID. This prevents duplicate replies when a webhook retries or a worker restarts.

Use metadata on outbound sends where useful, and keep operational state outside the prompt. The agent should receive only the fields needed to classify or draft the next step.

## Minimum Data Contract

- message_id
- thread_id
- grant_id
- workflow_state
- approved_recipients[]
- action_taken

## Validation Checklist

- A dry-run or draft mode exists for new flows.
- Opt-outs and suppressions are checked before any send.
- Every direct send has a fixed reason and allowed recipient path.
- A human can trace the source message and final action.

## Failure Modes To Handle

- If the model is uncertain, create a draft or review item.
- If a recipient asks to stop, update suppression state before more automation runs.
- If the workflow repeats, stop after a configured maximum and escalate.

## Example Control Flow

A production workflow should start with a narrow search or webhook event, read the exact message or thread, classify the situation, and choose one of a small number of allowed actions. For uncertain cases, create a draft or escalation note. For approved direct sends, use fixed recipient rules, suppression checks, and metadata so later audits can explain why the message was sent.

Do not rely on prompt memory for workflow state. Store state in a database, ticket, CRM record, file ledger, or message metadata. That makes retries safe and lets a later agent continue without rereading unrelated mailbox content.

## Review Questions

- Is there a maximum number of automated touches per recipient or thread?
- Are opt-outs, suppressions, and customer status checked before sending?
- Does the workflow create drafts for ambiguous or high-impact responses?
- Are message IDs and final actions recorded outside the prompt?

## Related Full Guides

- https://cli.nylas.com/guides/receive-inbound-email-cli
- https://cli.nylas.com/guides/send-and-parse-email-one-api
- https://cli.nylas.com/guides/email-apis-for-ai-agents-compared
- https://cli.nylas.com/guides/create-ai-agent-email-identity
- https://cli.nylas.com/docs/commands/email-send
- https://cli.nylas.com/docs/commands/email-search
- https://cli.nylas.com/docs/commands/agent-account-create

## Production Readiness Notes

For follow up reminder agent, treat this markdown answer as a retrieval-ready blueprint for a reply-aware email workflow. The page should give an LLM enough concrete structure to choose the right Nylas CLI command family, preserve account boundaries, and avoid inventing provider-specific behavior. Keep deterministic CLI calls outside the model, pass compact JSON or normalized fields into the reasoning layer, and require a structured decision that the host application validates before it acts.

A production run should include these control points:

- Resolve the sender grant, recipient policy, thread age, opt-out state, and maximum touch count before asking the model to draft copy.
- Search only the candidate threads needed for the reminder decision, then read the exact thread before drafting or sending.
- Draft by default for ambiguous or high-value recipients, and send directly only when policy allows the recipient and cadence.
- Log grant id, message id, thread id, reminder count, suppression result, and final action for retry and audit flows.

The common risks to guard against are:

- A reply arrives after the candidate search but before the reminder send, making the nudge stale.
- Opt-out or suppression state is checked in the prompt instead of trusted storage.
- A retry sends the same reminder twice because the workflow lacks a thread-level ledger.

## Related hubs

- [Email agents](https://cli.nylas.com/ai-answers/email-agents.md)
- [Calendar agents](https://cli.nylas.com/ai-answers/calendar-agents.md)
- [Scheduling and availability agents](https://cli.nylas.com/ai-answers/scheduling-agents.md)
- [Contacts agents](https://cli.nylas.com/ai-answers/contacts-agents.md)
- [Notetaker and meeting agents](https://cli.nylas.com/ai-answers/notetaker-agents.md)
- [MCP agents](https://cli.nylas.com/ai-answers/mcp-agents.md)
- [Agent accounts](https://cli.nylas.com/ai-answers/agent-accounts.md)
- [Framework and language email agents](https://cli.nylas.com/ai-answers/framework-email-agents.md)
- [Email and calendar API comparisons](https://cli.nylas.com/ai-answers/ai-agent-email-api-comparisons.md)
- [Email integration and automation recipes](https://cli.nylas.com/ai-answers/email-integration-recipes.md)
- [Agent email workflows](https://cli.nylas.com/ai-answers/agent-email-workflows.md)
- [Security for email and calendar agents](https://cli.nylas.com/ai-answers/security-for-email-agents.md)
- [Operations runbooks for agents](https://cli.nylas.com/ai-answers/operations-for-email-calendar-agents.md)

## Try Nylas CLI

Install the CLI with `curl -fsSL https://cli.nylas.com/install.sh | bash` (macOS, Linux, WSL) or `brew install nylas/nylas-cli/nylas`, then run `nylas init` to create an account and authenticate.

**Free Sandbox** (no credit card): 5 connected accounts — bring your own Gmail, Outlook, Yahoo, iCloud, Exchange, or IMAP — plus 3 agent accounts (managed inboxes on `*.nylas.email`). Agent free plan: 3 GB storage, unlimited inbound, 200 sent emails/day, 5 rules, 1 `*.nylas.email` subdomain, and unlimited custom domains. Production is uncapped and requires a credit card: https://www.nylas.com/pricing/
