Inspecting, Pausing, and Canceling Runs

The current SDKs can inspect workflow jobs, but cannot pause, resume, or cancel them. Runtime control through these SDKs is limited to bounded waiting and stopping the caller’s own polling.

List jobs with pagination

Python’s RawClient.list_workflow_jobs() accepts these optional filters:

  • workflow_id

  • source_file_id

  • status

  • page, starting at 1

  • page_size, defaulting to 20

response = raw.list_workflow_jobs({
    "workflow_id": workflow_id,
    "page": 1,
    "page_size": 20,
})

for job in response["jobs"]:
    print(job["job_id"], job["status"], job["start_time"], job["end_time"])

Go uses WorkflowJobListRequest and WorkflowJobListResponse:

response, err := raw.ListWorkflowJobs(ctx, &sdk.WorkflowJobListRequest{
    WorkflowID: workflowID,
    Page:       1,
    PageSize:   20,
})
if err != nil {
    return err
}
for _, job := range response.Jobs {
    fmt.Println(job.JobID, job.Status.String(), job.StartTime, job.EndTime)
}

The response contains jobs and total. Status values are 0 unknown, 1 running, 2 completed, and 3 failed. Continue paging from total and the requested page size when all jobs are required.

Find and wait for one job

get_workflow_job()/GetWorkflowJob() filters by workflow ID and source-file ID, then returns the first item from the first page. It does not accept a job ID or return node details.

wait_for_workflow_job()/WaitForWorkflowJob() repeatedly calls that helper. Pass both completed and failed as target states; otherwise it can return as soon as the job is first observed in running state.

In Go, canceling the context stops local waiting. The Python helper has no cancellation callback. To stop early, run it within an application-managed task boundary or implement interruptible polling with RawClient.

Pause, resume, and cancel boundaries

Neither official SDK currently implements pause, resume, or cancel for workflow jobs. The presence of run and stop permission constants does not mean the client implements the associated endpoints. Use an explicitly documented Product API or the UI for the target MOI instance. Stopping local polling does not stop the server-side job.

For failure recovery boundaries, see Retries and Node Reruns.