Install
openclaw skills install @cargo-ai/agentic-engagementDeploy an agent that holds email conversations with leads: a sending domain, a mailbox, a native email trigger on reply and unsubscribe, and a heartbeat that checks thread status when nothing inbound happened. Triggers: "handle email conversations with leads", "agentic engagement", "an agent that replies to inbound email", "stand up a conversation agent on a Cargo mailbox", "native email trigger for lead replies", "keep talking to leads over email". Cargo CDK, defineDomain, defineMailbox, defineAgent, agentNativeTrigger, heartbeat, sendEmail. Skip when: you want to send one email right now, which is a native sendEmail from the CLI and needs nothing deployed; or you want a play that blasts a list rather than holding a thread.
openclaw skills install @cargo-ai/agentic-engagementState: to-be-approved. Deploy-verified against a live workspace: not yet. Treat Done when
below as the acceptance test and review cargo-ai cdk plan before deploying. Make no outcome claim
for this skill until it is approved.
A lead who replies to you gets an answer, on the same thread, from an agent that already knows
what you sell. That is a conversation, not a sequence: one mailbox the workspace owns, one agent
bound to it, a native email trigger that wakes the same chat when status becomes replied or
unsubscribed, and a heartbeat that checks a thread that stayed at sent.
Three resources make the loop:
defineDomain is the inbox's home. The checked example adopts a domain
already bought in the Cargo UI. Registering a new one charges workspace credits and is not
refundable — a + create domain:… line in the plan is that purchase.defineMailbox is the From address. It is a recurring monthly
credit charge for as long as it exists. Domain, username and type are create-only: changing
any of them destroys the inbox and puts a new one at the bottom of the send ramp.agentNativeTrigger({ agentSlug: "email" }) and a heartbeat. The agent
cannot call sendEmail itself, so a tool wraps it and pins the mailbox uuid. The trigger
fires on replied and unsubscribed — inbound status. The heartbeat is the other half:
silence has no event, so without it an unanswered first send is a dead chat. opened and
interacted stay out of kinds; a tracking-pixel view is not a reason to write.The first outbound is a separate invocation — a chat, or a play that calls the agent with a lead. This skill is the loop after that send. Without the native trigger a reply never comes back into the agent. Without the heartbeat a quiet thread never gets a status check.
Two failure modes worth knowing before you start. If the send-email tool takes the mailbox as
an input, the agent can pick a different inbox and the trigger wakes the wrong chat. If the reply
omits inReplyTo or passes only the parent Message-ID as references, mail clients break the
thread and the next wake has no conversation to continue.
This folder is a worked example: real CDK resources written for some other company. The job
is to end up with the code your company would have written, in your project, and an agent does the
adapting. If the cargo-cdk skill is in your session it carries the long form of this; if not,
this is enough.
cargo-ai cdk add cookbook/agentic-engagement writes this example to
infra/agentic-engagement/ and this procedure to .claude/skills/agentic-engagement/. No
project yet?
cargo-ai cdk init <dir> --cookbook agentic-engagement && cd <dir> && npm install does both;
this folder never ships a shell. If you are reading this from the project's
.claude/skills/, the install already happened — start at step 2. On a CLI too old to have
add, copy this folder in as a sibling of what is there by hand; everything below is
unchanged..env needs to the project's .env.example; never overwrite it.## Decisions section in
your copy of this file.npm run check && cargo-ai cdk plan (check validates the resource tree
offline; the blank template ships it). Show the diff. A + create mailbox:… line is a monthly
charge, not a one-off — quote the live figure from cargo-ai mailboxManagement pricing get
and get an explicit yes. Deploy only on that yes: cargo-ai cdk deploy. Never cdk init --force into a non-empty directory.Derive before you ask. An input with a lookup is looked up, not asked. Only the ones marked asked genuinely live in the operator's head.
| Input | Kind | How it is answered | Why it matters |
|---|---|---|---|
sendingDomain (infra/domains/outreach.ts) | value | derived: a domain the workspace already owns is adopted (adopt: true). There is no CLI list for sending domains — read cargo.state.json, the Cargo UI, or an existing defineDomain. Ask for the name only when nothing is found. | A mailbox cannot be created on a domain the workspace does not own. Registering a second copy of a domain the workspace already has fails instead of binding. |
mailboxIdentity (infra/mailboxes/rep.ts) | asked | first name, last name, and username of a real person. The From header is what the lead sees. | A fabricated sender is refused. Domain, username and type are create-only; getting the local part wrong means destroy plus a new inbox. |
languageModel (infra/connectors/openai.ts) | value | derived: whichever LLM connector is already authenticated in the workspace | Conversation quality and per-turn cost both live here. |
mailboxCharge | asked | cargo-ai mailboxManagement pricing get for the chosen type, said out loud as a recurring cost, approved before apply | A mailbox bills every month until destroy. Silence is not approval of a fleet. |
Checked before moving on, not after the deploy:
sendingDomain: the declaration matches a domain the workspace owns, or the plan's + create domain:… line was approved as a new registrationdnsRecords is omitted unless the operator explicitly wants this file to own the whole zonemailboxIdentity: first name, last name and username are a real identity, and the username is a valid local partmailboxCharge: the plan's + create mailbox:… line was approved against a live pricing getnode --import tsx evals/contract.mjs passes against the adapted graphThe code is a worked example. These reshapes are expected, and the agent offers them rather than waiting to be asked. Every one costs something; that is what makes it a variation and not the default.
| Variation | When it is right | How | What it costs |
|---|---|---|---|
register-domain | The workspace does not yet own a sending domain | Drop adopt: true on defineDomain. Do not add dnsRecords unless you mean to replace the whole zone (infra/domains/outreach.ts) | Registration charges workspace credits and is not refundable. The deploy waits until the domain is active before creating the mailbox. |
mailbox-type | Shared or private SMTP fits better than Google | Change type on defineMailbox (infra/mailboxes/rep.ts). outlook is not in the union: Graph delivery has not shipped. | Type is create-only. Changing it later is a new inbox and a reset ramp. Live pricing get for the new flavour. |
adopt-mailbox | The inbox already exists in the workspace | Set adopt: true on defineMailbox at the existing username@domain (infra/mailboxes/rep.ts) | Adopting never falls back to creating. The wrong address fails deploy instead of minting a second inbox. |
first-touch-play | New leads should get a first email without a human starting the chat | Add a play that calls the engager with a prompt naming the lead, then let this trigger own every reply. Keep the play's send path as a call to the agent, not a second sendEmail. | A play that sends without going through the agent starts threads the native trigger will never wake, because the trigger keys off chats this agent has emailed. |
However far you adapt, these hold. Ask for one anyway and the agent tells you what breaks, then does
it if you still want it, and records why under ## Decisions in your copy of this file.
infra/agents/engager.ts) Trigger kinds are replied and unsubscribed — inbound status. The heartbeat re-wakes a chat whose thread stayed at sent so the agent can check that status. A cron trigger, or kinds that include opened / interacted, either never continues the thread or writes when nobody asked. sendEmail wakes the chats this agent has emailed; a send from a play that bypasses the agent is invisible to it. Dropping the heartbeat makes silence a dead chat.infra/tools/send-email.ts) An agent cannot call sendEmail directly. A tool that lets the agent pick a mailbox sends from an inbox the trigger is not watching, and the run looks successful.inReplyTo and the full references chain, oldest first. (infra/agents/engager.prompt.ts) Passing only the parent Message-ID is how mail clients split the conversation. The next wake then has no thread to continue.infra/mailboxes/rep.ts) Editing them in place is not an update. It is destroy plus a new inbox, back at five real sends a day, with a new address the lead does not know.dnsRecords is omitted unless this file is meant to own the zone. (infra/domains/outreach.ts) Declaring it replaces every live record, including the ones the registrar wrote at purchase.infra/mailboxes/rep.ts) A fabricated sender is a refusal, not a configuration question.cargo-ai cdk plan reports the domain, the mailbox, the send-email tool and the engager, and
the operator approved the monthly mailbox line against a live pricing getnode --import tsx evals/contract.mjs passes: the agent trigger is native email with
kinds: ["replied", "unsubscribed"], a heartbeat is declared whose prompt names status, the
tool contains one sendEmail node, and mailboxUuid is not a form fieldactive (cargo-ai mailboxManagement mailbox refresh-status) and
warm-up has been started (mailbox start-warmup) so the send ramp can climbIn-Reply-To set),
not as a new conversationA mailbox is a monthly, recurring charge for as long as it exists. Immediately before the
plan, run cargo-ai mailboxManagement pricing get and read monthlyCredits for the chosen type.
Say that number out loud as a per-month cost, not a one-off. destroy is the only way it stops.
If the plan also shows + create domain:…, that registration is a separate, non-refundable
charge. Adopting an existing domain does not.
Each delivery is a sendEmail native action. Run cargo-ai connection native-integration get (or orchestration action list sendEmail) for the current per-send cost. The engager
adds one LLM turn per wake, including heartbeats. The per-thread cap is the cost control:
one send per wake, at most one unanswered follow-up, and a stop when the lead closes.
A mailbox that never starts warm-up stays at the floor of five real sends a day. Starting
warm-up is what moves the ramp; it takes forty-five days to finish. Check
mailbox get-send-allowance before promising volume.
account-scoring (the engager should be talking to accounts the scorer already ranked),
call-capture (a conversation that becomes a meeting is a call worth scribing),
crm-enrichment (the record the thread is about should already be filled).