Prefect · Capability

Prefect Cloud API — Flows

Prefect Cloud API — Flows. 11 operations. Lead operation: Create Flow. Self-contained Naftiko capability covering one Prefect business surface.

Run with Naftiko PrefectFlows

What You Can Do

POST
Createflowapiaccountsaccountidworkspacesworkspaceidflowspost — Create Flow
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows
POST
Bulkdeleteflowsapiaccountsaccountidworkspacesworkspaceidflowsbulkdeletepost — Bulk Delete Flows
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/bulk-delete
POST
Countflowsapiaccountsaccountidworkspacesworkspaceidflowscountpost — Count Flows
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/count
POST
Readflowsapiaccountsaccountidworkspacesworkspaceidflowsfilterpost — Read Flows
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/filter
GET
Readflowbynameapiaccountsaccountidworkspacesworkspaceidflowsnamenameget — Read Flow By Name
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/name/{name}
POST
Paginateflowsapiaccountsaccountidworkspacesworkspaceidflowspaginatepost — Paginate Flows
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/paginate
PATCH
Updateflowapiaccountsaccountidworkspacesworkspaceidflowsidpatch — Update Flow
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/{id}
GET
Readflowapiaccountsaccountidworkspacesworkspaceidflowsidget — Read Flow
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/{id}
DELETE
Deleteflowapiaccountsaccountidworkspacesworkspaceidflowsiddelete — Delete Flow
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/{id}
POST
Countdeploymentsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowscountdeploymentspost — Count Deployments By Flow
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/flows/count-deployments
POST
Nextrunsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowsnextrunspost — Next Runs By Flow
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/flows/next-runs

MCP Tools

create-flow

Create Flow

bulk-delete-flows

Bulk Delete Flows

count-flows

Count Flows

read-flows

Read Flows

read-flow-name

Read Flow By Name

read-only idempotent
paginate-flows

Paginate Flows

update-flow

Update Flow

idempotent
read-flow

Read Flow

read-only idempotent
delete-flow

Delete Flow

idempotent
count-deployments-flow

Count Deployments By Flow

next-runs-flow

Next Runs By Flow

Capability Spec

prefect-flows.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Prefect Cloud API — Flows
  description: 'Prefect Cloud API — Flows. 11 operations. Lead operation: Create Flow. Self-contained Naftiko capability covering
    one Prefect business surface.'
  tags:
  - Prefect
  - Flows
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PREFECT_API_KEY: PREFECT_API_KEY
capability:
  consumes:
  - type: http
    namespace: prefect-flows
    baseUri: ''
    description: Prefect Cloud API — Flows business capability. Self-contained, no shared references.
    resources:
    - name: api-accounts-account_id-workspaces-workspace_id-flows
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/
      operations:
      - name: createflowapiaccountsaccountidworkspacesworkspaceidflowspost
        method: POST
        description: Create Flow
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-accounts-account_id-workspaces-workspace_id-flows-bulk_delete
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/bulk_delete
      operations:
      - name: bulkdeleteflowsapiaccountsaccountidworkspacesworkspaceidflowsbulkdeletepost
        method: POST
        description: Bulk Delete Flows
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-accounts-account_id-workspaces-workspace_id-flows-count
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/count
      operations:
      - name: countflowsapiaccountsaccountidworkspacesworkspaceidflowscountpost
        method: POST
        description: Count Flows
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-flows-filter
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/filter
      operations:
      - name: readflowsapiaccountsaccountidworkspacesworkspaceidflowsfilterpost
        method: POST
        description: Read Flows
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-flows-name-name
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/name/{name}
      operations:
      - name: readflowbynameapiaccountsaccountidworkspacesworkspaceidflowsnamenameget
        method: GET
        description: Read Flow By Name
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: name
          in: path
          type: string
          description: The name of the flow
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-flows-paginate
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/paginate
      operations:
      - name: paginateflowsapiaccountsaccountidworkspacesworkspaceidflowspaginatepost
        method: POST
        description: Paginate Flows
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-flows-id
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/flows/{id}
      operations:
      - name: updateflowapiaccountsaccountidworkspacesworkspaceidflowsidpatch
        method: PATCH
        description: Update Flow
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The flow id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: readflowapiaccountsaccountidworkspacesworkspaceidflowsidget
        method: GET
        description: Read Flow
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The flow id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
      - name: deleteflowapiaccountsaccountidworkspacesworkspaceidflowsiddelete
        method: DELETE
        description: Delete Flow
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The flow id
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-ui-flows-count-deployments
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/ui/flows/count-deployments
      operations:
      - name: countdeploymentsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowscountdeploymentspost
        method: POST
        description: Count Deployments By Flow
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-accounts-account_id-workspaces-workspace_id-ui-flows-next-runs
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/ui/flows/next-runs
      operations:
      - name: nextrunsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowsnextrunspost
        method: POST
        description: Next Runs By Flow
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
  exposes:
  - type: rest
    namespace: prefect-flows-rest
    port: 8080
    description: REST adapter for Prefect Cloud API — Flows. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows
      name: api-accounts-account-id-workspaces-workspace-id-flows
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows.
      operations:
      - method: POST
        name: createflowapiaccountsaccountidworkspacesworkspaceidflowspost
        description: Create Flow
        call: prefect-flows.createflowapiaccountsaccountidworkspacesworkspaceidflowspost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/bulk-delete
      name: api-accounts-account-id-workspaces-workspace-id-flows-bulk-delete
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows-bulk_delete.
      operations:
      - method: POST
        name: bulkdeleteflowsapiaccountsaccountidworkspacesworkspaceidflowsbulkdeletepost
        description: Bulk Delete Flows
        call: prefect-flows.bulkdeleteflowsapiaccountsaccountidworkspacesworkspaceidflowsbulkdeletepost
        with:
          workspace_id: rest.workspace_id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/count
      name: api-accounts-account-id-workspaces-workspace-id-flows-count
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows-count.
      operations:
      - method: POST
        name: countflowsapiaccountsaccountidworkspacesworkspaceidflowscountpost
        description: Count Flows
        call: prefect-flows.countflowsapiaccountsaccountidworkspacesworkspaceidflowscountpost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/filter
      name: api-accounts-account-id-workspaces-workspace-id-flows-filter
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows-filter.
      operations:
      - method: POST
        name: readflowsapiaccountsaccountidworkspacesworkspaceidflowsfilterpost
        description: Read Flows
        call: prefect-flows.readflowsapiaccountsaccountidworkspacesworkspaceidflowsfilterpost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/name/{name}
      name: api-accounts-account-id-workspaces-workspace-id-flows-name-name
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows-name-name.
      operations:
      - method: GET
        name: readflowbynameapiaccountsaccountidworkspacesworkspaceidflowsnamenameget
        description: Read Flow By Name
        call: prefect-flows.readflowbynameapiaccountsaccountidworkspacesworkspaceidflowsnamenameget
        with:
          workspace_id: rest.workspace_id
          name: rest.name
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/paginate
      name: api-accounts-account-id-workspaces-workspace-id-flows-paginate
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows-paginate.
      operations:
      - method: POST
        name: paginateflowsapiaccountsaccountidworkspacesworkspaceidflowspaginatepost
        description: Paginate Flows
        call: prefect-flows.paginateflowsapiaccountsaccountidworkspacesworkspaceidflowspaginatepost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/flows/{id}
      name: api-accounts-account-id-workspaces-workspace-id-flows-id
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-flows-id.
      operations:
      - method: PATCH
        name: updateflowapiaccountsaccountidworkspacesworkspaceidflowsidpatch
        description: Update Flow
        call: prefect-flows.updateflowapiaccountsaccountidworkspacesworkspaceidflowsidpatch
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: readflowapiaccountsaccountidworkspacesworkspaceidflowsidget
        description: Read Flow
        call: prefect-flows.readflowapiaccountsaccountidworkspacesworkspaceidflowsidget
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteflowapiaccountsaccountidworkspacesworkspaceidflowsiddelete
        description: Delete Flow
        call: prefect-flows.deleteflowapiaccountsaccountidworkspacesworkspaceidflowsiddelete
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          id: rest.id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/flows/count-deployments
      name: api-accounts-account-id-workspaces-workspace-id-ui-flows-count-deployments
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-ui-flows-count-deployments.
      operations:
      - method: POST
        name: countdeploymentsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowscountdeploymentspost
        description: Count Deployments By Flow
        call: prefect-flows.countdeploymentsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowscountdeploymentspost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/flows/next-runs
      name: api-accounts-account-id-workspaces-workspace-id-ui-flows-next-runs
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-ui-flows-next-runs.
      operations:
      - method: POST
        name: nextrunsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowsnextrunspost
        description: Next Runs By Flow
        call: prefect-flows.nextrunsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowsnextrunspost
        with:
          workspace_id: rest.workspace_id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: prefect-flows-mcp
    port: 9090
    transport: http
    description: MCP adapter for Prefect Cloud API — Flows. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: create-flow
      description: Create Flow
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.createflowapiaccountsaccountidworkspacesworkspaceidflowspost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: bulk-delete-flows
      description: Bulk Delete Flows
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.bulkdeleteflowsapiaccountsaccountidworkspacesworkspaceidflowsbulkdeletepost
      with:
        workspace_id: tools.workspace_id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: count-flows
      description: Count Flows
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.countflowsapiaccountsaccountidworkspacesworkspaceidflowscountpost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: read-flows
      description: Read Flows
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.readflowsapiaccountsaccountidworkspacesworkspaceidflowsfilterpost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: read-flow-name
      description: Read Flow By Name
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-flows.readflowbynameapiaccountsaccountidworkspacesworkspaceidflowsnamenameget
      with:
        workspace_id: tools.workspace_id
        name: tools.name
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: paginate-flows
      description: Paginate Flows
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.paginateflowsapiaccountsaccountidworkspacesworkspaceidflowspaginatepost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: update-flow
      description: Update Flow
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: prefect-flows.updateflowapiaccountsaccountidworkspacesworkspaceidflowsidpatch
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: read-flow
      description: Read Flow
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-flows.readflowapiaccountsaccountidworkspacesworkspaceidflowsidget
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-flow
      description: Delete Flow
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: prefect-flows.deleteflowapiaccountsaccountidworkspacesworkspaceidflowsiddelete
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        id: tools.id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: count-deployments-flow
      description: Count Deployments By Flow
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.countdeploymentsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowscountdeploymentspost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: next-runs-flow
      description: Next Runs By Flow
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-flows.nextrunsbyflowapiaccountsaccountidworkspacesworkspaceiduiflowsnextrunspost
      with:
        workspace_id: tools.workspace_id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.