arazzo: 1.0.1 info: title: Google Analytics Discover Property and Run Report summary: Walk account summaries to find a GA4 property, list its properties, then run a core report. description: >- A discovery-to-reporting flow across the GA4 Admin and Data APIs. The workflow first lists the account summaries the caller can access, then lists the GA4 properties under the chosen account, and finally runs a core report against the selected property. Each step spells out its request inline, including the inline OAuth bearer authorization, so the flow can be read and executed without opening the underlying OpenAPI descriptions. version: 1.0.0 sourceDescriptions: - name: analyticsAdminApi url: ../openapi/google-analytics-admin-api.yaml type: openapi - name: analyticsDataApi url: ../openapi/google-analytics-data-api.yaml type: openapi workflows: - workflowId: discover-and-run-report summary: Discover an accessible GA4 property and run a core report against it. description: >- Lists account summaries, lists the properties under a chosen account, and runs a runReport request against the supplied property resource name. inputs: type: object required: - accessToken - account - property properties: accessToken: type: string description: OAuth 2.0 bearer access token with an analytics read scope. account: type: string description: 'Account resource name to list properties under (e.g. accounts/123).' property: type: string description: 'GA4 property resource name to report on (e.g. properties/1234).' startDate: type: string description: Inclusive report start date as YYYY-MM-DD or NdaysAgo. default: 28daysAgo endDate: type: string description: Inclusive report end date as YYYY-MM-DD, yesterday, or today. default: yesterday steps: - stepId: listAccountSummaries description: >- List summaries of every account accessible by the caller to confirm the target account is reachable. operationId: analyticsadmin.accountSummaries.list parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: pageSize in: query value: 200 successCriteria: - condition: $statusCode == 200 outputs: accountSummaries: $response.body#/accountSummaries - stepId: listProperties description: >- List the GA4 properties under the chosen account using a parent filter so a property can be selected for reporting. operationId: analyticsadmin.properties.list parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: filter in: query value: parent:$inputs.account - name: pageSize in: query value: 200 successCriteria: - condition: $statusCode == 200 outputs: properties: $response.body#/properties - stepId: runReport description: >- Run a core report for active users and event count broken down by country over the supplied date range. operationId: analyticsdata.properties.runReport parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: property in: path value: $inputs.property requestBody: contentType: application/json payload: dimensions: - name: country metrics: - name: activeUsers - name: eventCount dateRanges: - startDate: $inputs.startDate endDate: $inputs.endDate limit: "100" successCriteria: - condition: $statusCode == 200 outputs: rows: $response.body#/rows rowCount: $response.body#/rowCount dimensionHeaders: $response.body#/dimensionHeaders metricHeaders: $response.body#/metricHeaders outputs: accountSummaries: $steps.listAccountSummaries.outputs.accountSummaries properties: $steps.listProperties.outputs.properties rows: $steps.runReport.outputs.rows rowCount: $steps.runReport.outputs.rowCount