Resume Agent Run
curl --request POST \
--url https://api.example.com/agent_run/{run_id}/resumeimport requests
url = "https://api.example.com/agent_run/{run_id}/resume"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/agent_run/{run_id}/resume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/agent_run/{run_id}/resume",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agent_run/{run_id}/resume"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/agent_run/{run_id}/resume")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent_run/{run_id}/resume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAgent Runs
Resume Agent Run
Resume a failed or cancelled run.
POST
/
agent_run
/
{run_id}
/
resume
Resume Agent Run
curl --request POST \
--url https://api.example.com/agent_run/{run_id}/resumeimport requests
url = "https://api.example.com/agent_run/{run_id}/resume"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/agent_run/{run_id}/resume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/agent_run/{run_id}/resume",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agent_run/{run_id}/resume"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/agent_run/{run_id}/resume")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent_run/{run_id}/resume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyResumes a failed or cancelled run by re-queueing eligible runtime nodes. Trigger/source nodes are excluded from resume.
Credit-blocked runs (
Use this endpoint to continue runs that failed because of insufficient credits:
Request
curl -X POST "https://api.mosaic.so/agent_run/[run_id]/resume" \
-H "Authorization: Bearer mk_your_api_key"
Response
{
"success": true,
"run_id": "7f8d9c2b-4a6e-8b3f-1d5c-9e2f3a4b5c6d",
"agent_state_id": "7f8d9c2b-4a6e-8b3f-1d5c-9e2f3a4b5c6d",
"nodes_queued": 4,
"nodes_considered": 7,
"requeued_nodes": 4,
"requeued_node_tasks_detached": 4,
"requeued_node_active_tasks_cancelled": 1,
"requeued_node_active_tasks_total": 1
}
Notes
- Run status must be
failedorcancelled - Resume only re-queues runtime nodes (
not_started,blocked,cancelled,failed) - Trigger node types are never resumed
- Existing trigger metadata is preserved, and resume metadata is appended
409 with a detail message.
Credit-blocked runs (needs_credits)
Use this endpoint to continue runs that failed because of insufficient credits:
- Detect credit-blocking via
GET /agent_run/{run_id}(needs_credits: true) and/orGET /agent_run/{run_id}/nodes(nodes[].needs_credits: true). - Check the current plan with
GET /plan. - If you are on a free/no paid plan:
- List purchasable plans with
GET /plan/list. - Upgrade with
POST /plan/upgrade. - If upgrade returns
requires_checkout: true, complete checkout atcheckout_url, then re-checkGET /plan.
- List purchasable plans with
- Optionally enable auto top-ups with
POST /credits/settings(eligible plans only:creator,creator_annual,professional,professional_annual). - Call
POST /agent_run/{run_id}/resumeto re-queue eligible failed/blocked runtime nodes.
Was this page helpful?