source-connections
Cancel Sync Job
Request cancellation of a running sync job.
State lifecycle: PENDING / RUNNING → CANCELLING → CANCELLED
- The API immediately marks the job as CANCELLING in the database.
- A cancellation signal is sent to the Temporal workflow.
- The worker receives the signal, gracefully stops the sync pipeline (cancels worker pool, source stream), and marks the job as CANCELLED.
Already-processed entities are retained in the vector database. If the worker is unresponsive, a background cleanup job will force the transition to CANCELLED after 3 minutes.
Note: Only jobs in PENDING or RUNNING state can be cancelled. Attempting to cancel a COMPLETED, FAILED, or CANCELLED job returns 400.
post/source-connections/{source_connection_id}/jobs/{job_id}/cancel
Path parameters
source_connection_idstring uuid required
Unique identifier of the source connection (UUID)
Example:550e8400-e29b-41d4-a716-446655440000
Unique identifier of the source connection (UUID)
job_idstring uuid required
Unique identifier of the sync job to cancel (UUID)
Example:660e8400-e29b-41d4-a716-446655440001
Unique identifier of the sync job to cancel (UUID)
Response
Job with cancellation status
Example response
{
"completed_at": "2024-03-15T12:05:32Z",
"duration_seconds": 332.5,
"entities_deleted": 3,
"entities_failed": 0,
"entities_inserted": 45,
"entities_updated": 12,
"id": "770e8400-e29b-41d4-a716-446655440002",
"source_connection_id": "550e8400-e29b-41d4-a716-446655440000",
"started_at": "2024-03-15T12:00:00Z",
"status": "COMPLETED"
}