openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /triggers:
    post:
      tags:
        - Triggers
      summary: Create a trigger
      operationId: createTrigger
      description: >-
        Create a trigger with an activation type of `event`, `schedule`, or
        `custom`. Each type requires its own fields (e.g. `eventType` and
        optional `conditions` for events, `scheduleRule` and `timezone` for
        schedules, `customPayloadSchema` for custom triggers); mismatched fields
        are rejected.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTriggerBody'
      responses:
        '201':
          description: Trigger created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Trigger'
                required:
                  - data
      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 trigger = await client.workflows.triggers.create({ activation:
            'event', name: 'x' });


            console.log(trigger.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
            )
            trigger = client.workflows.triggers.create(
                activation="event",
                name="x",
            )
            print(trigger.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\ttrigger, err := client.Workflows.Triggers.New(context.TODO(), mobileruncloud.WorkflowTriggerNewParams{\n\t\tActivation: mobileruncloud.WorkflowTriggerNewParamsActivationEvent,\n\t\tName:       \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", trigger.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:triggers create \
              --api-key 'My API Key' \
              --activation event \
              --name x
    get:
      tags:
        - Triggers
      summary: List triggers
      operationId: listTriggers
      description: >-
        Return a paginated list of triggers. Supports filtering by `activation`
        and `eventType`, free-text `search`, and ordering by name, createdAt, or
        updatedAt.
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - event
              - schedule
              - custom
          required: false
          name: activation
          in: query
        - schema:
            type: string
          required: false
          name: eventType
          in: query
        - schema:
            type: string
            maxLength: 256
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - name
              - createdAt
              - updatedAt
            default: createdAt
          required: false
          name: orderBy
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          required: false
          name: orderByDirection
          in: query
      responses:
        '200':
          description: List triggers
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Trigger'
                        - properties:
                            id:
                              type: string
                              format: uuid
                            userId:
                              type: string
                              format: uuid
                              description: >-
                                Deprecated: use ownerId (tenancy) / createdBy
                                (actor).
                              deprecated: true
                            ownerId:
                              type: string
                              format: uuid
                            createdBy:
                              type:
                                - string
                                - 'null'
                              format: uuid
                            name:
                              type: string
                            description:
                              type:
                                - string
                                - 'null'
                            activation:
                              type: string
                              enum:
                                - event
                                - schedule
                                - custom
                            scheduleRule:
                              allOf:
                                - $ref: '#/components/schemas/ScheduleRule'
                                - type:
                                    - object
                                    - 'null'
                            timezone:
                              type:
                                - string
                                - 'null'
                            nextFireTime:
                              type:
                                - string
                                - 'null'
                            eventType:
                              type:
                                - string
                                - 'null'
                            conditions: {}
                            customPayloadSchema:
                              type:
                                - object
                                - 'null'
                              additionalProperties: {}
                            createdAt:
                              type:
                                - string
                                - 'null'
                            updatedAt:
                              type:
                                - string
                                - 'null'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
      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 triggers = await client.workflows.triggers.list();

            console.log(triggers.items);
        - 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
            )
            triggers = client.workflows.triggers.list()
            print(triggers.items)
        - 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\ttriggers, err := client.Workflows.Triggers.List(context.TODO(), mobileruncloud.WorkflowTriggerListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", triggers.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:triggers list \
              --api-key 'My API Key'
  /triggers/{triggerId}:
    get:
      tags:
        - Triggers
      summary: Get a trigger
      operationId: getTrigger
      description: >-
        Fetch a single trigger by its ID, including its activation type and
        type-specific configuration. Returns 404 if no trigger matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: triggerId
          in: path
      responses:
        '200':
          description: Trigger details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/Trigger'
                      - properties:
                          id:
                            type: string
                            format: uuid
                          userId:
                            type: string
                            format: uuid
                            description: >-
                              Deprecated: use ownerId (tenancy) / createdBy
                              (actor).
                            deprecated: true
                          ownerId:
                            type: string
                            format: uuid
                          createdBy:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          name:
                            type: string
                          description:
                            type:
                              - string
                              - 'null'
                          activation:
                            type: string
                            enum:
                              - event
                              - schedule
                              - custom
                          scheduleRule:
                            allOf:
                              - $ref: '#/components/schemas/ScheduleRule'
                              - type:
                                  - object
                                  - 'null'
                          timezone:
                            type:
                              - string
                              - 'null'
                          nextFireTime:
                            type:
                              - string
                              - 'null'
                          eventType:
                            type:
                              - string
                              - 'null'
                          conditions: {}
                          customPayloadSchema:
                            type:
                              - object
                              - 'null'
                            additionalProperties: {}
                          createdAt:
                            type:
                              - string
                              - 'null'
                          updatedAt:
                            type:
                              - string
                              - 'null'
                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 trigger = await
            client.workflows.triggers.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(trigger.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
            )
            trigger = client.workflows.triggers.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(trigger.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\ttrigger, err := client.Workflows.Triggers.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", trigger.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:triggers retrieve \
              --api-key 'My API Key' \
              --trigger-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    patch:
      tags:
        - Triggers
      summary: Update a trigger
      operationId: updateTrigger
      description: >-
        Partially update a trigger; all fields are optional. When `activation`
        is changed, the type-specific field rules are re-validated. Returns 404
        if the trigger does not exist.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: triggerId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTriggerBody'
      responses:
        '200':
          description: Trigger updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/Trigger'
                      - properties:
                          id:
                            type: string
                            format: uuid
                          userId:
                            type: string
                            format: uuid
                            description: >-
                              Deprecated: use ownerId (tenancy) / createdBy
                              (actor).
                            deprecated: true
                          ownerId:
                            type: string
                            format: uuid
                          createdBy:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          name:
                            type: string
                          description:
                            type:
                              - string
                              - 'null'
                          activation:
                            type: string
                            enum:
                              - event
                              - schedule
                              - custom
                          scheduleRule:
                            allOf:
                              - $ref: '#/components/schemas/ScheduleRule'
                              - type:
                                  - object
                                  - 'null'
                          timezone:
                            type:
                              - string
                              - 'null'
                          nextFireTime:
                            type:
                              - string
                              - 'null'
                          eventType:
                            type:
                              - string
                              - 'null'
                          conditions: {}
                          customPayloadSchema:
                            type:
                              - object
                              - 'null'
                            additionalProperties: {}
                          createdAt:
                            type:
                              - string
                              - 'null'
                          updatedAt:
                            type:
                              - string
                              - 'null'
                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 trigger = await
            client.workflows.triggers.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(trigger.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
            )
            trigger = client.workflows.triggers.update(
                trigger_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(trigger.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\ttrigger, err := client.Workflows.Triggers.Update(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowTriggerUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", trigger.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:triggers update \
              --api-key 'My API Key' \
              --trigger-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    delete:
      tags:
        - Triggers
      summary: Delete a trigger
      operationId: deleteTrigger
      description: Delete a trigger by its ID. Returns 404 if no trigger matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: triggerId
          in: path
      responses:
        '200':
          description: Trigger deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '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 trigger = await
            client.workflows.triggers.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(trigger.message);
        - 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
            )
            trigger = client.workflows.triggers.delete(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(trigger.message)
        - 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\ttrigger, err := client.Workflows.Triggers.Delete(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", trigger.Message)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:triggers delete \
              --api-key 'My API Key' \
              --trigger-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /triggers/{triggerId}/fire:
    post:
      tags:
        - Triggers
      summary: Fire a custom trigger with payload
      operationId: fireCustomTrigger
      description: >-
        Invoke a custom trigger directly with an arbitrary JSON payload.


        Fan-out: a trigger may be referenced by multiple flows (workflows).
        Firing it enqueues one execution per enabled, non-deleted flow attached
        to this trigger, each receiving the same payload. The `enqueuedCount` in
        the response reports how many were enqueued (0 if no flows are attached,
        or if all matching flows are gated by a cooldown).


        Payload validation:

        - If the trigger has a `customPayloadSchema`, the payload is validated
        against it (JSON Schema via AJV).

        - If no schema is configured, the payload only needs to be a JSON object
        — any keys and values are accepted.


        Only triggers with `activation = "custom"` can be fired through this
        endpoint; event and schedule triggers return 409.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: triggerId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FireCustomTriggerBody'
      responses:
        '202':
          description: >-
            Custom trigger fired; one execution enqueued per enabled flow
            attached to this trigger
          content:
            application/json:
              schema:
                type: object
                properties:
                  invocationId:
                    type: string
                    format: uuid
                    description: >-
                      Unique ID for this fire invocation. Job IDs in the
                      execution queue are derived from it (one per enqueued
                      flow).
                  enqueuedCount:
                    type: integer
                    minimum: 0
                    description: >-
                      Number of flow executions enqueued. May be 0 if no flows
                      are attached to this trigger, or if all attached flows are
                      currently in cooldown.
                required:
                  - invocationId
                  - enqueuedCount
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '409':
          description: Trigger exists but is not of type "custom"
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - message
                required:
                  - error
                  - details
        '429':
          description: Rate limit exceeded
          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.triggers.fire('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              payload: { foo: 'bar' },
            });


            console.log(response.enqueuedCount);
        - 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.triggers.fire(
                trigger_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                payload={
                    "foo": "bar"
                },
            )
            print(response.enqueued_count)
        - 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.Triggers.Fire(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowTriggerFireParams{\n\t\t\tPayload: map[string]any{\n\t\t\t\t\"foo\": \"bar\",\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.EnqueuedCount)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:triggers fire \
              --api-key 'My API Key' \
              --trigger-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --payload '{foo: bar}'
  /actions:
    post:
      tags:
        - Actions
      summary: Create an action
      operationId: createAction
      description: >-
        Create a reusable action from a catalog entry (`catalogEntryId`), with
        an optional `params` object supplying the values for that entry's
        service method. Returns 400 if the params are invalid for the chosen
        catalog entry.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateActionBody'
      responses:
        '201':
          description: Action created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Action'
                required:
                  - data
        '400':
          description: Bad Request
      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 action = await client.workflows.actions.create({
              catalogEntryId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              name: 'x',
            });

            console.log(action.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
            )
            action = client.workflows.actions.create(
                catalog_entry_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="x",
            )
            print(action.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\taction, err := client.Workflows.Actions.New(context.TODO(), mobileruncloud.WorkflowActionNewParams{\n\t\tCatalogEntryID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tName:           \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", action.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions create \
              --api-key 'My API Key' \
              --catalog-entry-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --name x
    get:
      tags:
        - Actions
      summary: List actions
      operationId: listActions
      description: >-
        Return a paginated list of actions. Supports filtering by `service`,
        free-text `search`, and ordering by name, createdAt, or updatedAt.
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - tasks_api
              - devices_api
              - agents_api
              - webhooks
          required: false
          name: service
          in: query
        - schema:
            type: string
            maxLength: 256
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - name
              - createdAt
              - updatedAt
            default: createdAt
          required: false
          name: orderBy
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          required: false
          name: orderByDirection
          in: query
      responses:
        '200':
          description: List actions
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Action'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
      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 actions = await client.workflows.actions.list();

            console.log(actions.items);
        - 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
            )
            actions = client.workflows.actions.list()
            print(actions.items)
        - 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\tactions, err := client.Workflows.Actions.List(context.TODO(), mobileruncloud.WorkflowActionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", actions.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions list \
              --api-key 'My API Key'
  /actions/{actionId}:
    get:
      tags:
        - Actions
      summary: Get an action
      operationId: getAction
      description: >-
        Fetch a single action by its ID, including its configured service,
        method, and params. Returns 404 if no action matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: actionId
          in: path
      responses:
        '200':
          description: Action details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Action'
                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 action = await
            client.workflows.actions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(action.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
            )
            action = client.workflows.actions.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(action.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\taction, err := client.Workflows.Actions.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", action.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions retrieve \
              --api-key 'My API Key' \
              --action-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    patch:
      tags:
        - Actions
      summary: Update an action
      operationId: updateAction
      description: >-
        Partially update an action's name, description, or params; all fields
        are optional. Returns 404 if the action does not exist.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: actionId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateActionBody'
      responses:
        '200':
          description: Action updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Action'
                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 action = await
            client.workflows.actions.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(action.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
            )
            action = client.workflows.actions.update(
                action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(action.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\taction, err := client.Workflows.Actions.Update(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowActionUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", action.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions update \
              --api-key 'My API Key' \
              --action-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    delete:
      tags:
        - Actions
      summary: Delete an action
      operationId: deleteAction
      description: Delete an action by its ID. Returns 404 if no action matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: actionId
          in: path
      responses:
        '200':
          description: Action deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '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 action = await
            client.workflows.actions.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(action.message);
        - 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
            )
            action = client.workflows.actions.delete(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(action.message)
        - 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\taction, err := client.Workflows.Actions.Delete(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", action.Message)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions delete \
              --api-key 'My API Key' \
              --action-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /actions/services:
    get:
      tags:
        - Actions
      summary: List available services
      operationId: listServices
      description: >-
        Return the names of the services that actions can be built against. Use
        these values to look up each service's allowed methods.
      responses:
        '200':
          description: Available services
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: string
                required:
                  - data
      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 services = await client.workflows.actions.services.list();

            console.log(services.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
            )
            services = client.workflows.actions.services.list()
            print(services.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\tservices, err := client.Workflows.Actions.Services.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", services.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions:services list \
              --api-key 'My API Key'
  /actions/services/{service}/methods:
    get:
      tags:
        - Actions
      summary: List allowed methods for a service
      operationId: listServiceMethods
      description: >-
        Return the methods allowed for the given service, each with its
        parameter definitions (name, type, whether required, description, and
        optional default/example). Returns 404 if the service is unknown.
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: service
          in: path
      responses:
        '200':
          description: Allowed methods
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ServiceMethod'
                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.actions.services.listMethods('x');


            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.actions.services.list_methods(
                "x",
            )
            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.Actions.Services.ListMethods(context.TODO(), \"x\")\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:actions:services list-methods \
              --api-key 'My API Key' \
              --service x
  /action-catalog:
    get:
      tags:
        - Action Catalog
      summary: List action catalog entries
      operationId: listActionCatalog
      description: >-
        Return a paginated list of catalog entries — the service/method
        templates that actions are created from, each carrying its parameter
        schema. Supports filtering by `service`.
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - tasks_api
              - devices_api
              - agents_api
              - webhooks
          required: false
          name: service
          in: query
      responses:
        '200':
          description: List catalog entries
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ActionCatalogEntry'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
      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 actionCatalogs = await client.workflows.actionCatalog.list();

            console.log(actionCatalogs.items);
        - 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
            )
            action_catalogs = client.workflows.action_catalog.list()
            print(action_catalogs.items)
        - 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\tactionCatalogs, err := client.Workflows.ActionCatalog.List(context.TODO(), mobileruncloud.WorkflowActionCatalogListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", actionCatalogs.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:action-catalog list \
              --api-key 'My API Key'
  /action-catalog/{catalogEntryId}:
    get:
      tags:
        - Action Catalog
      summary: Get a catalog entry
      operationId: getActionCatalogEntry
      description: >-
        Fetch a single action catalog entry by its ID, including its service,
        method, and parameter schema. Returns 404 if no entry matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: catalogEntryId
          in: path
      responses:
        '200':
          description: Catalog entry details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ActionCatalogEntry'
                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 actionCatalog = await client.workflows.actionCatalog.retrieve(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(actionCatalog.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
            )
            action_catalog = client.workflows.action_catalog.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(action_catalog.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\tactionCatalog, err := client.Workflows.ActionCatalog.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", actionCatalog.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:action-catalog retrieve \
              --api-key 'My API Key' \
              --catalog-entry-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /flows:
    post:
      tags:
        - Flows
      summary: Create a flow
      operationId: createFlow
      description: >-
        Create a flow that binds a trigger (`triggerId`) to an ordered list of
        actions, with at least one action required. Optional settings include
        target `deviceIds`, a cooldown (`cooldownSeconds`/`cooldownScope`), and
        webhook notifications on success or failure.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFlowBody'
      responses:
        '201':
          description: Flow created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                required:
                  - data
      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.create({
              actions: [{ actionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', position: 0 }],
              name: 'x',
              triggerId: '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.create(
                actions=[{
                    "action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                    "position": 0,
                }],
                name="x",
                trigger_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(flow.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\tflow, err := client.Workflows.Flows.New(context.TODO(), mobileruncloud.WorkflowFlowNewParams{\n\t\tActions: []mobileruncloud.WorkflowFlowNewParamsAction{{\n\t\t\tActionID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t\tPosition: 0,\n\t\t}},\n\t\tName:      \"x\",\n\t\tTriggerID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", flow.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows create \
              --api-key 'My API Key' \
              --action '{actionId: 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e, position: 0}' \
              --name x \
              --trigger-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    get:
      tags:
        - Flows
      summary: List flows
      operationId: listFlows
      description: >-
        Return a paginated list of flows. Supports filtering by `triggerId`,
        `enabled`, and one or more health `status` values (healthy, failing,
        blocked), plus free-text `search` and ordering.
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: triggerId
          in: query
        - schema:
            type:
              - boolean
              - 'null'
          required: false
          name: enabled
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - healthy
                - failing
                - blocked
          required: false
          name: status
          in: query
        - schema:
            type: string
            maxLength: 256
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - name
              - createdAt
              - updatedAt
            default: createdAt
          required: false
          name: orderBy
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          required: false
          name: orderByDirection
          in: query
      responses:
        '200':
          description: List flows
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Flow'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
      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 flows = await client.workflows.flows.list();

            console.log(flows.items);
        - 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
            )
            flows = client.workflows.flows.list()
            print(flows.items)
        - 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\tflows, err := client.Workflows.Flows.List(context.TODO(), mobileruncloud.WorkflowFlowListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", flows.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows list \
              --api-key 'My API Key'
  /flows/{flowId}:
    get:
      tags:
        - Flows
      summary: Get a flow
      operationId: getFlow
      description: >-
        Fetch a single flow by its ID, including its trigger binding,
        configuration, and current status. Returns 404 if no flow matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      responses:
        '200':
          description: Flow details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                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 flow = await
            client.workflows.flows.retrieve('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.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(flow.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\tflow, err := client.Workflows.Flows.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", flow.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows retrieve \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    patch:
      tags:
        - Flows
      summary: Update a flow
      operationId: updateFlow
      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.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFlowBody'
      responses:
        '200':
          description: Flow updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                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 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)
        - 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\tflow, err := client.Workflows.Flows.Update(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowFlowUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", flow.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows update \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    delete:
      tags:
        - Flows
      summary: Delete a flow
      operationId: deleteFlow
      description: Delete a flow by its ID. Returns 404 if no flow matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      responses:
        '200':
          description: Flow deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '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 flow = await
            client.workflows.flows.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(flow.message);
        - 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.delete(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(flow.message)
        - 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\tflow, err := client.Workflows.Flows.Delete(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", flow.Message)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows delete \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /flows/{flowId}/clone:
    post:
      tags:
        - Flows
      summary: Clone a flow
      operationId: cloneFlow
      description: >-
        Create a copy of an existing flow, including its actions and settings.
        The optional body can override the new flow's `name` and target
        `deviceIds`. Returns 404 if the source flow does not exist.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloneFlowBody'
      responses:
        '201':
          description: Flow cloned
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                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.clone('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.clone(
                flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            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.Clone(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowFlowCloneParams{},\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 clone \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /flows/{flowId}/dry-run:
    post:
      tags:
        - Flows
      summary: Dry-run a flow
      operationId: dryRunFlow
      description: >-
        Simulate this flow firing without storing events, enqueuing jobs, or
        consuming cooldown/rate-limit slots.


        Works for every trigger activation type:

        - `event`: validates the payload against the event catalog schema and
        evaluates the trigger conditions.

        - `custom`: validates the payload against the custom payload schema
        (conditions do not apply).

        - `schedule`: ignores the payload and reports the next fire time.


        The response reports `wouldFire` — whether the flow would actually run
        right now — alongside the gates that decide it (enabled, device
        attached, blocked, cooldown). `rateLimited` is informational and is not
        folded into `wouldFire`.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DryRunFlowBody'
      responses:
        '200':
          description: Dry-run result
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/FlowDryRunResult'
                required:
                  - data
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - message
                required:
                  - error
                  - details
  /flows/{flowId}/actions:
    get:
      tags:
        - Flows
      summary: List actions for a flow
      operationId: listFlowActions
      description: >-
        Return the ordered list of actions attached to a flow, including any
        nested child actions. Returns 404 if the flow does not exist.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      responses:
        '200':
          description: Flow actions
          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 actions = await
            client.workflows.flows.actions.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(actions.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
            )
            actions = client.workflows.flows.actions.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(actions.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\tactions, err := client.Workflows.Flows.Actions.List(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", actions.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows:actions list \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    put:
      tags:
        - Flows
      summary: Replace all actions for a flow
      operationId: setFlowActions
      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.
      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}'
    post:
      tags:
        - Flows
      summary: Add an action to a flow
      operationId: addFlowAction
      description: >-
        Append a single action to a flow at the given `position`, optionally
        nesting it under a `parentFlowActionId` or supplying its own `children`.
        Supports a `nameOverride`, param `overrides`, and `continueOnError`.
        Returns 404 if the flow does not exist.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddFlowActionBody'
      responses:
        '201':
          description: Flow action added
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $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.add('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              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.add(
                flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                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.Add(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowFlowActionAddParams{\n\t\t\tActionID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t\tPosition: 0,\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 add \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --action-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --position 0
  /flows/{flowId}/actions/{flowActionId}:
    delete:
      tags:
        - Flows
      summary: Remove an action from a flow
      operationId: removeFlowAction
      description: >-
        Remove a single action from a flow by its `flowActionId`. Returns 404 if
        the flow or flow action does not exist.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
        - schema:
            type: string
            format: uuid
          required: true
          name: flowActionId
          in: path
      responses:
        '200':
          description: Flow action removed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '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 action = await
            client.workflows.flows.actions.remove('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              flowId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });


            console.log(action.message);
        - 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
            )
            action = client.workflows.flows.actions.remove(
                flow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(action.message)
        - 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\taction, err := client.Workflows.Flows.Actions.Remove(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.WorkflowFlowActionRemoveParams{\n\t\t\tFlowID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", action.Message)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:flows:actions remove \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --flow-action-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /flows/{flowId}/unblock:
    post:
      tags:
        - Flows
      summary: Unblock a flow
      description: >-
        Clear a flow's blocked status after fixing the underlying issue.
        Idempotent — safe to call on already-healthy flows.
      operationId: unblockFlow
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: flowId
          in: path
      responses:
        '200':
          description: Flow unblocked (or already healthy)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Flow'
                required:
                  - data
        '400':
          description: Flow is still broken — preflight failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - still_broken
                  code:
                    allOf:
                      - $ref: '#/components/schemas/FlowFailureCode'
                      - type: string
                  reason:
                    type: string
                required:
                  - error
                  - code
                  - reason
        '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.unblock('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.unblock(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            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.Unblock(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\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 unblock \
              --api-key 'My API Key' \
              --flow-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /events/dry-run:
    post:
      tags:
        - Events
      summary: Simulate event matching (dry run)
      operationId: dryRunEvent
      description: >-
        Simulate an event against all configured flows. Returns which flows
        would match and what actions would run, without storing the event or
        enqueuing jobs.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventBody'
      responses:
        '200':
          description: Dry-run result
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DryRunResult'
                required:
                  - data
      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.events.dryRun({ eventType:
            'x' });


            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.events.dry_run(
                event_type="x",
            )
            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.Events.DryRun(context.TODO(), mobileruncloud.WorkflowEventDryRunParams{\n\t\tEventType: \"x\",\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:events dry-run \
              --api-key 'My API Key' \
              --event-type x
  /events/ingest:
    post:
      tags:
        - Events
      summary: Ingest an event
      operationId: ingestEvent
      description: >-
        Ingest an event for trigger evaluation. Returns immediately with 202
        Accepted.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventBody'
      responses:
        '202':
          description: Event accepted for processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  eventId:
                    type: string
                    format: uuid
                required:
                  - eventId
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - message
                required:
                  - error
                  - details
        '429':
          description: Rate limit exceeded
          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.events.ingest({ eventType:
            'x' });


            console.log(response.eventId);
        - 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.events.ingest(
                event_type="x",
            )
            print(response.event_id)
        - 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.Events.Ingest(context.TODO(), mobileruncloud.WorkflowEventIngestParams{\n\t\tEventType: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.EventID)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:events ingest \
              --api-key 'My API Key' \
              --event-type x
  /app-events/catalog:
    get:
      tags:
        - App Events
      summary: List the app-event catalog
      description: >-
        Selectable app-based trigger events (e.g. app.whatsapp.message_received)
        with their predefined payload — served from the JSON definition registry
        (always in sync, no DB).
      operationId: listAppEventCatalog
      responses:
        '200':
          description: App-event catalog
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppEventCatalogEntry'
                required:
                  - data
  /app-events/catalog/{appEventType}:
    get:
      tags:
        - App Events
      summary: Get one app-event catalog entry by type/name
      description: >-
        Fetch a single selectable app event by its appEventType (e.g.
        app.whatsapp.message_received).
      operationId: getAppEventCatalogEntry
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
          required: true
          name: appEventType
          in: path
      responses:
        '200':
          description: App-event catalog entry
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AppEventCatalogEntry'
                required:
                  - data
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
  /app-events:
    get:
      tags:
        - App Events
      summary: List structured app events
      description: >-
        Structured, app-scoped events (e.g. app.whatsapp.message_received)
        derived from raw device notifications. Typed columns — not raw payloads
        (those stay in the event log).
      operationId: listAppEvents
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            maxLength: 128
          required: false
          name: eventType
          in: query
        - schema:
            type: string
            enum:
              - app
              - system
              - device
              - webhook
          required: false
          name: source
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: deviceId
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: from
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: to
          in: query
      responses:
        '200':
          description: App event history
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Event'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
  /app-events/{id}:
    get:
      tags:
        - App Events
      summary: Get an app event
      description: >-
        Fetch a single structured app event by its ID, including its typed
        payload, source, and originating device. Returns 404 if no event
        matches.
      operationId: getAppEvent
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      responses:
        '200':
          description: App event
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Event'
                required:
                  - data
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
  /executions:
    get:
      tags:
        - Executions
      summary: List flow executions
      operationId: listExecutions
      description: >-
        Return a paginated history of flow executions. Supports filtering by
        `flowId`, `triggerId`, `status`, and a `from`/`to` time range, plus
        free-text `search` and ordering by startedAt, finishedAt, or status.
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            default: 10
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: flowId
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: triggerId
          in: query
        - schema:
            type: string
            enum:
              - pending
              - running
              - success
              - failed
              - cancelled
              - skipped
              - invalid
          required: false
          name: status
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: from
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: to
          in: query
        - schema:
            type: string
            maxLength: 256
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - startedAt
              - finishedAt
              - status
            default: startedAt
          required: false
          name: orderBy
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          required: false
          name: orderByDirection
          in: query
      responses:
        '200':
          description: Execution history
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/FlowExecution'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - items
                  - pagination
      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 executions = await client.workflows.executions.list();

            console.log(executions.items);
        - 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
            )
            executions = client.workflows.executions.list()
            print(executions.items)
        - 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\texecutions, err := client.Workflows.Executions.List(context.TODO(), mobileruncloud.WorkflowExecutionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", executions.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:executions list \
              --api-key 'My API Key'
  /executions/metrics:
    get:
      tags:
        - Executions
      summary: Get execution metrics
      operationId: getExecutionMetrics
      description: >-
        Return aggregate execution metrics — total count, counts by status,
        average duration, and the last execution time. Can be scoped by
        `flowId`, `triggerId`, and a `from`/`to` time range.
      parameters:
        - schema:
            type: string
            format: uuid
          required: false
          name: flowId
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: triggerId
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: from
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: to
          in: query
      responses:
        '200':
          description: Execution metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ExecutionMetrics'
                required:
                  - data
      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.executions.getMetrics();

            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.executions.get_metrics()
            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.Executions.GetMetrics(context.TODO(), mobileruncloud.WorkflowExecutionGetMetricsParams{})\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:executions get-metrics \
              --api-key 'My API Key'
  /executions/{executionId}:
    get:
      tags:
        - Executions
      summary: Get execution details
      operationId: getExecution
      description: >-
        Fetch a single flow execution by its ID, including its status, kind,
        result or error, and start/finish timestamps. Returns 404 if no
        execution matches.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: executionId
          in: path
      responses:
        '200':
          description: Execution details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/FlowExecutionDetail'
                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 execution = await client.workflows.executions.retrieve(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(execution.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
            )
            execution = client.workflows.executions.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(execution.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\texecution, err := client.Workflows.Executions.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", execution.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:executions retrieve \
              --api-key 'My API Key' \
              --execution-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /executions/{executionId}/abort:
    post:
      tags:
        - Executions
      summary: Abort a running or pending execution
      description: >-
        Signals the worker to stop the execution between steps and marks it
        cancelled. Idempotent-ish: already-terminal executions return 409.
      operationId: abortExecution
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: executionId
          in: path
      responses:
        '200':
          description: Execution aborted
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/FlowExecution'
                required:
                  - data
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '409':
          description: Conflict
components:
  schemas:
    CreateTriggerBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        activation:
          type: string
          enum:
            - event
            - schedule
            - custom
        eventType:
          type: string
          maxLength: 256
        conditions:
          type: object
          properties:
            all:
              type: array
              items:
                type: object
            any:
              type: array
              items:
                type: object
        scheduleRule:
          type: object
          properties:
            type:
              type: string
              enum:
                - once
                - cron
                - recurring
            dateTime:
              type: string
              description: ISO 8601 datetime (for type=once)
            expression:
              type: string
              description: Cron expression (for type=cron)
            rrule:
              type: string
              description: RRULE string (for type=recurring)
          required:
            - type
        timezone:
          type: string
        customPayloadSchema:
          $ref: '#/components/schemas/CustomPayloadSchema'
      required:
        - name
        - activation
    Trigger:
      type: object
      properties:
        id:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          deprecated: true
        ownerId:
          type: string
          format: uuid
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        activation:
          type: string
          enum:
            - event
            - schedule
            - custom
        scheduleRule:
          $ref: '#/components/schemas/ScheduleRule'
        timezone:
          type:
            - string
            - 'null'
        nextFireTime:
          type:
            - string
            - 'null'
        eventType:
          type:
            - string
            - 'null'
        conditions: {}
        customPayloadSchema:
          type:
            - object
            - 'null'
          additionalProperties: {}
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - name
        - description
        - activation
        - scheduleRule
        - timezone
        - eventType
        - customPayloadSchema
        - createdAt
        - updatedAt
    ScheduleRule:
      type: object
      properties:
        type:
          type: string
          enum:
            - once
            - cron
            - recurring
        dateTime:
          type: string
          description: ISO 8601 datetime (for type=once)
        expression:
          type: string
          description: Cron expression (for type=cron)
        rrule:
          type: string
          description: RRULE string (for type=recurring)
      required:
        - type
    Pagination:
      type: object
      properties:
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        page:
          type: integer
          minimum: 1
        pageSize:
          type: integer
          minimum: 1
        pages:
          type: integer
          minimum: 0
        total:
          type: integer
          minimum: 0
      required:
        - hasNext
        - hasPrev
        - page
        - pageSize
        - pages
        - total
    UpdateTriggerBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        activation:
          type: string
          enum:
            - event
            - schedule
            - custom
        eventType:
          type: string
          maxLength: 256
        conditions:
          type: object
          properties:
            all:
              type: array
              items:
                type: object
            any:
              type: array
              items:
                type: object
        scheduleRule:
          type: object
          properties:
            type:
              type: string
              enum:
                - once
                - cron
                - recurring
            dateTime:
              type: string
              description: ISO 8601 datetime (for type=once)
            expression:
              type: string
              description: Cron expression (for type=cron)
            rrule:
              type: string
              description: RRULE string (for type=recurring)
          required:
            - type
        timezone:
          type:
            - string
            - 'null'
        customPayloadSchema:
          allOf:
            - $ref: '#/components/schemas/CustomPayloadSchema'
            - type:
                - object
                - 'null'
    FireCustomTriggerBody:
      type: object
      properties:
        payload:
          type: object
          description: >-
            Arbitrary JSON object forwarded to every flow attached to this
            trigger. Validated against the trigger's customPayloadSchema when
            one is configured; otherwise only "must be a JSON object" is
            enforced.
          additionalProperties: true
      required:
        - payload
    CreateActionBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        catalogEntryId:
          type: string
          format: uuid
        params:
          type: object
          additionalProperties: {}
      required:
        - name
        - catalogEntryId
    Action:
      type: object
      properties:
        id:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          deprecated: true
        ownerId:
          type: string
          format: uuid
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
        catalogEntryId:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        service:
          type: string
          enum:
            - tasks_api
            - devices_api
            - agents_api
            - webhooks
        method:
          type: string
        params: {}
        paramsSchema: {}
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - catalogEntryId
        - name
        - description
        - service
        - method
        - createdAt
        - updatedAt
    UpdateActionBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        params:
          type: object
          additionalProperties: {}
    ServiceMethod:
      type: object
      properties:
        method:
          type: string
        params:
          type: array
          items:
            $ref: '#/components/schemas/ParamDef'
      required:
        - method
        - params
    ActionCatalogEntry:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        service:
          type: string
          enum:
            - tasks_api
            - devices_api
            - agents_api
            - webhooks
        method:
          type: string
        paramsSchema: {}
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - name
        - description
        - service
        - method
        - createdAt
        - updatedAt
    CreateFlowBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        triggerId:
          type: string
          format: uuid
        enabled:
          type: boolean
          default: true
        deviceIds:
          type: array
          items:
            type: string
            format: uuid
          maxItems: 256
          default: []
        cooldownSeconds:
          type:
            - integer
            - 'null'
          minimum: 0
        cooldownScope:
          $ref: '#/components/schemas/CooldownScope'
        notifyWebhookId:
          type:
            - string
            - 'null'
          format: uuid
        notifyOnSuccess:
          type: boolean
          default: false
        notifyOnFailure:
          type: boolean
          default: false
        actions:
          type: array
          items:
            $ref: '#/components/schemas/FlowActionInput'
          minItems: 1
      required:
        - name
        - triggerId
        - actions
      additionalProperties: false
    Flow:
      type: object
      properties:
        id:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          deprecated: true
        ownerId:
          type: string
          format: uuid
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        triggerId:
          type: string
          format: uuid
        enabled:
          type: boolean
        deviceIds:
          type: array
          items:
            type: string
            format: uuid
        cooldownSeconds:
          type:
            - integer
            - 'null'
        cooldownScope:
          type: string
          enum:
            - flow
            - device
        notifyWebhookId:
          type:
            - string
            - 'null'
          format: uuid
        notifyOnSuccess:
          type: boolean
        notifyOnFailure:
          type: boolean
        lastTriggeredAt:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/FlowStatus'
        consecutiveFailures:
          type: integer
          minimum: 0
        lastFailureCode:
          $ref: '#/components/schemas/FlowFailureCode'
        lastFailureAt:
          type:
            - string
            - 'null'
        blockedAt:
          type:
            - string
            - 'null'
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - name
        - description
        - triggerId
        - enabled
        - deviceIds
        - cooldownSeconds
        - cooldownScope
        - notifyWebhookId
        - notifyOnSuccess
        - notifyOnFailure
        - lastTriggeredAt
        - status
        - consecutiveFailures
        - lastFailureCode
        - lastFailureAt
        - blockedAt
        - createdAt
        - updatedAt
    UpdateFlowBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        triggerId:
          type: string
          format: uuid
        enabled:
          type: boolean
        deviceIds:
          type: array
          items:
            type: string
            format: uuid
          maxItems: 256
        cooldownSeconds:
          type:
            - integer
            - 'null'
          minimum: 0
        cooldownScope:
          $ref: '#/components/schemas/CooldownScope'
        notifyWebhookId:
          type:
            - string
            - 'null'
          format: uuid
        notifyOnSuccess:
          type: boolean
        notifyOnFailure:
          type: boolean
      additionalProperties: false
    CloneFlowBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        deviceIds:
          type: array
          items:
            type: string
            format: uuid
          maxItems: 256
      additionalProperties: false
    DryRunFlowBody:
      type: object
      properties:
        payload:
          type: object
          additionalProperties: {}
          default: {}
      additionalProperties: false
    FlowDryRunResult:
      type: object
      properties:
        activation:
          type: string
          enum:
            - event
            - schedule
            - custom
        validation:
          $ref: '#/components/schemas/DryRunValidation'
        conditionsPassed:
          type:
            - boolean
            - 'null'
        nextFireTime:
          type:
            - string
            - 'null'
        rateLimited:
          type: boolean
        gates:
          $ref: '#/components/schemas/DryRunGates'
        wouldFire:
          type: boolean
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ResolvedAction'
      required:
        - activation
        - validation
        - conditionsPassed
        - nextFireTime
        - rateLimited
        - gates
        - wouldFire
        - actions
    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
    SetFlowActionsBody:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/FlowActionInput'
          minItems: 1
      required:
        - actions
      additionalProperties: false
    AddFlowActionBody:
      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'
        parentFlowActionId:
          type:
            - string
            - 'null'
          format: uuid
        children:
          type: array
          items:
            $ref: '#/components/schemas/FlowChildActionInput'
      required:
        - actionId
        - position
      additionalProperties: false
    FlowFailureCode:
      type:
        - string
        - 'null'
      enum:
        - device_not_found
        - permission_denied
        - client_error
        - transient
        - logic
        - invalid_config
    IngestEventBody:
      type: object
      properties:
        eventType:
          type: string
          minLength: 1
          maxLength: 256
        deviceId:
          type: string
          format: uuid
        payload:
          type: object
          additionalProperties: {}
          default: {}
      required:
        - eventType
    DryRunResult:
      type: object
      properties:
        validation:
          $ref: '#/components/schemas/DryRunValidation'
        matchedFlows:
          type: array
          items:
            $ref: '#/components/schemas/DryRunMatchedFlow'
      required:
        - validation
        - matchedFlows
    AppEventCatalogEntry:
      type: object
      properties:
        appEventType:
          type: string
        label:
          type: string
        appName:
          type: string
        category:
          type: string
          enum:
            - app
            - system
            - device
            - webhook
        packageName:
          type:
            - string
            - 'null'
        sourceEventType:
          type: string
        payloadSchema:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
                enum:
                  - string
                  - number
                  - boolean
                  - object
                  - array
              description:
                type: string
              example: {}
            required:
              - name
              - type
              - description
      required:
        - appEventType
        - label
        - appName
        - category
        - packageName
        - sourceEventType
        - payloadSchema
    Event:
      type: object
      properties:
        id:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          deprecated: true
        ownerId:
          type: string
          format: uuid
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
        deviceId:
          type:
            - string
            - 'null'
          format: uuid
        rawEventId:
          type:
            - string
            - 'null'
          format: uuid
        eventType:
          type: string
        source:
          type: string
          enum:
            - app
            - system
            - device
            - webhook
        payload:
          type: object
          additionalProperties: {}
        occurredAt:
          type:
            - string
            - 'null'
        createdAt:
          type:
            - string
            - 'null'
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - deviceId
        - rawEventId
        - eventType
        - source
        - payload
        - occurredAt
        - createdAt
    FlowExecution:
      type: object
      properties:
        id:
          type: string
          format: uuid
        flowId:
          type: string
          format: uuid
        triggerId:
          type: string
          format: uuid
        eventId:
          type:
            - string
            - 'null'
          format: uuid
        flowName:
          type:
            - string
            - 'null'
        triggerName:
          type:
            - string
            - 'null'
        status:
          type:
            - string
            - 'null'
          enum:
            - pending
            - running
            - success
            - failed
            - cancelled
            - skipped
            - invalid
        kind:
          type: string
          enum:
            - live
            - dry_run
        result: {}
        error:
          type:
            - string
            - 'null'
        startedAt:
          type:
            - string
            - 'null'
        finishedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - flowId
        - triggerId
        - eventId
        - flowName
        - triggerName
        - status
        - kind
        - error
        - startedAt
        - finishedAt
    ExecutionMetrics:
      type: object
      properties:
        total:
          type: integer
        byStatus:
          type: object
          properties:
            pending:
              type: integer
            running:
              type: integer
            success:
              type: integer
            failed:
              type: integer
            cancelled:
              type: integer
            skipped:
              type: integer
            invalid:
              type: integer
          required:
            - pending
            - running
            - success
            - failed
            - cancelled
            - skipped
            - invalid
        avgDurationMs:
          type:
            - number
            - 'null'
        lastExecutionAt:
          type:
            - string
            - 'null'
      required:
        - total
        - byStatus
        - avgDurationMs
        - lastExecutionAt
    FlowExecutionDetail:
      allOf:
        - $ref: '#/components/schemas/FlowExecution'
        - type: object
          properties:
            files:
              type: array
              items:
                $ref: '#/components/schemas/ExecutionFile'
              description: >-
                Files produced by files.upload steps; derived server-side at
                read time.
          required:
            - files
    CustomPayloadSchema:
      type: object
      description: Optional JSON Schema for validating payloads sent to this custom trigger
      additionalProperties: true
    ParamDef:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - object
            - array
        required:
          type: boolean
        description:
          type: string
        default: {}
        example: {}
      required:
        - name
        - type
        - required
        - description
    CooldownScope:
      type: string
      enum:
        - flow
        - device
      default: flow
    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
    FlowStatus:
      type: string
      enum:
        - healthy
        - failing
        - blocked
    DryRunValidation:
      type: object
      properties:
        valid:
          type: boolean
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
            required:
              - field
              - message
      required:
        - valid
    DryRunGates:
      type: object
      properties:
        enabled:
          type: boolean
        deviceAttached:
          type: boolean
        deviceIds:
          type: array
          items:
            type: string
            format: uuid
        blocked:
          type: boolean
        cooldownActive:
          type:
            - boolean
            - 'null'
      required:
        - enabled
        - deviceAttached
        - deviceIds
        - blocked
        - cooldownActive
    ResolvedAction:
      type: object
      properties:
        name:
          type: string
        service:
          type: string
          enum:
            - tasks_api
            - devices_api
            - agents_api
            - webhooks
        method:
          type: string
        params:
          type: object
          additionalProperties: {}
        continueOnError:
          type: boolean
        children:
          type: array
          items: {}
          description: >-
            Nested child actions (loop/branch bodies), each the same shape as a
            ResolvedAction.
      required:
        - name
        - service
        - method
        - continueOnError
    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
    DryRunMatchedFlow:
      type: object
      properties:
        flow:
          $ref: '#/components/schemas/Flow'
        trigger:
          allOf:
            - $ref: '#/components/schemas/Trigger'
            - properties:
                id:
                  type: string
                  format: uuid
                userId:
                  type: string
                  format: uuid
                  description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
                  deprecated: true
                ownerId:
                  type: string
                  format: uuid
                createdBy:
                  type:
                    - string
                    - 'null'
                  format: uuid
                name:
                  type: string
                description:
                  type:
                    - string
                    - 'null'
                activation:
                  type: string
                  enum:
                    - event
                    - schedule
                    - custom
                scheduleRule:
                  allOf:
                    - $ref: '#/components/schemas/ScheduleRule'
                    - type:
                        - object
                        - 'null'
                timezone:
                  type:
                    - string
                    - 'null'
                nextFireTime:
                  type:
                    - string
                    - 'null'
                eventType:
                  type:
                    - string
                    - 'null'
                conditions: {}
                customPayloadSchema:
                  type:
                    - object
                    - 'null'
                  additionalProperties: {}
                createdAt:
                  type:
                    - string
                    - 'null'
                updatedAt:
                  type:
                    - string
                    - 'null'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ResolvedAction'
        gates:
          $ref: '#/components/schemas/DryRunGates'
        wouldFire:
          type: boolean
      required:
        - flow
        - trigger
        - actions
        - gates
        - wouldFire
    ExecutionFile:
      type: object
      properties:
        fileId:
          type: string
          format: uuid
        filename:
          type: string
        mimeType:
          type: string
        sizeBytes:
          type: integer
          minimum: 0
      required:
        - fileId
        - filename
        - mimeType
        - sizeBytes
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header
