Skip to main content
POST
/
flow_runs
/
bulk_set_state
Bulk Set Flow Run State
curl --request POST \
  --url https://api.example.com/flow_runs/bulk_set_state \
  --header 'Content-Type: application/json' \
  --data '
{
  "state": {
    "type": "SCHEDULED",
    "name": "<string>",
    "message": "<string>",
    "data": "<unknown>",
    "state_details": {
      "flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "child_flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "scheduled_time": "2023-11-07T05:31:56Z",
      "cache_key": "<string>",
      "cache_expiration": "2023-11-07T05:31:56Z",
      "deferred": false,
      "untrackable_result": false,
      "pause_timeout": "2023-11-07T05:31:56Z",
      "pause_reschedule": false,
      "pause_key": "<string>",
      "run_input_keyset": {},
      "refresh_cache": true,
      "retriable": true,
      "transition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "task_parameters_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "traceparent": "<string>",
      "deployment_concurrency_lease_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  },
  "flow_runs": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "not_any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-flow-run-1",
        "my-flow-run-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "any_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "deployment_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": true
    },
    "work_queue_name": {
      "operator": "and_",
      "any_": [
        "work_queue_1",
        "work_queue_2"
      ],
      "is_null_": true
    },
    "state": {
      "operator": "and_",
      "type": {
        "any_": [
          "SCHEDULED"
        ],
        "not_any_": [
          "SCHEDULED"
        ]
      },
      "name": {
        "any_": [
          "<string>"
        ],
        "not_any_": [
          "<string>"
        ]
      }
    },
    "flow_version": {
      "any_": [
        "<string>"
      ]
    },
    "start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "end_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "expected_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "next_scheduled_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "parent_flow_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "parent_task_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": true
    },
    "idempotency_key": {
      "any_": [
        "<string>"
      ],
      "not_any_": [
        "<string>"
      ]
    },
    "created_by": {
      "operator": "and_",
      "id_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "type_": [
        "DEPLOYMENT",
        "AUTOMATION"
      ],
      "is_null_": true
    }
  },
  "force": false,
  "limit": 50
}
'
{
  "results": [
    {
      "flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "ACCEPT",
      "details": {
        "type": "accept_details"
      },
      "state": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": "SCHEDULED",
        "name": "<string>",
        "timestamp": "2023-11-07T05:31:56Z",
        "message": "Run started",
        "data": "<unknown>",
        "state_details": {
          "flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "child_flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "scheduled_time": "2023-11-07T05:31:56Z",
          "cache_key": "<string>",
          "cache_expiration": "2023-11-07T05:31:56Z",
          "deferred": false,
          "untrackable_result": false,
          "pause_timeout": "2023-11-07T05:31:56Z",
          "pause_reschedule": false,
          "pause_key": "<string>",
          "run_input_keyset": {},
          "refresh_cache": true,
          "retriable": true,
          "transition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "task_parameters_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "traceparent": "<string>",
          "deployment_concurrency_lease_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      }
    }
  ]
}

Headers

x-prefect-api-version
string

Body

application/json
state
StateCreate · object
required

The state to set

flow_runs
FlowRunFilter · object

Filter criteria for flow runs to update

force
boolean
default:false

If false, orchestration rules will be applied that may alter or prevent the state transition. If True, orchestration rules are not applied.

limit
integer
default:50

Maximum number of flow runs to update. Defaults to 50.

Required range: 1 <= x <= 50

Response

Successful Response

Response from bulk set state operation.

results
FlowRunOrchestrationResult · object[]