> ## 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.yaml post /events/dry-run
openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
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':
          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
components:
  schemas:
    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
    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
    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
    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
    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
    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
    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
    FlowStatus:
      type: string
      enum:
        - healthy
        - failing
        - blocked
    FlowFailureCode:
      type:
        - string
        - 'null'
      enum:
        - device_not_found
        - permission_denied
        - client_error
        - transient
        - logic
        - invalid_config
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````