JavaScript
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);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)curl --request POST \
--url https://api.mobilerun.ai/v1/events/dry-run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "<string>",
"deviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/events/dry-run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'eventType' => '<string>',
'deviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'payload' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/events/dry-run"
payload := strings.NewReader("{\n \"eventType\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payload\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/v1/events/dry-run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/events/dry-run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventType\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"matchedFlows": [
{
"actions": [
{
"continueOnError": true,
"method": "<string>",
"name": "<string>",
"service": "tasks_api",
"children": [
"<unknown>"
],
"params": {}
}
],
"flow": {
"blockedAt": "<string>",
"consecutiveFailures": 1,
"cooldownScope": "flow",
"cooldownSeconds": 123,
"createdAt": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"deviceIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enabled": true,
"healthMonitoringEnabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lastFailureAt": "<string>",
"lastFailureCode": "device_not_found",
"lastTriggeredAt": "<string>",
"name": "<string>",
"notifyOnFailure": true,
"notifyOnSuccess": true,
"notifyWebhookId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recordingEnabled": true,
"selfHealingEnabled": true,
"selfHealingMaxAttempts": 3,
"status": "healthy",
"templateResolutionVersion": 1,
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"gates": {
"blocked": true,
"cooldownActive": true,
"deviceAttached": true,
"deviceIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enabled": true
},
"trigger": {
"activation": "event",
"createdAt": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customPayloadSchema": {},
"description": "<string>",
"eventType": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduleRule": {
"type": "once",
"dateTime": "<string>",
"expression": "<string>",
"jitter": {
"afterMinutes": 0,
"beforeMinutes": 0
},
"rrule": "<string>"
},
"timezone": "<string>",
"updatedAt": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conditions": "<unknown>",
"nextFireTime": "<string>"
},
"wouldFire": true
}
],
"validation": {
"valid": true,
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}
}Events
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.
POST
/
events
/
dry-run
JavaScript
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);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)curl --request POST \
--url https://api.mobilerun.ai/v1/events/dry-run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "<string>",
"deviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/events/dry-run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'eventType' => '<string>',
'deviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'payload' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/events/dry-run"
payload := strings.NewReader("{\n \"eventType\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payload\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/v1/events/dry-run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/events/dry-run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventType\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"matchedFlows": [
{
"actions": [
{
"continueOnError": true,
"method": "<string>",
"name": "<string>",
"service": "tasks_api",
"children": [
"<unknown>"
],
"params": {}
}
],
"flow": {
"blockedAt": "<string>",
"consecutiveFailures": 1,
"cooldownScope": "flow",
"cooldownSeconds": 123,
"createdAt": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"deviceIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enabled": true,
"healthMonitoringEnabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lastFailureAt": "<string>",
"lastFailureCode": "device_not_found",
"lastTriggeredAt": "<string>",
"name": "<string>",
"notifyOnFailure": true,
"notifyOnSuccess": true,
"notifyWebhookId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recordingEnabled": true,
"selfHealingEnabled": true,
"selfHealingMaxAttempts": 3,
"status": "healthy",
"templateResolutionVersion": 1,
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"gates": {
"blocked": true,
"cooldownActive": true,
"deviceAttached": true,
"deviceIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enabled": true
},
"trigger": {
"activation": "event",
"createdAt": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customPayloadSchema": {},
"description": "<string>",
"eventType": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduleRule": {
"type": "once",
"dateTime": "<string>",
"expression": "<string>",
"jitter": {
"afterMinutes": 0,
"beforeMinutes": 0
},
"rrule": "<string>"
},
"timezone": "<string>",
"updatedAt": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conditions": "<unknown>",
"nextFireTime": "<string>"
},
"wouldFire": true
}
],
"validation": {
"valid": true,
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}
}Authorizations
Bearer token via Authorization header
Body
application/json
Response
200 - application/json
Dry-run result
Show child attributes
Show child attributes
Was this page helpful?
⌘I