> ## 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.

# Update multiple nodes

> Updates multiple existing nodes in a single request



## OpenAPI

````yaml /api-reference/endpoint/hub-flows/openapi.json patch /hub/nodes/batch
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/nodes/batch:
    patch:
      tags:
        - Nodes
      summary: Update multiple nodes
      description: Updates multiple existing nodes in a single request
      operationId: updateMultipleNodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMultiNodeRequest'
            examples:
              UpdateMultipleFunctionNodes:
                summary: Update multiple function nodes
                value:
                  - subject: ms.hub.config.node.805092869.98765432
                    data:
                      name: ProcessPaymentV2
                      node_type: function
                      subject: quiva-function.stripe-charge-v2
                      payload:
                        amount: '{{trigger.amount}}'
                        currency: '{{trigger.currency}}'
                      options:
                        timeout: 45000
                  - subject: ms.hub.config.node.805092869.11223344
                    data:
                      name: ValidateCardV2
                      node_type: function
                      subject: quiva-function.card-validator-v2
                      payload:
                        card_number: '{{trigger.card}}'
                        cvv: '{{trigger.cvv}}'
              UpdateMixedNodeTypes:
                summary: Update nodes of different types
                value:
                  - subject: ms.hub.config.node.805092869.98765432
                    data:
                      name: ProcessPayment
                      node_type: function
                      subject: quiva-function.stripe-charge
                      payload:
                        amount: '{{trigger.amount}}'
                  - subject: ms.hub.config.node.1025086208.55667788
                    data:
                      name: TransformOrder
                      node_type: map
                      payload:
                        order_id: '{{trigger.id}}'
                        status: processed
                  - subject: ms.hub.config.node.805092869.33445566
                    data:
                      name: CheckThreshold
                      node_type: condition
                      payload:
                        condition: '{{trigger.total > 500}}'
              ArchiveMultipleNodes:
                summary: Archive multiple deprecated nodes
                value:
                  - subject: ms.hub.config.node.805092869.oldnode1
                    data:
                      name: DeprecatedNode1
                      node_type: function
                      subject: quiva-function.old-function
                    archived: true
                  - subject: ms.hub.config.node.805092869.oldnode2
                    data:
                      name: DeprecatedNode2
                      node_type: map
                      payload: {}
                    archived: true
      responses:
        '200':
          description: All nodes updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMultiNodeResponse'
              examples:
                AllSuccess:
                  summary: All nodes updated successfully
                  value:
                    - node:
                        subject: ms.hub.config.node.805092869.98765432
                        data:
                          name: ProcessPaymentV2
                          node_type: function
                          subject: quiva-function.stripe-charge-v2
                          payload:
                            amount: '{{trigger.amount}}'
                      result: success
                    - node:
                        subject: ms.hub.config.node.805092869.11223344
                        data:
                          name: ValidateCardV2
                          node_type: function
                          subject: quiva-function.card-validator-v2
                          payload:
                            card_number: '{{trigger.card}}'
                      result: success
        '400':
          description: Some nodes failed to update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMultiNodeErrorResponse'
              example:
                body:
                  - node:
                      subject: ms.hub.config.node.1234567890.98765432
                      data:
                        name: UpdatedNode1
                        node_type: function
                        subject: quiva-function.function1
                        payload:
                          param1: value1
                    result: succes
                  - node:
                      subject: ms.hub.config.node.1234567890.12345678
                      data:
                        name: UpdatedNode2
                        node_type: function
                        subject: quiva-function.non-existing-function
                        payload:
                          param2: value2
                    result: 'error: function not found'
                error: some nodes failed to upsert
components:
  schemas:
    UpdateMultiNodeRequest:
      type: array
      items:
        $ref: '#/components/schemas/UpdateNodeRequest'
    UpdateMultiNodeResponse:
      type: array
      items:
        type: object
        properties:
          node:
            $ref: '#/components/schemas/UpdateNodeRequest'
          result:
            type: string
            description: Result of the update operation
    UpdateMultiNodeErrorResponse:
      type: object
      properties:
        body:
          type: array
          items:
            type: object
            properties:
              node:
                $ref: '#/components/schemas/UpdateNodeRequest'
              result:
                type: string
                description: Result of the update operation with error messages
        error:
          type: string
          description: General error message
    UpdateNodeRequest:
      type: object
      required:
        - subject
        - data
      properties:
        data:
          $ref: '#/components/schemas/NodeData'
        archived:
          type: boolean
          description: Whether the node is archived
    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
    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

````