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

# Retrieve a template

> GET /v1/workflows/templates/{slug}

The full template, including its `definition` and a `sample_input` you can run it with unchanged.


## OpenAPI

````yaml openapi.json GET /v1/workflows/templates/{slug}
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/workflows/templates/{slug}:
    get:
      tags:
        - Workflows
      summary: Get a single workflow template (full, with definition + sample_input)
      description: >-
        The template plus everything needed to run it: `definition` can be sent
        straight through as the `definition` of `POST /v1/workflows/runs` or
        `POST /v1/workflows`, `sample_input` is a working `input` for it, and
        `inputs` is its declared input contract. Free, and it copies nothing
        into your workspace — creating a workflow from a template is a separate
        `POST /v1/workflows` you make yourself. A HIDDEN template still answers
        200, with `unavailable.reason` and NO
        `definition`/`sample_input`/`inputs`: check for `unavailable` before
        reading them. The definition is returned exactly as it was seeded — it
        is not re-validated on this read, so a template can name a model that is
        no longer served (which is usually why one is hidden).
      operationId: PipelineTemplatesController_getBySlug[0]
      parameters:
        - name: slug
          required: true
          in: path
          description: >-
            Template slug, as returned in the list. Max 120 characters — a
            longer one is answered 404 without a lookup.
          schema:
            example: weekly-report
            type: string
      responses:
        '200':
          description: >-
            The template. Carries either `definition`/`sample_input`/`inputs`,
            or `unavailable` — never both.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetailDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: No template with this slug (`template_not_found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    TemplateDetailDto:
      type: object
      properties:
        slug:
          type: string
          description: >-
            Stable identifier, and the path segment for the detail route. Max
            120 characters.
          example: weekly-report
        title:
          type: string
          description: Display title. Max 200 characters.
          example: Weekly report
        description:
          type: string
          description: Catalog description. Always a string — the column is NOT NULL.
          example: Summarise a week of notes and render a PDF.
        category:
          type: string
          nullable: true
          description: >-
            Catalog category, or null when the template is uncategorised. The
            `category` filter matches this exactly.
          example: reporting
        tags:
          description: >-
            Free-form tags. The `tag` filter matches a template whose array
            CONTAINS the given tag.
          example:
            - documents
            - summarisation
          type: array
          items:
            type: string
        step_types_used:
          description: >-
            The step types the template's definition uses, denormalised at seed
            time for filtering and display.
          example:
            - model
            - transform
          type: array
          items:
            type: string
        thumbnail_url:
          type: string
          nullable: true
          description: Preview image URL, or null when the template has none.
          example: null
        created_at:
          type: string
          description: >-
            ISO-8601 creation timestamp. The list is ordered by this, OLDEST
            first.
          example: '2026-02-11T08:00:00.000Z'
        definition:
          type: object
          additionalProperties: true
          description: >-
            The template's workflow definition, ready to send as the
            `definition` of a run. Unmodelled here — its shape is the Zod schema
            in `schemas/pipeline-definition.schema.ts`. Validated when the
            template was seeded, not on this read. Absent when `unavailable` is
            present.
        sample_input:
          type: object
          additionalProperties: true
          description: >-
            An example `input` object for this template. `{}` when the template
            declares none. Absent when `unavailable` is present.
        inputs:
          description: >-
            The declared run inputs read out of `definition.inputs`. `[]` for a
            legacy template that predates the input contract. Absent when
            `unavailable` is present.
          type: array
          items:
            $ref: '#/components/schemas/InputDeclarationDto'
        unavailable:
          description: >-
            Present only when the template is hidden. Its presence is what tells
            you `definition` was withheld deliberately rather than being
            missing.
          allOf:
            - $ref: '#/components/schemas/TemplateUnavailableDto'
      required:
        - slug
        - title
        - description
        - category
        - tags
        - step_types_used
        - thumbnail_url
        - created_at
    ErrorResponseDto:
      type: object
      properties:
        error:
          description: >-
            The error envelope. Every non-2xx response from this API has this
            shape, so a client can parse failures without branching on the
            endpoint.
          allOf:
            - $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    InputDeclarationDto:
      type: object
      properties:
        name:
          type: string
          description: Input name. Referenced inside the definition as `${input.<name>}`.
          example: topic
        type:
          type: string
          enum:
            - text
            - number
            - boolean
            - json
            - image
            - video
            - audio
            - file
          description: >-
            Declared value type. `image`, `video`, `audio` and `file` are plain
            strings carrying either a URL or a workspace-scoped file id.
          example: text
        required:
          type: boolean
          description: >-
            Whether a run must supply this input. ABSENT MEANS REQUIRED — the
            validator treats a missing `required` as `true`, it does not default
            to optional.
          example: true
        default:
          description: >-
            The value a run receives when it OMITS this input
            (`applyInputDefaults`). Part of the run contract: a caller that
            sends nothing gets this.
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        savedValue:
          description: >-
            The value the EDITOR last saved for this input, so a workflow
            reopens showing what its author typed. NOT a default — nothing on
            the run path reads it, and a `required` input may carry one.
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        label:
          type: string
          description: Display label for editors. Not read by the engine.
          example: Topic
        description:
          type: string
          description: Display help text for editors. Not read by the engine.
      required:
        - name
        - type
    TemplateUnavailableDto:
      type: object
      properties:
        reason:
          type: string
          description: >-
            Operator-supplied reason. Empty string when the row was hidden
            without one.
          example: references a model that is no longer served
      required:
        - reason
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: string
          example: model_not_found
          nullable: true
          description: >-
            Stable machine-readable error code. Branch on this rather than on
            `message`, which is prose and may be reworded.
        param:
          type: string
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error. `null` when
            the error is not attributable to one field.
        job_id:
          type: string
          example: job_1hR9xTPZqK4mVLc2nJ7fY5wB
          description: >-
            Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present
            on the few errors that carry one. When it is here, this is not a
            failure to retry — retrying pays twice. Collect the result from `GET
            /v1/images/jobs/{job_id}`, which serves every durable media job
            regardless of modality.


            Two situations produce it. A media generation that outruns the
            gateway's wait answers `504` with `code: "job_timeout"` and keeps
            working. And `POST /v1/audio/speech` answers **500** with `code:
            "artifact_unreadable"` when the speech was generated and settled but
            could not be read back from storage — the audio exists and is paid
            for; only this response failed.


            Declared here rather than per-endpoint because the rule is about the
            FIELD, not the status: if this is present, there is a paid-for
            result to collect. It was undeclared until now, so a client
            generated from this document could not see the one field that
            recovers money already spent.
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````