All protocolsMeta ads launch and buying
protocol/meta-ads-launch@1.0v1.012 steps · 6 gates · 4 client decisionsMeta ads launch and buying
Read an ad account's history, launch a campaign paused and verified, then buy media day by day against real orders, with every activation on the client's word.
When to use
Use when a client brings an existing Meta ad account, or a new one, and wants campaigns launched and managed. The protocol reads before it writes, creates everything paused, and ties budgets to break-even cost per order rather than to the platform's own reporting.
Pipeline
Inputs
What the work needs before it starts. Every required input is in hand before step one.
| Name | Type | Required | Description |
|---|---|---|---|
ad_account_access | credential | Required | A system-user token stored in the client's own workspace vault and never shared between clients. |
ad_account_choice | identifier | Required | The ad account the client names. It is never picked automatically. |
publish_permission | boolean | Required | Whether the account may publish, granted explicitly by the client. |
economics | facts | Required | Unit cost, shipping and fees for each offer, used to compute break-even cost per order. |
creative | assets | Required | Approved creative from the static ad creative or AI animated explainer protocols. |
budget | money | Required | Daily budgets per ad set in the account's currency, approved by the client. |
buying_policy | rules | Optional | Cut, trim and scale rules, and how far a single run may move a budget. |
Outputs
| Name | Type | Description |
|---|---|---|
account_analysis | document + PDF | What worked historically and last season, with every number traced to its evidence. |
legacy_library | media | Past creative copied into the media library and tagged as legacy. |
campaign_plan | document | Objective, ad sets, budgets, a tracking audit and the creative for each ad set. |
paused_campaign | ad account objects | Campaign, ad sets and ads created paused and verified field by field. |
buying_reports | tables | A change table per run: on or off, budget before and after, and the reason for each change. |
run_records | folder | The plan, applied changes, analysis and metrics of every buying run. |
Steps
Step 1: Access
OperatorStore the client's token in their own workspace, test it and list the ad accounts it reaches. The client picks the account; its Page, Instagram account and dataset are discovered, never asked for.
- Tool
agent.mjs meta.connection.test · meta.accounts.discover- Artifact
- Connection test and discovered identity
GateAccount choice· decided by Client
The client names the ad account. Publish permission is granted only when the client says the account may publish.
Step 2: Legacy recon
AgentRead the account with GET requests only: lifetime winners, last season's chronology, measurement anomalies and proven copy. Nothing is created, edited, paused or activated.
- Tool
Account analysis kit- Artifact
- Account analysis and summary PDF
GateEvidence trace· decided by System
Every figure in the analysis comes from the evidence tables, and anomalies are named before the winners they inflate.
Step 3: Asset ingest
AgentCopy past creative into the media library, tagged as legacy, with notes and metadata. Running it twice creates nothing new.
- Artifact
- Tagged legacy media library
Step 4: Bind the account
OperatorBind the chosen account with its Page, Instagram account, dataset and conversion domain as defaults.
- Tool
agent.mjs meta.account.bind · meta.account.defaults- Artifact
- Account binding with defaults
Step 5: Campaign plan
AgentChoose the objective deliberately, because it cannot change once the campaign exists. Set budgets per ad set, audit tracking, and source the creative from the static or video protocols.
- Tool
Static ad creative · AI animated explainer- Artifact
- Campaign plan
Step 6: Draft and review
AgentCreate the draft and run its dry-run review. Ad sets, copy, identity, budgets and videos are checked; nothing is created in the ad account.
- Tool
agent.mjs meta.draft.create · meta.draft.review- Artifact
- Draft review digest
GateLaunch and spend approval· decided by Client
The client approves the plan, the creative and the budgets before the draft is pushed. No publishing or spend is possible before this approval.
Step 7: Push paused
AgentPush the approved draft. Every campaign, ad set and ad is created paused.
- Tool
agent.mjs meta.draft.push- Artifact
- Paused campaign
Step 8: Read back
SystemPoll the run until it finishes, then verify every field (paused status, budgets, identity and videos) against what was sent.
- Tool
agent.mjs meta.runs- Artifact
- Verified read-back
GateZero mismatches· decided by System
The run must succeed with every field verified and zero mismatches before activation is offered.
Step 9: Activation
ClientThe client switches the ads on, or tells us to in so many words. Those words are recorded verbatim.
- Artifact
- Live campaign with the client's authorization on record
GateActivation· decided by Client
Ads go live only on the client's explicit instruction. The system never activates or resumes anything on its own.
Step 10: Changes to live campaigns
OperatorEvery change re-reads the live object first. A change a person made since the last read is refused as drift, and an unknown outcome is settled by reading, never by resending.
- Artifact
- Change log with read-backs
Step 11: Daily buying
AgentReconcile the platform's purchases with real orders, judge each offer against its own break-even cost per order, then scale winners by about 50 %, trim fading ad sets by 33 to 50 % and cut only on the client's rules. Runs in observe, supervised or guarded-auto mode.
- Tool
Budget manager (observe · supervised · guarded-auto)- Artifact
- Change table per account
GateBuying policy· decided by Client
Budget changes stay inside the policy the client approved, one change per ad set per run. The buyer never activates or resumes.
Step 12: Record the run
AgentWrite the run record (authorization, plan, applied changes, analysis and metrics) and fold any new client rule into the account's playbook.
- Artifact
- Run record
Gates
A gate must pass before the next step starts. Filled gates are the client's decisions; nothing is spent, published or sent before them.
| Gate | Decided by | Rule |
|---|---|---|
| Account choice | Client | The client names the ad account. Publish permission is granted only when the client says the account may publish. |
| Evidence trace | System | Every figure in the analysis comes from the evidence tables, and anomalies are named before the winners they inflate. |
| Launch and spend approval | Client | The client approves the plan, the creative and the budgets before the draft is pushed. No publishing or spend is possible before this approval. |
| Zero mismatches | System | The run must succeed with every field verified and zero mismatches before activation is offered. |
| Activation | Client | Ads go live only on the client's explicit instruction. The system never activates or resumes anything on its own. |
| Buying policy | Client | Budget changes stay inside the policy the client approved, one change per ad set per run. The buyer never activates or resumes. |
Failure modes
| Symptom | Prevention |
|---|---|
| Ad sets are judged on the platform's purchase count alone | Platform purchases are reconciled with real orders, with add-on purchases netted out, before any ad set is called a winner. |
| A person's manual budget change is overwritten | Every change re-reads the live budget first. A difference since the last read is drift, and the change is refused. |
| A write is sent twice after a timeout | An unknown outcome is settled by a later read, never by sending the write again. |
| The wrong ad account is used | The client names the account. The first account a token can reach is never chosen. |
| A one-order fluke is scaled as a winner | Results resting on a single order are labelled unproven, and outlier-adjusted cost per order is reported beside the headline figure. |
| The campaign objective is wrong after launch | The objective is chosen deliberately in the plan and approved with it; it cannot be changed later. |
| Budget edits are throttled | One change per ad set per run. A throttle is waited out, never looped through. |
Operator commands
Run by our operators and coding agents inside our own tooling. These are workflow commands, not public API endpoints. Every paid, publishing or sending command runs only after the client's approval.
Operator commandConnect and bind the client's account
node scripts/adbuy/agent.mjs meta.connection.test
node scripts/adbuy/agent.mjs meta.accounts.discover
node scripts/adbuy/agent.mjs meta.account.bind --arg adAccountId=<client-chosen-account> --arg allowPublish=false
node scripts/adbuy/agent.mjs meta.account.assets --arg bindingId=<binding-id>Operator commandDraft, review and push paused, only after the client approves
node scripts/adbuy/agent.mjs meta.draft.create --json <draft.json>
node scripts/adbuy/agent.mjs meta.draft.review --json <review.json>
node scripts/adbuy/agent.mjs meta.draft.push --json <push.json>
node scripts/adbuy/agent.mjs meta.runs --arg runId=<run-id>Operator commandBuying run fallback: read, analyze, dry run
npx tsx scripts/meta-ads/account-review.ts --workspace <workspace> --out <scratch-dir>
python3 -I scripts/meta-ads/account-review-analyze.py <scratch-dir>/<snapshot.json>
npx tsx scripts/meta-ads/budget-apply.ts --plan <plan.json> --out <scratch-dir>/runs
# add --execute only after a clean dry run and the client's authorization