Prisma · Arazzo Workflow

Prisma Optimize Record and Analyze a Session

Version 1.0.0

Open a query recording session, pull the slowest captured queries and recommendations, then stop the session.

1 workflow 3 source APIs 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

prisma

Workflows

record-and-analyze-session
Create a recording session, fetch its slowest queries and recommendations, and stop it.
Opens a recording session, lists captured queries sorted by duration, pulls optimization recommendations, then stops the session.
4 steps inputs: apiKey, databaseProvider, sessionName outputs: finalStatus, queryCount, recommendationCount, sessionId
1
createSession
Open a new query recording session for the supplied database provider.
2
listSlowestQueries
List the queries captured during the session ordered by duration descending so the slowest queries surface first.
3
listRecommendations
Pull the AI-powered optimization recommendations generated for the captured queries in the session.
4
stopSession
Stop the recording session to finalize the captured query data for analysis. No further queries are captured after this.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Prisma Optimize Record and Analyze a Session
  summary: Open a query recording session, pull the slowest captured queries and recommendations, then stop the session.
  description: >-
    Drives a full Prisma Optimize analysis loop. The workflow opens a recording
    session for a database provider, lists the captured queries ordered by
    duration to surface the slowest ones, pulls the AI-powered optimization
    recommendations for the session, and finally stops the session to finalize
    the captured data. Every step spells out its request inline so the flow can
    be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: queriesApi
  url: ../openapi/prisma-queries-api-openapi.yml
  type: openapi
- name: recommendationsApi
  url: ../openapi/prisma-recommendations-api-openapi.yml
  type: openapi
- name: sessionsApi
  url: ../openapi/prisma-sessions-api-openapi.yml
  type: openapi
workflows:
- workflowId: record-and-analyze-session
  summary: Create a recording session, fetch its slowest queries and recommendations, and stop it.
  description: >-
    Opens a recording session, lists captured queries sorted by duration, pulls
    optimization recommendations, then stops the session.
  inputs:
    type: object
    required:
    - apiKey
    - databaseProvider
    properties:
      apiKey:
        type: string
        description: Optimize API key, sent as a Bearer token in the Authorization header.
      sessionName:
        type: string
        description: Optional display name for the recording session.
      databaseProvider:
        type: string
        description: Database provider being recorded (postgresql, mysql, cockroachdb, or sqlserver).
  steps:
  - stepId: createSession
    description: >-
      Open a new query recording session for the supplied database provider.
    operationId: createSession
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.sessionName
        databaseProvider: $inputs.databaseProvider
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      sessionId: $response.body#/id
      status: $response.body#/status
  - stepId: listSlowestQueries
    description: >-
      List the queries captured during the session ordered by duration
      descending so the slowest queries surface first.
    operationId: listSessionQueries
    parameters:
    - name: sessionId
      in: path
      value: $steps.createSession.outputs.sessionId
    - name: orderBy
      in: query
      value: duration
    - name: order
      in: query
      value: desc
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      queryCount: $response.body#/total
      slowestQueryId: $response.body#/data/0/id
  - stepId: listRecommendations
    description: >-
      Pull the AI-powered optimization recommendations generated for the
      captured queries in the session.
    operationId: listRecommendations
    parameters:
    - name: sessionId
      in: path
      value: $steps.createSession.outputs.sessionId
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      recommendationCount: $response.body#/total
      recommendations: $response.body#/data
  - stepId: stopSession
    description: >-
      Stop the recording session to finalize the captured query data for
      analysis. No further queries are captured after this.
    operationId: stopSession
    parameters:
    - name: sessionId
      in: path
      value: $steps.createSession.outputs.sessionId
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      finalStatus: $response.body#/status
  outputs:
    sessionId: $steps.createSession.outputs.sessionId
    queryCount: $steps.listSlowestQueries.outputs.queryCount
    recommendationCount: $steps.listRecommendations.outputs.recommendationCount
    finalStatus: $steps.stopSession.outputs.finalStatus

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/prisma-optimize-record-and-analyze-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.