get_mutation_status

Poll a change started by a write tool and find out whether it succeeded, failed, or is still running.

Both write tools — meta_set_status and meta_update_budget — return a workflowId immediately, before the change has reached the provider. This is how you find out what happened to it. Requires the mutation:write scope.

Input

Field Type Required Description
workflowId string yes The workflowId a write tool returned.

Output

One of three states:

status Meaning
running Still in flight. Poll again.
complete It finished. result says whether it worked.
errored The workflow itself failed — rare, and distinct from a rejected change.
{ "status": "complete", "result": { "ok": true, "result": {  } } }

`complete` does not mean it worked

A change Meta rejected still comes back complete, with result.ok === false and a reason. That is deliberate: a provider failure is a finished, legible outcome rather than an error to retry, so a retry can never re-fire a write you didn’t ask for twice. Check result.ok, not just status.

Failure reasons you may see inside result: budget_cap_exceeded, wrong_level, missing_write_access, not_found, provider_error.

Example

const { workflowId } = meta_set_status({
  advertiserId: 'acc_123456789',
  id: '23851234567890123',
  level: 'campaign',
  status: 'PAUSED',
});

let status = get_mutation_status({ workflowId });
while (status.status === 'running') {
  status = get_mutation_status({ workflowId });
}
// → { status: 'complete', result: { ok: true, … } }

Errors

  • No such mutation for this organization — the workflowId is unknown, or belongs to another organization. The two return the same answer on purpose.
  • 401 Unauthorized / 403 insufficient_scope (needs mutation:write).

Seeing every change, not just yours

get_mutation_status answers about one change you started. The full history — every change any agent or person made, which account, what exactly changed, who asked, and how it ended — is in the console on the Activity page.