Skip to main content
POST
Stop Task
Cancel a running task. Sends a stop signal to the worker executing the task, marks the execution as stopped, and sets is_manually_stopped: true. Returns the updated task record. The endpoint is idempotent: calling it on a task that is already in a terminal state (completed, failed, stopped) returns the current execution unchanged.

Path Parameters

string
required
Unique identifier of the task to stop (UUID format)

Response

Returns the updated Agent Execution object with status set to stopped and is_manually_stopped set to true.

Example Request

Example Response

Response Status Codes

Important Notes

  • Idempotent - Tasks already in completed, failed, or stopped are returned unchanged
  • Asynchronous - The worker may take a few seconds to observe the stop signal and exit cleanly. Poll Get Task until status becomes stopped
  • Self-hosted environments - For agents running in a self-hosted environment, the stop request is routed cross-environment via the asset-command channel
  • Manual flag - is_manually_stopped: true distinguishes user-initiated cancels from system-side terminations

Example: Stop and confirm

Use Cases

  • Cancel a runaway agent - Halt an execution that is consuming too much time or tokens
  • User-initiated cancel - Wire a “Stop” button in your UI to this endpoint
  • Abort long-running tasks - Free up worker capacity when a task is no longer needed
  • Recover from stuck tasks - Force-terminate executions that are not progressing

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

task_id
string
required

Response

Successful Response

id
string
required
agent_id
string
required
organization_id
string
required
input
AgentExecutionInput · object
required
created_at
string<date-time>
required
status
enum<string> | null
default:pending
Available options:
pending,
executing,
paused,
error,
failed,
completed,
stopped
internal_status
string | null
last_executed_node_id
string | null
agent_version
string | null
started_at
string<date-time> | null
paused_at
string<date-time> | null
finished_at
string<date-time> | null
result
string | null
parent_execution
string | null
sub_executions
string[] | null
finished_sub_executions
string[] | null
should_update_parent
boolean | null
default:false
is_manually_stopped
boolean | null
default:false
is_background
boolean | null
default:false
payload_extension
Payload Extension · object | null
hitl_request
HumanInTheLoopRequest · object | null

Model representing human-in-the-loop approval records for tasks.

Attributes: wait_node_id (str): The id of the node that triggered this HITL.

pending_eca_request
PendingECARequest · object | null
source
string | null
worker_id
string | null
additional_context
string | null
instructions_override
string | null
expected_output
string | null
test_run_node_id
string | null
is_orchestration
boolean | null
default:false
is_gateway
boolean | null
default:false
is_app
boolean | null
default:false
sub_tasks_mode
enum<string> | null
Available options:
sync,
async,
auto
output_format
enum<string> | null
default:text
Available options:
text,
markdown,
json,
voice
voice_id
string | null
output_schema
Output Schema · object | null
events_streaming
boolean | null
default:false
used_mutating_tools
boolean | null
default:false
is_continuous
boolean | null
default:false
mcp_servers
Mcp Servers · object[] | null
triggering_agent_id
string | null
title
string | null
think_mode
enum<string> | null
default:default
Available options:
default,
harder
disable_attachment_injection
boolean | null
default:false
deep_planning
DeepPlanning · object | null
must_deep_plan
boolean | null
default:false
execution_attempts
integer | null
default:1
user_tokens
User Tokens · object | null
user_oidc_token
string | null
return_metrics
boolean | null
default:false
tokens
LLMTokens · object | null
llm_model_provider
string | null

Snapshot of the LLM provider used for this execution (request override or agent default at run time).

llm_model_name
string | null

Snapshot of the LLM model name used for this execution (request override or agent default at run time).

llm_reasoning_effort
enum<string> | null

Snapshot of the reasoning effort applied during this execution, when supported by the model.

Available options:
low,
medium,
high,
xhigh