v1

latestOpenAPI 3.1.0raw.githubusercontent.com2024-11-08170291390.5 KB
Work Queues

Read Work Queue Runs

Get flow runs from the work queue.

post/api/work_queues/{id}/get_runs

Path parameters

idstring uuid required

The work queue id

The work queue id

Headers

x-prefect-uiboolean

A header to indicate this request came from the Prefect UI.

A header to indicate this request came from the Prefect UI.

x-prefect-api-versionstring

Request body

scheduled_beforestring date-time

Only flow runs scheduled to start before this time will be returned.

agent_idstring uuid

An optional unique identifier for the agent making this query. If provided, the Prefect REST API will track the last time this agent polled the work queue.

limitinteger

Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.

Response

Successful Response

idstring uuid
createdstring date-time
updatedstring date-time
namestring

The name of the flow run. Defaults to a random slug if not specified.

flow_idstring uuid required

The id of the flow being run.

state_idstring uuid

The id of the flow run's current state.

deployment_idstring uuid

The id of the deployment associated with this flow run, if available.

deployment_versionstring

The version of the deployment associated with this flow run.

work_queue_idstring uuid

The id of the run's work pool queue.

work_queue_namestring

The work queue that handled this flow run.

flow_versionstring

The version of the flow executed in this flow run.

parametersobject

Parameters for the flow run.

idempotency_keystring

An optional idempotency key for the flow run. Used to ensure the same flow run is not created multiple times.

contextobject

Additional context for the flow run.

tagsstring[]

A list of tags on the flow run

parent_task_run_idstring uuid

If the flow run is a subflow, the id of the 'dummy' task in the parent flow used to track subflow state.

state_type'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING'

Enumeration of state types.

state_namestring

The name of the current flow run state.

run_countinteger

The number of times the flow run was executed.

expected_start_timestring date-time

The flow run's expected start time.

next_scheduled_start_timestring date-time

The next time the flow run is scheduled to start.

start_timestring date-time

The actual start time.

end_timestring date-time

The actual end time.

total_run_timenumber

Total run time. If the flow run was executed multiple times, the time of each run will be summed.

estimated_run_timenumber

A real-time estimate of the total run time.

estimated_start_time_deltanumber

The difference between actual and expected start time.

auto_scheduledboolean

Whether or not the flow run was automatically scheduled.

infrastructure_document_idstring uuid

The block document defining infrastructure to use this flow run.

infrastructure_pidstring

The id of the flow run as returned by an infrastructure block.

work_pool_idstring uuid

The id of the flow run's work pool.

work_pool_namestring

The name of the flow run's work pool.

job_variablesobject

Variables used as overrides in the base job template

Example response

[
  {
    "name": "my-flow-run",
    "deployment_version": "1.0",
    "flow_version": "1.0",
    "context": {
      "my_var": "my_val"
    },
    "tags": [
      "tag-1",
      "tag-2"
    ],
    "work_pool_name": "my-work-pool",
    "state": {
      "message": "Run started"
    }
  }
]