Automation Workflows
Use these workflows as starting points for AI agents, MCP clients, and automation systems.
Read-Only Health Check
Section titled “Read-Only Health Check”Recommended permissions: read scope or cartbay_agent_read capability.
Workflow:
- Read the agent manifest.
- Read analytics for 7, 30, and 90 days.
- List recent sessions with masked PII.
- Identify high failed-email counts, low restore rates, or many pending notifications.
- Report findings without modifying settings.
Safe output:
- Session IDs.
- Status counts.
- Recovery rates.
- Notification status counts.
- Recommendations that require human approval.
Avoid outputting raw customer emails unless sensitive access is explicitly enabled and required.
Email Failure Diagnosis
Section titled “Email Failure Diagnosis”Recommended permissions: read; optionally sensitive access for trusted support workflows.
Workflow:
- Read notification-heavy sessions.
- Identify failed and retry-queued notifications.
- Inspect error fields and lifecycle timestamps.
- Check whether Action Scheduler queues are delayed.
- Recommend SMTP/ESP verification if WordPress mail failures appear.
Do not resend emails automatically unless contact actions are enabled and the store owner approves.
Campaign Review
Section titled “Campaign Review”Recommended permissions: read; write only for approved changes.
Workflow:
- Read current campaign settings.
- Compare Email 1, 2, and 3 timings with defaults.
- Check coupon-enabled steps against offer settings.
- Read analytics by sequence step.
- Recommend changes such as delaying a step or moving coupons later.
- Apply changes only when
Agent Write Actionsis enabled and approval is explicit.
Controlled Send Action
Section titled “Controlled Send Action”Recommended permissions: contact plus read access.
Workflow:
- Read target session.
- Confirm it is a CartBay session and currently abandoned.
- Confirm email is not suppressed.
- Confirm no recovered order exists.
- Run
send_email_step_nowonly for the intended step. - Re-read session notifications and audit log.
Cleanup Workflow
Section titled “Cleanup Workflow”Recommended permissions: destructive access only for trusted admin automation.
Workflow:
- List sessions older than the retention policy or clearly test-only sessions.
- Present candidate session IDs and reasons.
- Require explicit approval.
- Use
expire_sessionbeforedelete_sessionwhen possible. - Confirm logs and analytics after completion.
MCP Workflow
Section titled “MCP Workflow”For WordPress MCP Adapter users:
- Create a dedicated WordPress user with least-privilege CartBay capabilities.
- Use Application Passwords for the MCP client.
- Enable Abilities Access.
- Enable MCP Public Exposure only for the dedicated user/workflow.
- Keep destructive and sensitive gates off unless the workflow requires them.
Agent Reporting Format
Section titled “Agent Reporting Format”Recommended report fields:
- Time range reviewed.
- Settings gates enabled.
- Capabilities/scopes used.
- Read operations performed.
- Write/contact/destructive operations performed.
- Session IDs touched.
- Warnings and unresolved questions.
- Whether any PII was accessed.