Skip to content

line_item_record_execution

Record one provider object a line item created, so the plan knows what came from where.

On this page

Records that this Line Item created a particular provider object. Call it after each create.

Input

Field Type Required Description
campaign_plan_name string yes The plan that owns the line.
line_item_id lni_… yes Which line this object came from.
provider enum yes meta, tiktok, gads, snapchat, dv360.
entity_type string yes The provider’s own word for the level: campaign, adset, ad.
entity_id string yes The native provider id, unprefixed, exactly as the create returned it.
advertiser_id acc_… yes The account it was created in.
mutation_workflow_id string no The workflow id the create returned, when you have it.

Example

const created = await meta_create_campaign({/* … */});
line_item_record_execution({
  campaign_plan_name: 'q4-acquisition',
  line_item_id: 'lni_abc',
  provider: 'meta',
  entity_type: 'campaign',
  entity_id: created.campaignId,
  advertiser_id: 'acc_123',
  mutation_workflow_id: created.workflowId,
});

Warning

Nothing records this for you

One line may create any number of objects and you chose the shape, so only you know which objects belong to which line. A line that executed but was never recorded looks unexecuted while it is already spending.

Note

Recording twice is harmless

The same object named twice is one fact stated twice, and collapses to one row. Two different objects are two rows — which is how a double execution stays visible, since nothing blocks one.

Tip

Say "3 objects created", never "complete"

How many objects a line should produce was never declared, so a line holding a campaign and no ad set cannot be called unfinished rather than done. Only “has created something” is knowable.

Requires the campaign_plan:write scope.