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.flows.dryRun('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
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.flows.dry_run(
flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)curl --request POST \
--url https://api.mobilerun.ai/v1/flows/{flowId}/dry-run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payload": {}
}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/flows/{flowId}/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([
'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/flows/{flowId}/dry-run"
payload := strings.NewReader("{\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/flows/{flowId}/dry-run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/flows/{flowId}/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 \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"actions": [
{
"continueOnError": true,
"flowActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"method": "<string>",
"name": "<string>",
"recordingEnabled": true,
"service": "tasks_api",
"children": [
"<unknown>"
],
"params": {}
}
],
"activation": "event",
"conditionsPassed": true,
"gates": {
"blocked": true,
"cooldownActive": true,
"deviceAttached": true,
"deviceIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enabled": true
},
"nextFireTime": "<string>",
"rateLimited": true,
"validation": {
"valid": true,
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
},
"wouldFire": true
}
}{
"error": "<string>"
}{
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"error": "<string>"
}Flows
Dry-run a flow
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.
POST
/
flows
/
{flowId}
/
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.flows.dryRun('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
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.flows.dry_run(
flow_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)curl --request POST \
--url https://api.mobilerun.ai/v1/flows/{flowId}/dry-run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payload": {}
}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/flows/{flowId}/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([
'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/flows/{flowId}/dry-run"
payload := strings.NewReader("{\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/flows/{flowId}/dry-run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/flows/{flowId}/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 \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"actions": [
{
"continueOnError": true,
"flowActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"method": "<string>",
"name": "<string>",
"recordingEnabled": true,
"service": "tasks_api",
"children": [
"<unknown>"
],
"params": {}
}
],
"activation": "event",
"conditionsPassed": true,
"gates": {
"blocked": true,
"cooldownActive": true,
"deviceAttached": true,
"deviceIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enabled": true
},
"nextFireTime": "<string>",
"rateLimited": true,
"validation": {
"valid": true,
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
},
"wouldFire": true
}
}{
"error": "<string>"
}{
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"error": "<string>"
}Was this page helpful?
⌘I