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

# Get a single workflow

> Get a workflow: its current draft `plan`, trigger, published version, runtime input contract, and a `revision` token for optimistic concurrency on PATCH/publish. For WEBHOOK-triggered workflows the delivery credentials (`webhookUrl`, and `webhookSecret` for write-scoped keys) are issued on publish — a draft has none yet; publish first, then re-read.

Responses include direct Enginy app URLs when available. The response includes an `appUrl` to the workflow editor. MCP agents should return those URLs to users whenever they are present in the response.

    > **Required scope:** `WORKFLOWS_READ`
    >
    > **Rate limit:** 100 requests per minute



## OpenAPI

````yaml https://openapi.enginy.ai/definitions.json get /v1/workflow/{workflowId}
openapi: 3.1.0
info:
  title: Enginy API
  version: 1.0.0
  description: Public API for Enginy platform
servers:
  - url: https://openapi.enginy.ai
    description: Configured server
security: []
tags:
  - name: AI Variables
    description: >-
      Manage AI variables and discover the entity fields you can reference in
      prompts and entity requests.
  - name: Inbox
    description: >-
      Inbox endpoints for listing contact threads, reading thread messages,
      managing tags, and sending manual replies.
  - name: Workflows
    description: >-
      Build, validate, publish, run, and inspect advanced (graph) workflows,
      plus the block/condition catalog needed to author a workflow plan.
paths:
  /v1/workflow/{workflowId}:
    get:
      tags:
        - Workflows
      summary: Get a single workflow
      description: >-
        Get a workflow: its current draft `plan`, trigger, published version,
        runtime input contract, and a `revision` token for optimistic
        concurrency on PATCH/publish. For WEBHOOK-triggered workflows the
        delivery credentials (`webhookUrl`, and `webhookSecret` for write-scoped
        keys) are issued on publish — a draft has none yet; publish first, then
        re-read.


        Responses include direct Enginy app URLs when available. The response
        includes an `appUrl` to the workflow editor. MCP agents should return
        those URLs to users whenever they are present in the response.

            > **Required scope:** `WORKFLOWS_READ`
            >
            > **Rate limit:** 100 requests per minute
      parameters:
        - schema:
            type: string
          required: true
          name: workflowId
          in: path
      responses:
        '200':
          description: Workflow retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                      appUrl:
                        type: string
                        format: uri
                      name:
                        type: string
                      isPublished:
                        type: boolean
                      plan:
                        type: object
                        properties:
                          name:
                            type: string
                            minLength: 1
                            maxLength: 120
                          nodes:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    id:
                                      type: string
                                      minLength: 1
                                      maxLength: 128
                                      description: Stable node id (any non-empty string).
                                    kind:
                                      type: string
                                      enum:
                                        - BLOCK
                                    blockId:
                                      type: string
                                      minLength: 1
                                      description: >-
                                        Block id from `GET
                                        /v1/workflows/blocks`.
                                    inputs:
                                      type: object
                                      additionalProperties: {}
                                      description: Configured inputs for the block.
                                    next:
                                      type: array
                                      items:
                                        type: string
                                      maxItems: 2
                                      description: >-
                                        Outgoing node ids. One slot, or two
                                        `[approved, rejected]` for
                                        WAIT_FOR_APPROVAL. `""` = unwired.
                                  required:
                                    - id
                                    - kind
                                    - blockId
                                    - inputs
                                    - next
                                  additionalProperties: false
                                  title: BLOCK
                                - type: object
                                  properties:
                                    id:
                                      type: string
                                      minLength: 1
                                      maxLength: 128
                                    kind:
                                      type: string
                                      enum:
                                        - CONDITIONAL
                                    conditions:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: object
                                            properties:
                                              field:
                                                type: string
                                                description: >-
                                                  Condition field id/name. See `GET
                                                  /v1/workflows/condition-fields`.
                                              operator:
                                                type: string
                                                description: >-
                                                  Condition operator id. See `GET
                                                  /v1/workflows/condition-fields`.
                                              name:
                                                type: string
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                                  - type: boolean
                                                  - type: array
                                                    items:
                                                      type: string
                                                  - type: array
                                                    items:
                                                      type: number
                                                description: >-
                                                  Comparison value. Omitted for emptiness
                                                  operators (IS_EMPTY / IS_NOT_EMPTY).
                                            required:
                                              - field
                                              - operator
                                            additionalProperties: false
                                            title: FieldCondition
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - RANDOM_SPLIT
                                              percentage:
                                                type: integer
                                                minimum: 1
                                                maximum: 100
                                                description: >-
                                                  Share of entities (integer 1-100)
                                                  deterministically routed to this branch.
                                                  Sibling split percentages must sum to ≤
                                                  100; the remainder falls through to the
                                                  fallback branch.
                                              name:
                                                type: string
                                            required:
                                              - type
                                              - percentage
                                            additionalProperties: false
                                            title: RandomSplitCondition
                                      minItems: 1
                                      maxItems: 20
                                    fallbackName:
                                      type: string
                                      maxLength: 120
                                    next:
                                      type: array
                                      items:
                                        type: string
                                      description: >-
                                        One target per condition (in order) then
                                        the fallback LAST. Length =
                                        conditions.length + 1.
                                  required:
                                    - id
                                    - kind
                                    - conditions
                                    - next
                                  additionalProperties: false
                                  title: CONDITIONAL
                                - type: object
                                  properties:
                                    id:
                                      type: string
                                      minLength: 1
                                      maxLength: 128
                                    kind:
                                      type: string
                                      enum:
                                        - KING
                                    groupBy:
                                      type: string
                                      minLength: 1
                                    orderBy:
                                      type: number
                                    checkAnyDomain:
                                      type: boolean
                                    limit:
                                      type:
                                        - number
                                        - 'null'
                                    next:
                                      type: array
                                      items:
                                        type: string
                                      maxItems: 2
                                      description: '`[leftTargetId, rightTargetId]`.'
                                  required:
                                    - id
                                    - kind
                                    - groupBy
                                    - orderBy
                                    - next
                                  additionalProperties: false
                                  title: KING
                            maxItems: 60
                            description: At most 60 nodes; no cycles.
                        required:
                          - nodes
                        additionalProperties: false
                        title: WorkflowPlan
                        description: >-
                          The current draft plan reconstructed from the stored
                          draft dag.
                      publishedVersion:
                        type:
                          - object
                          - 'null'
                        properties:
                          id:
                            type: number
                          version:
                            type: number
                          publishedAt:
                            type: string
                            format: date-time
                        required:
                          - id
                          - version
                          - publishedAt
                        description: >-
                          The currently published version, or null if never
                          published.
                      trigger:
                        type: object
                        properties:
                          type:
                            type: string
                            description: Trigger type.
                          webhookUrl:
                            type: string
                            description: 'WEBHOOK triggers only: the live delivery URL.'
                          webhookSecret:
                            type: string
                            description: >-
                              WEBHOOK triggers only, and only when the API key
                              has the workflows-write scope: the signing secret
                              to send as the `x-enginy-webhook-secret` header
                              when delivering to `webhookUrl`.
                          webhookInputs:
                            type: array
                            items:
                              type: object
                              properties:
                                key:
                                  type: string
                                type:
                                  type: string
                              required:
                                - key
                                - type
                            description: 'WEBHOOK triggers only: declared inputs.'
                        required:
                          - type
                        title: WorkflowTriggerResponse
                      maxCreditsPerRun:
                        type:
                          - number
                          - 'null'
                      runtimeInputContract:
                        type: object
                        additionalProperties: {}
                        description: >-
                          The run input contract (status EMPTY | SUPPORTED |
                          UNSUPPORTED) derived from the entry step.
                      revision:
                        type: string
                        description: >-
                          Optimistic-concurrency token (ISO updatedAt) for
                          PATCH/publish.
                    required:
                      - id
                      - appUrl
                      - name
                      - isPublished
                      - plan
                      - publishedVersion
                      - trigger
                      - maxCreditsPerRun
                      - runtimeInputContract
                      - revision
                required:
                  - status
                  - message
                  - data
        '400':
          description: The workflow ID is not a positive integer.
        '403':
          description: >-
            Advanced workflows are not enabled for this workspace. Ask your
            workspace admin to enable the feature.
        '404':
          description: Workflow not found or not accessible.
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````