Skip to content

Pilot

Pilot automation

Native Sheets setup, scoped schedules, source and delivery status, and bounded recovery.

The controlled GA4-to-Sheets pilot is implemented and locally tested. This is not a general export service or a claim of connector or destination GA.

These are authenticated REST routes on the public API host https://api.signalbraid.com; they do not add an OAuth signup flow or an MCP write tool.

Method and pathScopeRequest body
POST /v1/pilot/destinationssync:write{ "destinationId": "your_destination" }
POST /v1/pilot/schedulessync:writeConnection, property, destination, window and cadence below
GET /v1/pilot/schedules/{scheduleId}query:readNone
POST /v1/pilot/schedules/{scheduleId}/enabledsync:write{ "enabled": true } or { "enabled": false }
POST /v1/pilot/runs/{pipelineId}/redrivesync:write{}

Bodies must be JSON, at most 4 KiB, with exactly the documented fields. The key determines the workspace; these bodies do not accept workspaceId, a timezone, tokens, spreadsheet IDs, arbitrary URLs or an actor identity. The private sync Worker authenticates again, and the gateway rechecks authorization before releasing a result or scoped error.

Background work uses the enabled schedule revision and active workspace, connection, destination and runtime grants. It does not retain the API key that configured the schedule. Revoking that key prevents further operator API calls; disable the schedule to stop its recurring work.

An operator must first enroll a genuine runtime Sheets grant for the destination, with Google’s drive.file scope. This is separate from the GA4 read-only grant. A workbook created through another application’s connector does not establish this application’s access. The destination setup API accepts only the enrolled destinationId; it never receives a refresh token.

POST /v1/pilot/destinations creates the dedicated native workbook, verifies its reserved layout and returns 200:

{
"destinationId": "your_destination",
"state": "active",
"spreadsheetId": "provider_assigned_id",
"url": "https://docs.google.com/spreadsheets/d/provider_assigned_id/edit"
}

Repeating setup for an active destination verifies the same workbook and returns the existing identity; it does not create another one. A known workbook that failed verification can retry verification. If creation’s outcome is unknown, setup returns 409 destination_creation_unconfirmed and leaves the destination paused for operator review. It will not blindly issue a second create request.

Keep the reserved Daily, Provenance and hidden Ledger sheets intact. Editing their layout produces an actionable conflict. Each occurrence has its own immutable generation block; both visible views select the greatest committed generation. A delayed older delivery cannot replace a newer visible generation. The Ledger holds 1,000 generation blocks. A new workbook reuses them in a ring: generation 1,001 is written over the block of generation 1, and that block is cleared in the same request, so the Ledger keeps the latest 1,000 generations. A workbook created with the earlier layout is never converted. It stops accepting generations after 1,000. After that, the scheduler does not try a 1,001st generation: it stops planning the schedule, which stays enabled, and the schedule’s status shows destination_capacity_exhausted. Creating or enabling a schedule on that destination is refused with 409 sheet_capacity_exhausted; disabling one is still accepted.

You can read the pilot workbook in Looker Studio with Google’s own Google Sheets connector. This is the Sheets output read by another Google product. It is not a SignalBraid Looker Studio output, connector or integration; a Looker Studio connector is planned for a later release, with no date, and is not generally available.

  1. Open the workbook’s url from the destination setup response. Looker Studio connects to a spreadsheet you own or that is shared with your Google account. The workbook belongs to the Google account that was enrolled for the destination; if that is not your account, its owner shares the workbook with you in Google Sheets first.
  2. In Looker Studio, create a data source with the Google Sheets connector and select the workbook and the Daily worksheet. A Google Sheets data source connects to one worksheet at a time. Select Use first row as headers, so the fields take the Sheet’s column names, and set the optional range to A1:B32.
  3. To bring in provenance, add data sources on the Provenance worksheet the same way: one with the range A1:B23 for the run’s fields and values, and, if you need them, one with the range C1:G32 for the per-day run, extraction and publication details.
  4. Do not connect the hidden Ledger worksheet. It is the workbook’s internal record, not a view.

The ranges matter because the views are not plain tables. On Daily, row 33 holds the period’s total sessions and cell C1 holds the delivery number, so a data source on the whole worksheet would count the total as one more day and double every sum of Sessions. On Provenance, columns A and B and columns C to G are two different tables. Rows past the end of a shorter window are empty; filter them out in a chart if they show.

Do not insert, move or rename columns in the workbook to suit a chart; that layout is reserved and an edit produces a conflict (see above). Shape the data in Looker Studio instead, with calculated fields on the data source.

What this gives you, and what it does not:

  • One fixed result. Each workbook shows the one result its schedule delivers. Looker Studio has no field picker over SignalBraid’s metrics, and a report’s date range is not sent to SignalBraid; it only filters rows already in the Sheet.
  • Freshness is two clocks. The data is as fresh as the last schedule delivery to the Sheet, and then Looker Studio’s own data freshness. Google’s default for Sheets is to check for fresh data every 15 minutes, and the data source’s Data freshness setting changes that. After a column change, refresh the data source’s fields; an editor can use Refresh data in a report to fetch the latest rows now. Neither makes the Sheet update sooner than its schedule.
  • Sharing a report shares its data. With the data source’s owner’s credentials, anyone who can view the report sees its data without access to the workbook. With viewer’s credentials, each viewer needs their own view access to the workbook.
  • Operator-enrolled. The workbook comes from the destination setup above; there is no self-serve setup.

Google’s instructions: Connect to Google Sheets, Manage data freshness, About calculated fields and Data credentials. Google’s pages and defaults can change; check them before you rely on a figure.

First complete a source sync. The service derives the property’s timezone from existing published heads; absent timezone evidence is timezone_unverified, and mixed published timezones are timezone_conflict.

{
"connectionId": "your_connection",
"propertyId": "123456789",
"destinationId": "your_destination",
"windowDays": 5,
"cadenceMinutes": 1440
}

windowDays is an integer from 1 to 31. cadenceMinutes is 15, 60 or 1440, but GA4 refreshes hourly at most, so a GA4 schedule at 15 is refused with 400 cadence_below_source_floor on every plan. Creation checks the workspace plan’s refresh floor in the same write that creates the schedule. A cadence faster than the floor is refused with 403 cadence_not_entitled, and nothing is written. A 201 response means the schedule was created; it does not promise a run at the requested interval. The service checks the active connection and both retained grants and returns 201:

{
"scheduleId": "generated_schedule_id",
"enabled": false,
"timezone": "Europe/Oslo",
"windowDays": 5,
"cadenceMinutes": 1440,
"destinationId": "your_destination"
}

Retain scheduleId: every successful creation call creates a new disabled schedule. Enabling is a separate call to its /enabled route. Only one schedule may be enabled for a destination; another owner gives 409 schedule_conflict. Current source/destination grants and the observed timezone are checked again.

The initial due time is assigned by the service. Cadence is elapsed time, not a user-selected wall-clock time. Each due occurrence freezes the last completed dates in the verified property calendar. Cron reconciles due work; the due time is not a guarantee that Google delivery completes at that instant. A changed property timezone requires attention rather than silently changing an existing schedule.

The status route returns exactly schedule, latest and lastDelivered.

ObjectFields
scheduleid, revision, enabled, nextDueAt, timezone, windowDays, lastErrorCode
latest, or nullid, dueAt, sourceRunId, destinationOrdinal, state, sourceAttempts, sourceNextAttemptAt, errorCode, exportId, exportState, exportAttempts, exportNextAttemptAt, exportErrorCode, visibleOrdinal
lastDelivered, or nullpipelineId, destinationOrdinal, visibleOrdinal, completedAt

Times are epoch milliseconds. Error fields and an unread visibleOrdinal can be null. latest.id is the pipeline ID used by redrive. A pipeline moves through source_pending, source_running and export_pending, then records succeeded, superseded, failed or cancelled. Export state is tracked separately. lastDelivered records the latest successful verification, not an unverified provider response or a claim that the workbook was checked again just now.

Each phase has four durable attempts per budget. Transient failures retry with bounded backoff; provider retry hints beyond the accepted policy become retry_after_exceeds_policy. Duplicate delivery and lease recovery keep the same source run, occurrence and destination ordinal. Source success requires the whole window and expected run identities. A partial or superseded source does not advance the Sheet’s trusted output. Export failure does not retract a source publication.

Failed occurrences can be explicitly redriven with {}. A redrive gives the failed phase a fresh bounded budget and records the authenticated key ID as the actor. It retains the occurrence, source identity, ordinal and any frozen export evidence; it does not query newer data and relabel it as the same export. Unknown error text is filtered, while fixed policy, capacity, permission and integrity codes remain visible. See Errors.

Disabling increments the schedule revision and fences and cancels unfinished source and export work. It preserves successful history and does not erase the workbook. Already dispatched Google requests cannot be recalled. Re-enabling does not revive cancelled occurrences automatically.

The runtime captures data through a named private queryForExport service-binding RPC. It is neither an HTTP route in this API nor an MCP tool. The gateway loads the export’s persisted scope and lease, calls the same query implementation as REST and MCP, and requires the planned source publication. Frozen export evidence retains the normal provider_may_revise_recent_data and not_independently_reconciled limitations.