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

# Update a flow

> Partially update a flow's settings — name, trigger binding, enabled state, target devices, cooldown, or notifications; all fields are optional. Actions are managed through the flow-actions endpoints, not here. Returns 404 if the flow does not exist.



## OpenAPI

````yaml /api-reference/workflows/flows.yaml patch /flows/{flowId}
openapi: 3.1.0
info:
  title: Flows
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /flows/{flowId}:
    patch:
      tags:
        - Flows
      summary: Update a flow
      description: >-
        Partially update a flow's settings — name, trigger binding, enabled
        state, target devices, cooldown, or notifications; all fields are
        optional. Actions are managed through the flow-actions endpoints, not
        here. Returns 404 if the flow does not exist.
      operationId: updateFlow
      parameters:
        - in: path
          name: flowId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFlowBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                required:
                  - data
                type: object
          description: Flow updated
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowTemplateReferenceInvalidError'
          description: Template reference validation failed
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowNotFoundError'
          description: Flow not found
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const flow = await
            client.workflows.flows.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(flow.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            flow = client.workflows.flows.update(
                flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(flow.data)
components:
  schemas:
    UpdateFlowBody:
      additionalProperties: false
      properties:
        cooldownScope:
          $ref: '#/components/schemas/CooldownScope'
        cooldownSeconds:
          minimum: 0
          type:
            - integer
            - 'null'
        delivery:
          additionalProperties: false
          properties:
            destination:
              enum:
                - mobilerun
                - one_drive
                - google_drive
              type: string
            folder:
              description: not allowed when destination is mobilerun
              maxLength: 1024
              minLength: 1
              type: string
            recording:
              additionalProperties: false
              properties:
                filename:
                  maxLength: 255
                  minLength: 1
                  type: string
              required:
                - filename
              type: object
            screenshots:
              additionalProperties: false
              properties: {}
              type: object
          required:
            - destination
          type:
            - object
            - 'null'
        description:
          maxLength: 2048
          type: string
        deviceIds:
          items:
            format: uuid
            type: string
          maxItems: 256
          type: array
        enabled:
          type: boolean
        healthMonitoringEnabled:
          type: boolean
        lifecycleStatus:
          description: >-
            Set the visible agent lifecycle. Archive remains available only
            through DELETE.
          enum:
            - enabled
            - disabled
          type: string
        name:
          maxLength: 256
          minLength: 1
          type: string
        notifyOnFailure:
          type: boolean
        notifyOnSuccess:
          type: boolean
        notifyWebhookId:
          format: uuid
          type:
            - string
            - 'null'
        recordingEnabled:
          deprecated: true
          description: >-
            Deprecated compatibility field. true maps to
            recordingPolicy.mode="flow"; false maps to "off".
          type: boolean
        recordingPolicy:
          additionalProperties: false
          properties:
            mode:
              $ref: '#/components/schemas/RecordingPolicyMode'
          required:
            - mode
          type: object
        selfHealingEnabled:
          type: boolean
        selfHealingMaxAttempts:
          maximum: 5
          minimum: 1
          type: integer
        triggerId:
          format: uuid
          type: string
      type: object
    Flow:
      properties:
        agentId:
          format: uuid
          type:
            - string
            - 'null'
        archivedAt:
          format: date-time
          type:
            - string
            - 'null'
        blockedAt:
          format: date-time
          type:
            - string
            - 'null'
        consecutiveFailures:
          minimum: 0
          type: integer
        cooldownScope:
          enum:
            - flow
            - device
          type: string
        cooldownSeconds:
          type:
            - integer
            - 'null'
        createdAt:
          format: date-time
          type:
            - string
            - 'null'
        createdBy:
          format: uuid
          type:
            - string
            - 'null'
        delivery:
          additionalProperties: false
          properties:
            destination:
              enum:
                - mobilerun
                - one_drive
                - google_drive
              type: string
            folder:
              description: not allowed when destination is mobilerun
              maxLength: 1024
              minLength: 1
              type: string
            recording:
              additionalProperties: false
              properties:
                filename:
                  maxLength: 255
                  minLength: 1
                  type: string
              required:
                - filename
              type: object
            screenshots:
              additionalProperties: false
              properties: {}
              type: object
          required:
            - destination
          type:
            - object
            - 'null'
        description:
          type:
            - string
            - 'null'
        deviceIds:
          items:
            format: uuid
            type: string
          type: array
        enabled:
          description: >-
            Compatibility projection of lifecycleStatus; true only when
            lifecycleStatus is enabled.
          type: boolean
        healthMonitoringEnabled:
          type: boolean
        id:
          format: uuid
          type: string
        lastFailureAt:
          format: date-time
          type:
            - string
            - 'null'
        lastFailureCode:
          $ref: '#/components/schemas/FlowFailureCode'
        lastTriggeredAt:
          format: date-time
          type:
            - string
            - 'null'
        lifecycleStatus:
          $ref: '#/components/schemas/AgentLifecycleStatus'
        name:
          type: string
        notifyOnFailure:
          type: boolean
        notifyOnSuccess:
          type: boolean
        notifyWebhookId:
          format: uuid
          type:
            - string
            - 'null'
        ownerId:
          format: uuid
          type: string
        recordingEnabled:
          deprecated: true
          description: >-
            Deprecated: use recordingPolicy.mode ("flow" =
            recordingEnabled=true, "off" = recordingEnabled=false).
          type: boolean
        recordingPolicy:
          $ref: '#/components/schemas/RecordingPolicy'
        selfHealingEnabled:
          type: boolean
        selfHealingMaxAttempts:
          maximum: 5
          minimum: 1
          type: integer
        status:
          $ref: '#/components/schemas/FlowStatus'
        templateResolutionVersion:
          description: >-
            Template-resolver semantics this flow runs under. 1 = legacy
            (missing/forbidden/null all resolve to ''). 2 = typed
            (missing/forbidden throw, a whole-token null stays JSON null). 3 =
            typed, key-based (steps are addressed as {{steps.<key>...}} instead
            of by name; trigger.payload is not available). Existing flows stay
            1; new flows default to the current version.
          maximum: 3
          minimum: 1
          type: integer
        triggerId:
          format: uuid
          type: string
        updatedAt:
          format: date-time
          type:
            - string
            - 'null'
        userId:
          deprecated: true
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          format: uuid
          type: string
      required:
        - id
        - userId
        - ownerId
        - agentId
        - createdBy
        - name
        - description
        - triggerId
        - enabled
        - lifecycleStatus
        - archivedAt
        - deviceIds
        - cooldownSeconds
        - cooldownScope
        - notifyWebhookId
        - notifyOnSuccess
        - notifyOnFailure
        - lastTriggeredAt
        - status
        - templateResolutionVersion
        - consecutiveFailures
        - lastFailureCode
        - lastFailureAt
        - blockedAt
        - healthMonitoringEnabled
        - selfHealingEnabled
        - selfHealingMaxAttempts
        - recordingEnabled
        - recordingPolicy
        - delivery
        - createdAt
        - updatedAt
      type: object
    FlowTemplateReferenceInvalidError:
      properties:
        code:
          enum:
            - template_reference_invalid
          type: string
        details:
          items:
            properties:
              field:
                type: string
              knownSteps:
                items:
                  type: string
                maxItems: 30
                type: array
              message:
                type: string
              reference:
                type: string
            required:
              - field
              - message
            type: object
          type: array
        message:
          enum:
            - Template reference validation failed
          type: string
      required:
        - code
        - message
        - details
      type: object
    FlowNotFoundError:
      properties:
        code:
          enum:
            - flow_not_found
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    CooldownScope:
      enum:
        - flow
        - device
      type: string
    RecordingPolicyMode:
      enum:
        - 'off'
        - flow
        - selected_steps
      type: string
    FlowFailureCode:
      enum:
        - device_not_found
        - permission_denied
        - client_error
        - transient
        - logic
        - invalid_config
        - null
      type:
        - string
        - 'null'
    AgentLifecycleStatus:
      enum:
        - enabled
        - disabled
        - archived
      type: string
    RecordingPolicy:
      properties:
        mode:
          $ref: '#/components/schemas/RecordingPolicyMode'
      required:
        - mode
      type: object
    FlowStatus:
      enum:
        - healthy
        - failing
        - blocked
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.