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

# Replace all actions for a flow

> Replace a flow's entire action list with the supplied set (at least one required). Each action references an `actionId` and a unique `position`, and may include nested `children`, a `nameOverride`, param `overrides`, and a `continueOnError` flag. Returns 404 if the flow does not exist.



## OpenAPI

````yaml /api-reference/workflows.yaml put /flows/{flowId}/actions
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}/actions:
    put:
      tags:
        - Flows
      summary: Replace all actions for a flow
      description: >-
        Replace a flow's entire action list with the supplied set (at least one
        required). Each action references an `actionId` and a unique `position`,
        and may include nested `children`, a `nameOverride`, param `overrides`,
        and a `continueOnError` flag. Returns 404 if the flow does not exist.
      operationId: setFlowActions
      parameters:
        - in: path
          name: flowId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetFlowActionsBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/FlowAction'
                    type: array
                required:
                  - data
                type: object
          description: Flow actions replaced
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: 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 response = await client.workflows.flows.actions.replace(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              { actions: [{ actionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', position: 0 }] },
            );

            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.actions.replace(
                flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                actions=[{
                    "action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                    "position": 0,
                }],
            )
            print(response.data)
components:
  schemas:
    SetFlowActionsBody:
      additionalProperties: false
      properties:
        actions:
          items:
            $ref: '#/components/schemas/FlowActionInput'
          minItems: 1
          type: array
      required:
        - actions
      type: object
    FlowAction:
      properties:
        actionId:
          format: uuid
          type: string
        continueOnError:
          type: boolean
        createdAt:
          type:
            - string
            - 'null'
        flowId:
          format: uuid
          type: string
        id:
          format: uuid
          type: string
        nameOverride:
          type:
            - string
            - 'null'
        overrides:
          properties:
            params:
              additionalProperties: {}
              type: object
          type:
            - object
            - 'null'
        parentFlowActionId:
          format: uuid
          type:
            - string
            - 'null'
        position:
          type: integer
        recordingEnabled:
          description: >-
            Selected for per-step recording under the flow's "selected_steps"
            recording policy.
          type: boolean
      required:
        - id
        - flowId
        - actionId
        - parentFlowActionId
        - position
        - continueOnError
        - nameOverride
        - overrides
        - recordingEnabled
        - createdAt
      type: object
    FlowActionInput:
      additionalProperties: false
      properties:
        actionId:
          format: uuid
          type: string
        children:
          items:
            $ref: '#/components/schemas/FlowChildActionInput'
          type: array
        continueOnError:
          default: false
          type: boolean
        nameOverride:
          maxLength: 256
          minLength: 1
          type: string
        overrides:
          $ref: '#/components/schemas/FlowActionOverrides'
        position:
          minimum: 0
          type: integer
        recordingEnabled:
          default: false
          type: boolean
      required:
        - actionId
        - position
      type: object
    FlowChildActionInput:
      additionalProperties: false
      properties:
        actionId:
          format: uuid
          type: string
        continueOnError:
          default: false
          type: boolean
        nameOverride:
          maxLength: 256
          minLength: 1
          type: string
        overrides:
          $ref: '#/components/schemas/FlowActionOverrides'
        position:
          minimum: 0
          type: integer
        recordingEnabled:
          default: false
          type: boolean
      required:
        - actionId
        - position
      type: object
    FlowActionOverrides:
      additionalProperties: false
      properties:
        params:
          additionalProperties: {}
          type: object
      type:
        - object
        - 'null'
  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.