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

# Activate a verified flow

> Activate a disabled flow only when the supplied verification execution succeeded and the flow graph has not changed since verification. Repeating activation is idempotent for an already-enabled flow.



## OpenAPI

````yaml /api-reference/workflows.yaml post /flows/{flowId}/activate
openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /flows/{flowId}/activate:
    post:
      tags:
        - Flows
      summary: Activate a verified flow
      description: >-
        Activate a disabled flow only when the supplied verification execution
        succeeded and the flow graph has not changed since verification.
        Repeating activation is idempotent for an already-enabled flow.
      operationId: activateFlow
      parameters:
        - in: path
          name: flowId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateFlowBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                required:
                  - data
                type: object
          description: Flow activated
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowNotFoundError'
          description: Flow not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowVerificationError'
          description: Verification is missing, not successful, or stale
      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 response = await
            client.workflows.flows.activate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              verificationExecutionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });


            console.log(response.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
            )
            response = client.workflows.flows.activate(
                flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                verification_execution_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.data)
components:
  schemas:
    ActivateFlowBody:
      additionalProperties: false
      properties:
        verificationExecutionId:
          format: uuid
          type: string
      required:
        - verificationExecutionId
      type: object
    Flow:
      properties:
        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
        - 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
    FlowNotFoundError:
      properties:
        code:
          enum:
            - flow_not_found
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    FlowVerificationError:
      properties:
        code:
          $ref: '#/components/schemas/FlowVerificationErrorCode'
        message:
          type: string
      required:
        - code
        - message
      type: object
    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
    FlowVerificationErrorCode:
      enum:
        - verification_invalid
        - verification_stale
      type: string
    RecordingPolicyMode:
      enum:
        - 'off'
        - flow
        - selected_steps
      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.