arazzo: 1.0.1 info: title: Adobe Analytics Clone a Calculated Metric summary: Read an existing calculated metric and create a copy of it under a new name. description: >- Duplicates an Adobe Analytics calculated metric so its formula can be reused and tweaked without disturbing the original. The workflow retrieves the source calculated metric by ID — including its formula definition, report suite, and type — and creates a new calculated metric that reuses that definition under a caller-supplied name. Every step spells out its request inline, including the Adobe IMS bearer token and Developer Console API key headers. version: 1.0.0 sourceDescriptions: - name: analyticsApi url: ../openapi/adobe-analytics-api-openapi.yml type: openapi workflows: - workflowId: clone-calculated-metric summary: Read a source calculated metric and create a copy of it. description: >- Fetches the source calculated metric by ID and creates a new calculated metric that reuses the source formula definition, report suite, and type under a new name. inputs: type: object required: - accessToken - apiKey - sourceCalculatedMetricId - newCalculatedMetricName properties: accessToken: type: string description: Adobe IMS OAuth 2.0 access token (sent as a Bearer token). apiKey: type: string description: Adobe Developer Console API key (x-api-key header). sourceCalculatedMetricId: type: string description: The ID of the calculated metric to clone. newCalculatedMetricName: type: string description: Display name for the cloned calculated metric. steps: - stepId: getSourceCalculatedMetric description: Retrieve the source calculated metric, including its definition and type. operationId: getCalculatedMetric parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: x-api-key in: header value: $inputs.apiKey - name: calculatedMetricId in: path value: $inputs.sourceCalculatedMetricId successCriteria: - condition: $statusCode == 200 outputs: sourceRsid: $response.body#/rsid sourceDefinition: $response.body#/definition sourceType: $response.body#/type sourceDescription: $response.body#/description - stepId: createClone description: Create a new calculated metric that reuses the source definition under a new name. operationId: createCalculatedMetric parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: x-api-key in: header value: $inputs.apiKey requestBody: contentType: application/json payload: name: $inputs.newCalculatedMetricName description: $steps.getSourceCalculatedMetric.outputs.sourceDescription rsid: $steps.getSourceCalculatedMetric.outputs.sourceRsid definition: $steps.getSourceCalculatedMetric.outputs.sourceDefinition type: $steps.getSourceCalculatedMetric.outputs.sourceType successCriteria: - condition: $statusCode == 200 outputs: clonedCalculatedMetricId: $response.body#/id clonedCalculatedMetricName: $response.body#/name outputs: clonedCalculatedMetricId: $steps.createClone.outputs.clonedCalculatedMetricId clonedCalculatedMetricName: $steps.createClone.outputs.clonedCalculatedMetricName