> ## 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:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
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:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetFlowActionsBody'
      responses:
        '200':
          description: Flow actions replaced
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/FlowAction'
                required:
                  - data
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Workflows.Flows.Actions.Replace(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowFlowActionReplaceParams{\n\t\t\tActions: []mobileruncloud.WorkflowFlowActionReplaceParamsAction{{\n\t\t\t\tActionID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t\t\tPosition: 0,\n\t\t\t}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows:actions replace \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --action '{actionId: 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e, position: 0}'
components:
  schemas:
    SetFlowActionsBody:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/FlowActionInput'
          minItems: 1
      required:
        - actions
      additionalProperties: false
    FlowAction:
      type: object
      properties:
        id:
          type: string
          format: uuid
        flowId:
          type: string
          format: uuid
        actionId:
          type: string
          format: uuid
        parentFlowActionId:
          type:
            - string
            - 'null'
          format: uuid
        position:
          type: integer
        continueOnError:
          type: boolean
        nameOverride:
          type:
            - string
            - 'null'
        overrides:
          type:
            - object
            - 'null'
          properties:
            params:
              type: object
              additionalProperties: {}
        createdAt:
          type:
            - string
            - 'null'
      required:
        - id
        - flowId
        - actionId
        - parentFlowActionId
        - position
        - continueOnError
        - nameOverride
        - overrides
        - createdAt
    FlowActionInput:
      type: object
      properties:
        actionId:
          type: string
          format: uuid
        position:
          type: integer
          minimum: 0
        continueOnError:
          type: boolean
          default: false
        nameOverride:
          type: string
          minLength: 1
          maxLength: 256
        overrides:
          $ref: '#/components/schemas/FlowActionOverrides'
        children:
          type: array
          items:
            $ref: '#/components/schemas/FlowChildActionInput'
      required:
        - actionId
        - position
      additionalProperties: false
    FlowActionOverrides:
      type:
        - object
        - 'null'
      properties:
        params:
          type: object
          additionalProperties: {}
      additionalProperties: false
    FlowChildActionInput:
      type: object
      properties:
        actionId:
          type: string
          format: uuid
        position:
          type: integer
          minimum: 0
        continueOnError:
          type: boolean
          default: false
        nameOverride:
          type: string
          minLength: 1
          maxLength: 256
        overrides:
          $ref: '#/components/schemas/FlowActionOverrides'
      required:
        - actionId
        - position
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````