ETLMCPData Conveyance Works
Log in Start free
Docs

Webhook payload, batching and retries

The JSON body etlmcp POSTs to your webhook, how a run is split into batches, what counts as success, and what a retry sends again.

A webhook destination receives each run as one or more HTTPS POST requests with a JSON body of three keys: rows, a list of row objects; batch, the number of this request, counting from 1; and batches, how many requests the run sends in all. A large run is split into batches of a fixed size, which the destination's description in the app states, and the batches go out one after another, never in parallel. Your endpoint must answer every batch with a 2xx status. A failure on a later batch does not take back the batches your endpoint already accepted, and when etlmcp retries the run, it sends every batch again from the first. Build your receiver so that receiving the same rows twice changes nothing.

The body of one request

Every request carries the header Content-Type: application/json, plus any headers you saved on the destination, such as an authorization token. The body looks like this for a run small enough to fit one batch:

{
  "rows": [
    {
      "date": "2026-11-14",
      "network": "google",
      "account_id": "1234567890",
      "account_name": "Main account",
      "campaign_id": "c1",
      "campaign_name": "Brand search",
      "adgroup_id": null,
      "adgroup_name": null,
      "ad_id": null,
      "ad_name": null,
      "impressions": 100,
      "clicks": 3,
      "cost": 1.5,
      "conversions": 1,
      "conversion_value": 10.0,
      "ctr": 0.03,
      "cpc": 0.5,
      "cpm": 15.0,
      "cpa": 1.5,
      "currency": "USD"
    }
  ],
  "batch": 1,
  "batches": 1
}

What a row holds:

  • The standard columns, the ones in the example: the day, the network, the account, campaign, ad group and ad with their ids and names, the delivery and conversion metrics, and the currency. A column that does not apply to a row, such as the ad on a campaign-level row, can be null.
  • Extra columns flattened into the row. A platform field outside the standard set arrives as a key of its own named extra. followed by the field name, for example extra.reach. The dot is part of the key, so read it with bracket access (row["extra.reach"]) rather than as a nested object.
  • Your pipeline's rules applied. The rows are the ones your transform produces, so a renamed, dropped or derived column shows up in the body exactly as the rules leave it. Without rules, you get the standard columns and any extra ones.
  • Dates as text, in the YYYY-MM-DD form. Any value that JSON cannot carry as it is gets sent as its text form.

Each request holds only rows. Nothing in the body names the pipeline or the run, so if one endpoint serves several pipelines, give each its own URL or its own header value to tell them apart.

Which rows a run sends

A webhook receives only the dates of the run's range, not the source's whole stored history. A routine sync pulls recent days again (see the trailing window), so the same day reaches your endpoint on many runs in a row. Treat a delivery as the current figures for its days: replace what you hold for those days, keyed on the date with the network, account, campaign, ad group and ad ids, rather than adding to it.

A run whose range holds no rows sends no request at all.

What counts as delivered

etlmcp reads only the status code of each response and never the body, so you can answer with an empty body. For each batch:

Your endpoint What happens
Answers 2xx The batch is delivered and the next one is sent.
Answers 3xx The run stops with webhook redirected. Redirects are never followed, so give the final URL.
Answers 429 or 5xx The run stops with webhook returned HTTP {…}, and the run is retried.
Answers any other 4xx The run stops with webhook returned HTTP {…} and is not retried.
Takes too long on the whole batch Each batch has an overall time limit, from connecting to the status line. Past it, the run stops with webhook timed out and is retried.
Stalls or cannot be reached Connecting, sending and waiting each have a shorter limit of their own. A stall past one of them, a refused connection or a failed TLS handshake stops the run with webhook request failed: {…}, followed by the network error, and the run is retried.

When a run has more than one batch, the message names the batch that failed, with on batch {…} of {…}. If that batch is not the first, earlier batches were delivered follows, for example webhook returned HTTP 503 on batch 3 of 7; earlier batches were delivered. In that case batches 1 and 2 reached your endpoint and nothing after batch 3 was sent.

Retries send every batch again

A run that stops for a reason that can pass, a 429, a 5xx, a timeout or a lost connection, is queued again, and its error reads retrying: {…} while it waits. A run gets 3 attempts in all. The second waits at least 60 seconds and the third at least 300 seconds. etlmcp does not read a Retry-After header from your endpoint, so these waits do not change when you send one. Retries covers the rules shared by every destination.

A new attempt runs the whole sync again, from the platform to your endpoint, and sends the batches from batch 1. Unlike the PostgreSQL destination, which deletes the run's dates before it writes them, a webhook has no way to undo what your endpoint already accepted. A retry after a failure on batch 3 therefore sends batches 1 and 2 a second time. Because the platform is asked again, the batch count and the figures may differ from the first attempt, which is another reason to replace by key rather than append.

For the same reason, a worker that is shutting down for a deploy does not hand a run back to the queue once delivery to a webhook has begun: the delivery finishes or fails where it is.

When every attempt fails

When the last attempt fails, or the failure cannot pass, the run ends as partial: the rows were pulled and stored in etlmcp, but delivery failed. The run reports zero rows delivered even when some batches reached you, so check your own receiver for what arrived. See run statuses for what each status means.

The days of a partial run are not counted as delivered. If the next scheduled sync's usual window would leave out days since the last delivered one, it reaches back to cover them, as far as your plan's history allows, so once your endpoint answers again, the missed days arrive with the new ones. The days your endpoint did receive from the failed run arrive again too, which a receiver that replaces by key absorbs without double counting.

Testing your receiver

The Test button on the destination POSTs one sample row in the same shape, as batch 1 of 1, with the extra header X-Etlmcp-Test: 1. Filter on that header so the sample never lands in your data. A 2xx answer shows Webhook accepted a sample row.; any other answer shows the same messages as a run. For the URL rules, saved headers and how they are protected, see the webhook destination.

Related