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

# Simulate event matching (dry run)

> Simulate an event against all configured flows. Returns which flows would match and what actions would run, without storing the event or enqueuing jobs.



## OpenAPI

````yaml /api-reference/workflows/events.yaml post /events/dry-run
openapi: 3.1.0
info:
  title: Events
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /events/dry-run:
    post:
      tags:
        - Events
      summary: Simulate event matching (dry run)
      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.
      operationId: dryRunEvent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/DryRunResult'
                required:
                  - data
                type: object
          description: Dry-run result
      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)
components:
  schemas:
    IngestEventBody:
      properties:
        deviceId:
          format: uuid
          type: string
        eventType:
          maxLength: 256
          minLength: 1
          type: string
        payload:
          additionalProperties: {}
          default: {}
          type: object
      required:
        - eventType
      type: object
    DryRunResult:
      properties:
        matchedFlows:
          items:
            $ref: '#/components/schemas/DryRunMatchedFlow'
          type: array
        validation:
          $ref: '#/components/schemas/DryRunValidation'
      required:
        - validation
        - matchedFlows
      type: object
    DryRunMatchedFlow:
      properties:
        actions:
          items:
            $ref: '#/components/schemas/ResolvedAction'
          type: array
        flow:
          $ref: '#/components/schemas/Flow'
        gates:
          $ref: '#/components/schemas/DryRunGates'
        trigger:
          $ref: '#/components/schemas/Trigger'
        wouldFire:
          type: boolean
      required:
        - flow
        - trigger
        - actions
        - gates
        - wouldFire
      type: object
    DryRunValidation:
      properties:
        errors:
          items:
            properties:
              field:
                type: string
              message:
                type: string
            required:
              - field
              - message
            type: object
          type: array
        valid:
          type: boolean
      required:
        - valid
      type: object
    ResolvedAction:
      properties:
        children:
          description: >-
            Nested child actions (loop/branch bodies), each the same shape as a
            ResolvedAction.
          items: {}
          type: array
        continueOnError:
          type: boolean
        flowActionId:
          format: uuid
          type: string
        key:
          type: string
        method:
          type: string
        name:
          type: string
        params:
          additionalProperties: {}
          type: object
        recordingEnabled:
          type: boolean
        service:
          enum:
            - tasks_api
            - devices_api
            - agents_api
            - webhooks
            - integrations_api
          type: string
      required:
        - key
        - name
        - service
        - method
        - continueOnError
        - flowActionId
        - recordingEnabled
      type: object
    Flow:
      properties:
        agentId:
          format: uuid
          type:
            - string
            - 'null'
        archivedAt:
          format: date-time
          type:
            - string
            - 'null'
        blockedAt:
          format: date-time
          type:
            - string
            - 'null'
        consecutiveFailures:
          minimum: 0
          type: integer
        cooldownScope:
          enum:
            - flow
            - device
          type: string
        cooldownSeconds:
          type:
            - integer
            - 'null'
        createdAt:
          format: date-time
          type:
            - string
            - 'null'
        createdBy:
          format: uuid
          type:
            - string
            - 'null'
        delivery:
          additionalProperties: false
          properties:
            destination:
              enum:
                - mobilerun
                - one_drive
                - google_drive
              type: string
            folder:
              description: not allowed when destination is mobilerun
              maxLength: 1024
              minLength: 1
              type: string
            recording:
              additionalProperties: false
              properties:
                filename:
                  maxLength: 255
                  minLength: 1
                  type: string
              required:
                - filename
              type: object
            screenshots:
              additionalProperties: false
              properties: {}
              type: object
          required:
            - destination
          type:
            - object
            - 'null'
        description:
          type:
            - string
            - 'null'
        deviceIds:
          items:
            format: uuid
            type: string
          type: array
        enabled:
          description: >-
            Compatibility projection of lifecycleStatus; true only when
            lifecycleStatus is enabled.
          type: boolean
        healthMonitoringEnabled:
          type: boolean
        id:
          format: uuid
          type: string
        lastFailureAt:
          format: date-time
          type:
            - string
            - 'null'
        lastFailureCode:
          $ref: '#/components/schemas/FlowFailureCode'
        lastTriggeredAt:
          format: date-time
          type:
            - string
            - 'null'
        lifecycleStatus:
          $ref: '#/components/schemas/AgentLifecycleStatus'
        name:
          type: string
        notifyOnFailure:
          type: boolean
        notifyOnSuccess:
          type: boolean
        notifyWebhookId:
          format: uuid
          type:
            - string
            - 'null'
        ownerId:
          format: uuid
          type: string
        recordingEnabled:
          deprecated: true
          description: >-
            Deprecated: use recordingPolicy.mode ("flow" =
            recordingEnabled=true, "off" = recordingEnabled=false).
          type: boolean
        recordingPolicy:
          $ref: '#/components/schemas/RecordingPolicy'
        selfHealingEnabled:
          type: boolean
        selfHealingMaxAttempts:
          maximum: 5
          minimum: 1
          type: integer
        status:
          $ref: '#/components/schemas/FlowStatus'
        templateResolutionVersion:
          description: >-
            Template-resolver semantics this flow runs under. 1 = legacy
            (missing/forbidden/null all resolve to ''). 2 = typed
            (missing/forbidden throw, a whole-token null stays JSON null). 3 =
            typed, key-based (steps are addressed as {{steps.<key>...}} instead
            of by name; trigger.payload is not available). Existing flows stay
            1; new flows default to the current version.
          maximum: 3
          minimum: 1
          type: integer
        triggerId:
          format: uuid
          type: string
        updatedAt:
          format: date-time
          type:
            - string
            - 'null'
        userId:
          deprecated: true
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          format: uuid
          type: string
      required:
        - id
        - userId
        - ownerId
        - agentId
        - createdBy
        - name
        - description
        - triggerId
        - enabled
        - lifecycleStatus
        - archivedAt
        - deviceIds
        - cooldownSeconds
        - cooldownScope
        - notifyWebhookId
        - notifyOnSuccess
        - notifyOnFailure
        - lastTriggeredAt
        - status
        - templateResolutionVersion
        - consecutiveFailures
        - lastFailureCode
        - lastFailureAt
        - blockedAt
        - healthMonitoringEnabled
        - selfHealingEnabled
        - selfHealingMaxAttempts
        - recordingEnabled
        - recordingPolicy
        - delivery
        - createdAt
        - updatedAt
      type: object
    DryRunGates:
      properties:
        blocked:
          type: boolean
        cooldownActive:
          type:
            - boolean
            - 'null'
        deviceAttached:
          type: boolean
        deviceIds:
          items:
            format: uuid
            type: string
          type: array
        enabled:
          type: boolean
      required:
        - enabled
        - deviceAttached
        - deviceIds
        - blocked
        - cooldownActive
      type: object
    Trigger:
      properties:
        activation:
          enum:
            - event
            - schedule
            - custom
          type: string
        conditions: {}
        createdAt:
          format: date-time
          type:
            - string
            - 'null'
        createdBy:
          format: uuid
          type:
            - string
            - 'null'
        customPayloadSchema:
          additionalProperties: {}
          type:
            - object
            - 'null'
        description:
          type:
            - string
            - 'null'
        eventType:
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        name:
          type: string
        nextFireTime:
          type:
            - string
            - 'null'
        ownerId:
          format: uuid
          type: string
        scheduleRule:
          $ref: '#/components/schemas/ScheduleRule'
        timezone:
          type:
            - string
            - 'null'
        updatedAt:
          format: date-time
          type:
            - string
            - 'null'
        userId:
          deprecated: true
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          format: uuid
          type: string
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - name
        - description
        - activation
        - scheduleRule
        - timezone
        - eventType
        - customPayloadSchema
        - createdAt
        - updatedAt
      type: object
    FlowFailureCode:
      enum:
        - device_not_found
        - permission_denied
        - client_error
        - transient
        - logic
        - invalid_config
        - null
      type:
        - string
        - 'null'
    AgentLifecycleStatus:
      enum:
        - enabled
        - disabled
        - archived
      type: string
    RecordingPolicy:
      properties:
        mode:
          $ref: '#/components/schemas/RecordingPolicyMode'
      required:
        - mode
      type: object
    FlowStatus:
      enum:
        - healthy
        - failing
        - blocked
      type: string
    ScheduleRule:
      properties:
        dateTime:
          description: ISO 8601 datetime (for type=once)
          type: string
        expression:
          description: Cron expression (for type=cron)
          type: string
        jitter:
          description: >-
            Optional per-occurrence random window around the nominal schedule
            time
          properties:
            afterMinutes:
              default: 0
              maximum: 1440
              minimum: 0
              type: integer
            beforeMinutes:
              default: 0
              maximum: 1440
              minimum: 0
              type: integer
          type: object
        rrule:
          description: RRULE string (for type=recurring)
          type: string
        type:
          enum:
            - once
            - cron
            - recurring
          type: string
      required:
        - type
      type: object
    RecordingPolicyMode:
      enum:
        - 'off'
        - flow
        - selected_steps
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

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