> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a workflow

> Retrieves a specific workflow by subject



## OpenAPI

````yaml /api-reference/endpoint/hub-flows/openapi.json get /hub/workflows/{collection_topic}/{flow_topic}
openapi: 3.0.0
info:
  title: quiva.ai Gateway
  description: API for managing collections, nodes, and workflows in quiva.ai Hub
  version: 0.1.0
  contact:
    name: quiva.ai Support
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Collections
    description: Operations related to collections
  - name: Nodes
    description: Operations related to nodes
  - name: Workflows
    description: Operations related to workflows
  - name: Oauth
    description: Oauth configurations and connections
paths:
  /hub/workflows/{collection_topic}/{flow_topic}:
    parameters:
      - $ref: '#/components/parameters/collectionTopic'
      - $ref: '#/components/parameters/flowTopic'
    get:
      tags:
        - Workflows
      summary: Get a workflow
      description: Retrieves a specific workflow by subject
      operationId: getWorkflow
      parameters:
        - $ref: '#/components/parameters/queryDraftFlag'
      responses:
        '200':
          description: Workflow retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWorkflowResponse'
              examples:
                simpleWorkflow:
                  summary: Simple workflow with map and function nodes
                  value:
                    subject: ms.hub.config.workflow.1234567890.98765432
                    name: MyWorkflow
                    description: Workflow description
                    config:
                      nodes:
                        - data:
                            id: start
                            name: Start
                            node_type: map
                            payload:
                              message: Start of workflow
                        - data:
                            id: process
                            name: Process
                            node_type: function
                            subject: quiva-function.process-function
                            payload:
                              input: '{start}'
                      edges:
                        - source: start
                          target: process
                          id: edge1
                      result: process
                    modified: 1651395678
                draftWorkflow:
                  summary: Draft workflow with static data
                  value:
                    subject: ms.hub.config.workflow.draft.1234567890.55555555
                    name: DraftWorkflow
                    description: Work in progress workflow
                    config:
                      nodes:
                        - data:
                            id: init
                            name: Initialize
                            node_type: map
                            payload:
                              config: '{static.defaultConfig}'
                              input: '{trigger}'
                      edges: []
                      static:
                        defaultConfig:
                          timeout: 30000
                          retries: 3
                      result: init
                    modified: 1651400000
                complexWorkflow:
                  summary: Complex workflow with multiple node types
                  value:
                    subject: ms.hub.config.workflow.1234567890.77777777
                    name: OrderProcessingWorkflow
                    description: Complete order processing pipeline
                    config:
                      nodes:
                        - data:
                            id: validate_input
                            name: Validate Input
                            node_type: function
                            subject: quiva-function.validate-order
                            payload:
                              order: '{trigger.order}'
                            options:
                              timeout: 5000
                        - data:
                            id: check_inventory
                            name: Check Inventory
                            node_type: function
                            subject: quiva-function.check-stock
                            payload:
                              items: '{validate_input.items}'
                        - data:
                            id: has_stock
                            name: Has Stock?
                            node_type: condition
                            payload:
                              condition: '{check_inventory.available} == true'
                        - data:
                            id: process_order
                            name: Process Order
                            node_type: flow
                            subject: ms.hub.config.workflow.1234567890.order-processor
                            await: true
                            payload:
                              order: '{validate_input}'
                        - data:
                            id: backorder
                            name: Create Backorder
                            node_type: function
                            subject: quiva-function.create-backorder
                            payload:
                              order: '{validate_input}'
                        - data:
                            id: notify_customer
                            name: Notify Customer
                            node_type: integration
                            subject: email.send
                            payload:
                              to: '{trigger.customer_email}'
                              template: order_confirmation
                              data: '{process_order}'
                      edges:
                        - source: validate_input
                          target: check_inventory
                          id: e1
                        - source: check_inventory
                          target: has_stock
                          id: e2
                        - source: has_stock
                          target: process_order
                          id: e3
                          sourceHandle: 'true'
                        - source: has_stock
                          target: backorder
                          id: e4
                          sourceHandle: 'false'
                        - source: process_order
                          target: notify_customer
                          id: e5
                      result: '{has_stock} ? {notify_customer} : {backorder}'
                    modified: 1651450000
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                InvalidSubject:
                  value:
                    error: invalid subject
components:
  parameters:
    collectionTopic:
      name: collection_topic
      in: path
      description: >-
        The topic is a hash of the name that was used when a collection was
        created
      required: true
      schema:
        type: string
      example: '1234567890'
    flowTopic:
      name: flow_topic
      in: path
      description: Flow topic - hash of the names the node was created with
      required: true
      schema:
        type: string
      example: '21312322'
    queryDraftFlag:
      name: draft
      in: query
      description: Draft flag
      required: false
      schema:
        type: boolean
      example: true
  schemas:
    GetWorkflowResponse:
      type: object
      properties:
        subject:
          type: string
          description: Subject identifier for the workflow
        name:
          type: string
          description: Name of the workflow
        description:
          type: string
          description: Description of the workflow
        config:
          $ref: '#/components/schemas/WorkflowConfig'
        modified:
          $ref: '#/components/schemas/Modified'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
    WorkflowConfig:
      type: object
      properties:
        nodes:
          type: array
          items:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/NodeData'
              position:
                type: object
                description: Visual position of the node in the workflow editor
              style:
                type: object
                description: Visual styling of the node
          description: Array of nodes in the workflow
        edges:
          type: array
          items:
            $ref: '#/components/schemas/Edge'
          description: Array of edges connecting nodes in the workflow
        static:
          type: object
          description: Static data available to all nodes in the workflow
        result:
          type: string
          description: Expression to determine the final result of the workflow
        options:
          type: object
          properties:
            run_type:
              type: string
              enum:
                - debounced
                - ordered
              description: Execution mode for the workflow
            order_on:
              type: string
              description: Field to order workflow executions by
            debounce_on:
              type: string
              description: Field to debounce workflow executions on
            debounce_time:
              type: integer
              description: Debounce time in milliseconds
            debounce_max:
              type: integer
              description: Maximum debounce time in milliseconds
    Modified:
      type: integer
      description: Timestamp of last modification
    NodeData:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the node
        name:
          type: string
          description: Name of the node
        description:
          type: string
          description: Description of the node
        node_type:
          type: string
          enum:
            - function
            - flow
            - condition
            - map
            - eval
            - integration
          description: >-
            ## Node Types


            ### 1. `function`

            **Definition**:  

            A **Hydra function node** used to provide a *subject* or perform a
            custom computation. It encapsulates reusable logic defined within
            the Hydra platform.


            ### 2. `flow`

            **Definition**:  

            A node that **invokes another flow**, either **synchronously** or
            **asynchronously**, enabling flow modularization and reuse.


            ### 3. `condition`

            **Definition**:  

            A **branching node** that evaluates a condition to determine the
            **flow of execution**, similar to `if`/`else` logic in programming.


            ### 4. `map`

            **Definition**:  

            A **data transformation node** used to **reshape or remap the
            payload**, allowing the flow to adapt the structure of data as it
            progresses.


            ### 5. `eval`

            **Definition**:  

            Executes **simple JavaScript code** to dynamically **evaluate
            expressions**, perform calculations, or manipulate data inline
            within the flow.


            ### 6. `integration`

            **Definition**:  

            Similar to a `function` node, but specifically tied to **predefined
            APIs**. It uses an HTTP-like interface and references **a known set
            of external services** managed by the platform.
        subject:
          type: string
          description: Subject identifier for function or flow node types
        payload:
          description: Payload data for the node
        response_map:
          description: Mapping for response transformation
        options:
          $ref: '#/components/schemas/NodeOptions'
        await:
          type: boolean
          description: Whether to wait for completion nad return the result
    Edge:
      type: object
      required:
        - source
        - target
      properties:
        source:
          type: string
          description: ID of the source node
        target:
          type: string
          description: ID of the target node
        id:
          type: string
          description: Optional unique identifier for the edge
        sourceHandle:
          type: string
          description: Optional source handle identifier
        targetHandle:
          type: string
          description: Optional target handle identifier
    NodeOptions:
      type: object
      description: Node execution options
      properties:
        flat_map:
          type: boolean
          description: Whether to flatten the response
        backoff_ms:
          type: integer
          format: int64
          description: >-
            Backoff duration in milliseconds - how long to wait before next
            attempt. Applies to function and flow nodes only.
        timeout:
          type: integer
          format: int64
          description: >-
            Timeout duration in milliseconds. Applies to function and flow nodes
            only.
        attempts:
          type: integer
          format: int32
          description: Number of retry attempts. Applies to function and flow nodes only.
        ignore_response_codes:
          type: array
          items:
            type: integer
          description: >-
            List of HTTP response codes to ignore. Applies to function nodes
            only.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````