arazzo: 1.0.1
info:
title: Adobe Experience Platform Query Service Execution
summary: Submit a SQL query to Query Service, poll until it finishes, then list recent queries.
description: >-
Runs an ad hoc analysis against the Adobe Experience Platform Data Lake using
Query Service. The workflow submits a SQL statement, polls the query id until
it leaves the SUBMITTED state, and then lists recent queries to confirm the
submission is recorded. Each step inlines the sandbox header, bearer token,
and API key so the flow can be read and executed without opening the
underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: queriesApi
url: ../openapi/adobe-experience-cloud-queries-api-openapi.yml
type: openapi
workflows:
- workflowId: query-service-execution
summary: Submit a SQL query, poll for completion, and list queries.
description: >-
Submits a SQL query to Query Service, polls the query status until it is no
longer SUBMITTED, and lists queries to confirm the run.
inputs:
type: object
required:
- authorization
- apiKey
- sandboxName
- dbName
- sql
properties:
authorization:
type: string
description: Bearer access token.
apiKey:
type: string
description: Adobe API key for the x-api-key header.
sandboxName:
type: string
description: The sandbox to operate in.
dbName:
type: string
description: The database name (typically the sandbox name).
sql:
type: string
description: The SQL statement to execute.
queryName:
type: string
description: Optional name for the query.
steps:
- stepId: submitQuery
description: Submit the SQL query to Query Service for execution.
operationId: createQuery
parameters:
- name: Authorization
in: header
value: $inputs.authorization
- name: x-api-key
in: header
value: $inputs.apiKey
- name: x-sandbox-name
in: header
value: $inputs.sandboxName
requestBody:
contentType: application/json
payload:
dbName: $inputs.dbName
sql: $inputs.sql
name: $inputs.queryName
successCriteria:
- condition: $statusCode == 202
outputs:
queryId: $response.body#/id
state: $response.body#/state
- stepId: pollQuery
description: >-
Poll the query status. While the query is still SUBMITTED the step retries;
once it reaches a terminal state the workflow continues.
operationId: getQuery
parameters:
- name: queryId
in: path
value: $steps.submitQuery.outputs.queryId
- name: Authorization
in: header
value: $inputs.authorization
- name: x-api-key
in: header
value: $inputs.apiKey
- name: x-sandbox-name
in: header
value: $inputs.sandboxName
successCriteria:
- condition: $statusCode == 200
- condition: $response.body#/state != 'SUBMITTED'
outputs:
finalState: $response.body#/state
rowCount: $response.body#/rowCount
onFailure:
- name: stillRunning
type: retry
retryAfter: 5
retryLimit: 12
criteria:
- condition: $response.body#/state == 'SUBMITTED'
- stepId: listQueries
description: List recent queries to confirm the submitted query is recorded.
operationId: listQueries
parameters:
- name: limit
in: query
value: 20
- name: Authorization
in: header
value: $inputs.authorization
- name: x-api-key
in: header
value: $inputs.apiKey
- name: x-sandbox-name
in: header
value: $inputs.sandboxName
successCriteria:
- condition: $statusCode == 200
outputs:
queries: $response.body#/queries
outputs:
queryId: $steps.submitQuery.outputs.queryId
finalState: $steps.pollQuery.outputs.finalState
queries: $steps.listQueries.outputs.queries
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.