Skip to content

Update Execution Status

PATCH
/api/v1/executions/{execution_id}

Update execution status.

Supports setting status to ‘cancelled’, ‘failed’, or ‘completed’ for running executions. Uses PATCH with a status body for proper REST semantics.

Use cases:

  • ‘cancelled’: User-initiated cancellation of a running execution
  • ‘failed’: Manual cleanup of stale executions that failed but weren’t detected
  • ‘completed’: Manual cleanup of stale executions that completed but weren’t detected

Note: ‘failed’ and ‘completed’ are intended for administrative cleanup of executions that got stuck in ‘running’ status (e.g., after server restart in embedded mode).

Args: execution_id: Execution UUID request: Status update request with target status and optional error_info service: Execution service (injected)

Returns: Status update result with previous and current status

Raises: HTTPException: 404 if not found, 400 if status change not allowed

execution_id
required
Execution Id
string
ExecutionStatusUpdateRequest

Request to update execution status.

Used with PATCH /executions/{execution_id} to change execution state. Supports setting status to ‘cancelled’, ‘failed’, or ‘completed’.

For ‘failed’ status, optional error_info can be provided with details about why the execution is being marked as failed.

object
status
required
Status

Target status (‘cancelled’, ‘failed’, or ‘completed’)

string
Allowed values: cancelled failed completed
error_info
Any of:
object
key
additional properties
any

Successful Response

ExecutionStatusUpdateResponse

Response from updating execution status.

object
success
required
Success

Whether update succeeded

boolean
execution_id
required
Execution Id

Execution UUID

string format: uuid
previous_status
required
Previous Status

Status before update

string
Allowed values: running completed failed cancelled interrupted
current_status
required
Current Status

Status after update

string
Allowed values: running completed failed cancelled interrupted
message
required
Message

Status message

string

Resource not found

ErrorResponse

Standard error response matching FastAPI HTTPException format.

This model is used in OpenAPI response declarations for 4xx/5xx errors. The detail field matches FastAPI’s HTTPException structure.

object
detail
required
Detail

Error message (matches FastAPI HTTPException)

string
error_code
Any of:
string
correlation_id
Any of:
string
timestamp
Timestamp

Error timestamp

string format: date-time

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object