> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Protocol Graph Endpoint

> Compile a protocol and return its flowchart graph.

Returns nodes in document order plus guarded edges (sequential flow,
repeat-block loop-backs, and goto jumps) and step-block groupings, for
client-side flowchart rendering. Authenticated — compilation is CPU-bound,
so this is not offered to anonymous callers.

Parameters
----------
body : ProtocolGraphRequest
    Request containing the protocol to compile.
_auth : tuple[str, str, AsyncClient]
    The caller's identity; required only as an auth gate, never used.

Returns
-------
dict
    ``{"nodes": [...], "edges": [...], "blocks": [...]}``.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /protocols/graph
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /protocols/graph:
    post:
      tags:
        - protocols
      summary: Protocol Graph Endpoint
      description: >-
        Compile a protocol and return its flowchart graph.


        Returns nodes in document order plus guarded edges (sequential flow,

        repeat-block loop-backs, and goto jumps) and step-block groupings, for

        client-side flowchart rendering. Authenticated — compilation is
        CPU-bound,

        so this is not offered to anonymous callers.


        Parameters

        ----------

        body : ProtocolGraphRequest
            Request containing the protocol to compile.
        _auth : tuple[str, str, AsyncClient]
            The caller's identity; required only as an auth gate, never used.

        Returns

        -------

        dict
            ``{"nodes": [...], "edges": [...], "blocks": [...]}``.
      operationId: protocol_graph_endpoint_protocols_graph_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProtocolGraphRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Protocol Graph Endpoint Protocols Graph Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ProtocolGraphRequest:
      properties:
        protocol:
          anyOf:
            - additionalProperties: true
              type: object
            - type: string
          title: Protocol
          description: UCP as a dict or YAML string.
      type: object
      required:
        - protocol
      title: ProtocolGraphRequest
      description: Request body for building a protocol flowchart graph.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````