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

# Update workflow component

> Updates a workflow component's `component_data` (nodes, edges, vault schema). Creates a **new version** of the component.

**Propagation**: By default, all workflows in the workspace that contain instances of this component are automatically updated to reflect the new template. Set `propagate: false` to skip propagation.

**Multiple instances per workflow** are supported — each paste-instance is tracked by its own `source_component_instance_id` and updated independently.

**`sourceWorkflowId` (advanced)**: Skips propagation for the entire workflow with the given id. The frontend uses this when a single instance was edited locally and saved back to the library — the editor already reflects the new structure, so re-propagating to the same workflow would be redundant. **Caveat for multi-instance workflows**: the skip is workflow-scoped, not instance-scoped. If the source workflow contains other instances of this component that were not part of the local edit, those instances will not be updated and will go stale. Pass `sourceWorkflowId` only when the source workflow contains exactly one instance of the component, or when every instance in it is already in sync with the new `componentData`. If unsure, omit `sourceWorkflowId` and let propagation update everything.

**Typical usage**:
1. `GET /workflow-components/{component_id}/usage` to see affected workflows
2. `GET /workflow-components/{component_id}` to fetch the current component
3. Modify `componentData` as needed
4. `PUT /workflow-components/{component_id}` to save and propagate



## OpenAPI

````yaml workflow-api/workflow-api.yaml put /workflow-components/{component_id}
openapi: 3.0.0
info:
  title: Workflow API
  version: 1.0.0
  description: API for managing workflows and their metadata
servers:
  - url: https://api.cloudcruise.com
    description: CloudCruise Platform Production API Server
security:
  - AuthScheme: []
paths:
  /workflow-components/{component_id}:
    put:
      summary: Update workflow component
      description: >-
        Updates a workflow component's `component_data` (nodes, edges, vault
        schema). Creates a **new version** of the component.


        **Propagation**: By default, all workflows in the workspace that contain
        instances of this component are automatically updated to reflect the new
        template. Set `propagate: false` to skip propagation.


        **Multiple instances per workflow** are supported — each paste-instance
        is tracked by its own `source_component_instance_id` and updated
        independently.


        **`sourceWorkflowId` (advanced)**: Skips propagation for the entire
        workflow with the given id. The frontend uses this when a single
        instance was edited locally and saved back to the library — the editor
        already reflects the new structure, so re-propagating to the same
        workflow would be redundant. **Caveat for multi-instance workflows**:
        the skip is workflow-scoped, not instance-scoped. If the source workflow
        contains other instances of this component that were not part of the
        local edit, those instances will not be updated and will go stale. Pass
        `sourceWorkflowId` only when the source workflow contains exactly one
        instance of the component, or when every instance in it is already in
        sync with the new `componentData`. If unsure, omit `sourceWorkflowId`
        and let propagation update everything.


        **Typical usage**:

        1. `GET /workflow-components/{component_id}/usage` to see affected
        workflows

        2. `GET /workflow-components/{component_id}` to fetch the current
        component

        3. Modify `componentData` as needed

        4. `PUT /workflow-components/{component_id}` to save and propagate
      operationId: updateWorkflowComponent
      parameters:
        - name: component_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the workflow component to update
        - name: cc-key
          in: header
          required: false
          schema:
            type: string
          description: CloudCruise API key for authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowComponentUpdatePayload'
      responses:
        '200':
          description: Component updated. Returns the new version number.
          content:
            application/json:
              schema:
                type: object
                properties:
                  version_number:
                    type: integer
                    minimum: 1
                    description: The version number of the newly-created component version
                required:
                  - version_number
        '400':
          description: >-
            Bad request - Invalid `component_id`, missing `componentData`, or
            invalid `versionNote`/`sourceWorkflowId`
        '401':
          description: Unauthorized - Invalid or missing authentication
        '404':
          description: Component not found
        '500':
          description: Internal server error
components:
  schemas:
    WorkflowComponentUpdatePayload:
      type: object
      description: >-
        Payload for updating a workflow component's data. Creates a new version
        and (by default) propagates changes to every workflow in the workspace
        that contains instances of this component.
      properties:
        componentData:
          $ref: '#/components/schemas/ComponentData'
        versionNote:
          type: string
          maxLength: 500
          nullable: true
          description: Optional note describing what changed in this version
          example: Fixed login XPath
        propagate:
          type: boolean
          default: true
          description: >-
            If true (default), updates every workflow in the workspace that
            embeds this component to reflect the new structure. Set to false to
            save the new version without touching any workflows.
        sourceWorkflowId:
          type: string
          format: uuid
          nullable: true
          description: >-
            If the update originates from a workflow editor, pass that
            workflow's id here to skip it during propagation. **Workflow-scoped,
            not instance-scoped** — the entire workflow is skipped, including
            any other instances of this component in it. Use only when the
            source workflow contains exactly one instance of the component, or
            when every instance is already in sync with the new `componentData`.
            Otherwise omit and let propagation update everything.
      required:
        - componentData
    ComponentData:
      type: object
      description: >-
        Structural payload for a workflow component — the nodes, edges, and
        vault schema that compose it. Mirrors the shape used by the workflow
        visualizer.
      properties:
        nodes:
          type: array
          description: >-
            Array of component nodes, each wrapping a workflow node plus its
            canvas position.
          items:
            type: object
            properties:
              workflowNode:
                $ref: '#/components/schemas/Node'
              position:
                type: object
                properties:
                  x:
                    type: number
                  'y':
                    type: number
            required:
              - workflowNode
              - position
        workflowEdges:
          type: object
          description: >-
            Map of edges between component nodes. Keys are source node ids;
            values define outgoing connections (same shape as workflow edges).
          additionalProperties:
            $ref: '#/components/schemas/Edge'
        reactFlowEdges:
          type: array
          description: ReactFlow-specific edge metadata for the visualizer (handles, etc.).
          items:
            type: object
            properties:
              sourceId:
                type: string
              targetId:
                type: string
              sourceHandle:
                type: string
                nullable: true
              targetHandle:
                type: string
                nullable: true
            required:
              - sourceId
              - targetId
        vault_schema:
          type: object
          nullable: true
          description: >-
            Optional schema defining vault credentials referenced by nodes in
            this component. Merged into the target workflow's `vault_schema`
            during propagation (target entries always take precedence).
          additionalProperties:
            type: object
      required:
        - nodes
        - workflowEdges
        - reactFlowEdges
    Node:
      type: object
      description: >-
        A workflow step node. Each node has an `action` type and `parameters`
        specific to that action.

        Common action types include: START, END, CLICK, INPUT_TEXT,
        INPUT_SELECT, NAVIGATE,

        EXTRACT_DATAMODEL, BOOL_CONDITION, LOOP, DELAY, SCREENSHOT, SCROLL,
        TAB_MANAGEMENT,

        FILE_DOWNLOAD, FILE_UPLOAD, TFA, USER_INTERACTION, APP_ACTION,
        EXTRACT_NETWORK,

        TRANSFORM.
      properties:
        id:
          type: string
          description: Unique identifier for the node within the workflow
        name:
          type: string
          description: Display name of the node
        action:
          type: string
          description: The action type this node performs
          enum:
            - START
            - END
            - CLICK
            - INPUT_TEXT
            - INPUT_SELECT
            - NAVIGATE
            - EXTRACT_DATAMODEL
            - BOOL_CONDITION
            - LOOP
            - DELAY
            - SCREENSHOT
            - SCROLL
            - TAB_MANAGEMENT
            - FILE_DOWNLOAD
            - FILE_UPLOAD
            - TFA
            - USER_INTERACTION
            - APP_ACTION
            - EXTRACT_NETWORK
            - TRANSFORM
        parameters:
          type: object
          description: >-
            Action-specific parameters. The shape of this object depends on the
            `action` type.

            Refer to the workflow builder or an existing workflow's GET response
            for the parameter

            structure of each action type.
        description:
          type: string
          description: Optional description of what this node does
      required:
        - id
        - name
        - action
        - parameters
    Edge:
      type: object
      description: >-
        Defines outgoing connections from a node. The type of edge depends on
        the source node's action:

        - Most nodes use `to` for a single next node

        - BOOL_CONDITION nodes use `true` and `false` for branching

        - LOOP nodes use `loop_done` and `loop_not_done` for iteration control
      properties:
        to:
          type: string
          nullable: true
          description: ID of the next node (for non-branching nodes)
        'true':
          type: string
          nullable: true
          description: >-
            ID of the node to execute when condition is true (BOOL_CONDITION
            nodes)
        'false':
          type: string
          nullable: true
          description: >-
            ID of the node to execute when condition is false (BOOL_CONDITION
            nodes)
        loop_done:
          type: string
          nullable: true
          description: ID of the node to execute when loop completes (LOOP nodes)
        loop_not_done:
          type: string
          nullable: true
          description: ID of the node to execute for the next loop iteration (LOOP nodes)
  securitySchemes:
    AuthScheme:
      type: apiKey
      name: cc-key
      in: header
      description: >-
        API key-based authentication. Provide your CloudCruise API key in the
        cc-key header.

````