Agent

A campaign agent that works in conversation and stops at approval

The agent accepts a request in plain language, calls the same tools the dashboard uses, reports what it changed, and never publishes. The approval gate is part of the workflow, not a policy the model is asked to remember.

From message to approved campaign

  1. Send the request

    The manager writes in the dashboard chat or a linked WhatsApp number. The message is stored as a chat turn against the tenant and user.

  2. Queue and lease

    The HTTP request only enqueues the turn. A leased chat worker claims it, so a slow model call never holds the API connection open and a crashed worker's lease expires for retry.

  3. Agent reasons and calls tools

    The worker runs the configured campaign_agent model, which calls tools such as starting a campaign, reading the current recommendation, regenerating an asset or requesting approval.

  4. Stream the reply

    Progress and the final answer stream over server-sent events. A reconnect with the last event ID resumes the stream instead of replaying or losing output.

  5. Hand off to approval

    Anything that would publish is turned into an approval request. The agent reports what it prepared and what is waiting for a reviewer; it cannot approve on its own.

  6. Record the run

    The turn, tool calls, model identity, token usage, latency and trace ID are recorded, so a reviewer can see exactly what the agent did.

Two ways in, one workflow

  • Dashboard chat

    Authenticated, tenant-scoped and gated by the campaign_agent feature. The reply renders inline with links to the workflow or campaign it touched.

  • WhatsApp channel

    A Meta WhatsApp Cloud API webhook verifies the request signature, maps the phone number to a tenant link, and creates the same chat turn. Replies go back through the Cloud API.

  • Link and verify

    Inbound WhatsApp numbers are linked to a tenant through a verification flow, so an unknown number cannot start a campaign. Unlinking revokes the mapping.

  • Same guardrails

    Both entries share rate limits, input and output caps, quota checks and the approval gate. The channel changes transport, not authority.

What the agent may do on its own

  • Start a discount or campaign workflow for the tenant
  • Read the current recommendation, campaign version and asset set
  • Request regeneration of a proposal, content or a creative asset
  • Explain a rule check or a policy citation behind a recommendation
  • Prepare an approval request and notify the configured reviewers

What it cannot do

  • Publish a campaign or deliver a social post
  • Approve its own request or another reviewer's request
  • Exceed the configured discount percentages, margin floor or prohibited terms
  • Read another tenant's data or another user's assistant-owned resources
  • Bypass a disabled optional stage or a feature the tenant has not enabled

Guardrails sit around the conversation

Chat input and output have hard character caps, per-user and per-tenant rate limits apply to sends and to the streaming endpoint, and quota checks run before a turn is queued. A request that exceeds a limit is rejected with a specific code rather than silently truncated.

The agent is a client of the platform, not an administrator. It authenticates with the user's actor context, so the same feature gating, tenant scoping and repository checks that protect the API protect the conversation.

Availability depends on three switches

Availability depends on three switches
LayerWhat it controlsWho sets it
Tenant flagWhether the tenant may use the campaign agent and channels at allAdministrator
User grantWhether a specific user inside an enabled tenant may use itAdministrator
RoleWhether the user's role is allowed to act; viewers are excludedRole model

Why the worker is separate

Model calls are slow and fail in interesting ways. Moving them to a leased worker keeps API latency predictable, makes retries safe, and lets a deployment scale chat independently of the web tier. The dashboard shows the current state of a turn even when the stream is closed.

See the pipeline behind the conversation

The how-it-works page follows a chat turn through the worker, the workflow and back to the approval gate.