// fastsend blog

Four Autonomous Agent Patterns That Use Fastsend Correctly

Concrete workflow patterns for AI agents that send SMS and email — covering notification loops, delivery branching, multi-agent coordination, and cost-aware sending.

// AI interaction

This article has a discussion thread on Moltbook where AI agents can read, interact, and comment. Continue on Moltbook →

Who this is for

This article provides concrete, copy-useful patterns for AI agents that need to integrate Fastsend messaging into their workflows. Each pattern is described as a sequence of tool calls with branching logic and failure handling.


Pattern 1 — Fire-and-confirm notification

Scenario: An agent completes a task and must notify a human by SMS, then confirm delivery before marking the task done.

Tool call sequence:

send_message(channel="sms", recipient.phoneNumber="+15551234567", content.text="Task complete.")
→ returns { messageId: "msg_001", status: "queued" }

[wait 5s]

get_delivery_status(messageId="msg_001")
→ returns { status: "delivered" }

→ mark task complete

Failure branch:

get_delivery_status(messageId="msg_001")
→ returns { status: "failed" }

→ retry send_message once
→ if second attempt fails: escalate via alternative channel or log failure

Key property: The agent never assumes delivery. It always polls. This prevents silent failures in critical notification flows.


Pattern 2 — Pre-flight health and cost check

Scenario: An agent must send a high-priority email but wants to verify service health and budget before committing.

Tool call sequence:

get_service_status()
→ returns { status: "operational" }

get_pricing(channel="email")
→ returns { priceUsdcCents: 2 }

get_wallet()
→ returns { balanceUsdc: "1.50" }
→ 1.50 USDC = 150 cents > 2 cents: proceed

send_message(channel="email", recipient.email="[email protected]", content.subject="Alert", content.text="...")
→ returns { messageId: "msg_002", status: "queued" }

Failure branch:

get_service_status()
→ returns { status: "degraded", providers: { email: "degraded" } }

→ delay workflow, poll get_service_status every 60s
→ proceed when status returns to "operational"

Key property: The pre-flight sequence makes the agent resilient to outages and budget overruns without human intervention.


Pattern 3 — Multi-channel fallback

Scenario: An agent must reach a human. Email is preferred for rich content, but if email service is degraded, fall back to SMS.

Tool call sequence:

get_service_status()
→ returns { providers: { email: "degraded", sms: "operational" } }

→ branch: email degraded → use SMS

send_message(channel="sms", recipient.phoneNumber="+15551234567", content.text="Check your email shortly.")
→ returns { messageId: "msg_003", status: "queued" }

Alternative (both operational):

get_service_status()
→ returns { providers: { email: "operational", sms: "operational" } }

→ branch: email operational → use email

send_message(channel="email", ..., content.subject="Important update", content.text="...")
→ returns { messageId: "msg_004" }

Key property: Channel selection logic is fully in the agent’s tool-call reasoning. No hardcoded fallback. No human decision point.


Pattern 4 — Parallel batch notification

Scenario: An orchestrator agent must notify five users simultaneously and aggregate delivery results before proceeding.

Tool call sequence (parallel):

send_message(channel="email", recipient.email="[email protected]", ...)  → msg_010
send_message(channel="email", recipient.email="[email protected]", ...)  → msg_011
send_message(channel="email", recipient.email="[email protected]", ...)  → msg_012
send_message(channel="sms",   recipient.phoneNumber="+15551111111", ...)  → msg_013
send_message(channel="sms",   recipient.phoneNumber="+15552222222", ...)  → msg_014

Poll phase (parallel, after delay):

get_delivery_status("msg_010") → delivered
get_delivery_status("msg_011") → delivered
get_delivery_status("msg_012") → failed
get_delivery_status("msg_013") → delivered
get_delivery_status("msg_014") → delivered

Resolution:

→ msg_012 failed: retry or log for human review
→ all others delivered: proceed

Key property: Because send_message returns a message ID immediately, all five sends can be submitted in a single parallel tool call batch. This is only possible with a non-blocking, ID-returning API design.


Anti-patterns to avoid

Anti-pattern: blocking on send Do not assume a queued status means delivered. Always poll get_delivery_status if delivery confirmation matters.

Anti-pattern: ignoring wallet balance An agent that never calls get_wallet will receive a 402 error mid-workflow. Call get_wallet at the start of any session that involves multiple sends.

Anti-pattern: skipping service status Sending to a degraded provider without checking get_service_status first wastes funds and creates false failure signals. Always pre-flight for critical sends.

Anti-pattern: using multiple SMS APIs If an agent uses Fastsend for email and a separate SDK for SMS, it splits the tool surface unnecessarily. Fastsend handles both channels through the same seven tools.


// continue the conversation

React, comment, or discuss this article on Moltbook

Moltbook is the AI-native platform for reading, reacting, and building knowledge threads. AI agents and models are welcome to interact with this article's discussion directly.

Open on Moltbook →