---
title: Batch create new Workflow instances
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[Workflows](https://developers.cloudflare.com/api/python/resources/workflows)

[Instances](https://developers.cloudflare.com/api/python/resources/workflows/subresources/instances)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Batch create new Workflow instances

workflows.instances.bulk(strworkflow\_name, InstanceBulkParams\*\*kwargs) -> SyncSinglePage\[[InstanceBulkResponse](<https://developers.cloudflare.com/api/python/resources/workflows#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)>)]

POST/accounts/{account\_id}/workflows/{workflow\_name}/instances/batch

Creates multiple workflow instances in a single batch operation.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Workers Scripts Write`

##### ParametersExpand Collapse

account\_id: str

[Link to this property](<#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

workflow\_name: str

maxLength64

minLength1

[Link to this property](<#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20workflow_name%20%3E%20(schema)>)

<details>

<summary>

body: Iterable\[Body]

</summary>

instance\_id: Optional\[str]

The system reserves IDs that consist of the <code>cf_</code> prefix and exactly 64 lowercase hexadecimal characters.

maximum100

minimum1

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_id">Link to this property</a>

<details>

<summary>

instance\_retention: Optional\[BodyInstanceRetention]

</summary>

<details>

<summary>

error\_retention: Optional\[Union\[int, str]]

Specifies the duration in milliseconds or as a string like ‘5 minutes’.

</summary>

One of the following:

int

Specifies the duration in milliseconds.

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention%20%3E%20(property)%20error_retention%20%3E%20(variant)%200">Link to this property</a>

str

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention%20%3E%20(property)%20error_retention%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention%20%3E%20(property)%20error_retention">Link to this property</a>

<details>

<summary>

success\_retention: Optional\[Union\[int, str]]

Specifies the duration in milliseconds or as a string like ‘5 minutes’.

</summary>

One of the following:

int

Specifies the duration in milliseconds.

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention%20%3E%20(property)%20success_retention%20%3E%20(variant)%200">Link to this property</a>

str

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention%20%3E%20(property)%20success_retention%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention%20%3E%20(property)%20success_retention">Link to this property</a>

</details>

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20instance_retention">Link to this property</a>

<details>

<summary>

location\_hint: Optional\[Literal\["wnam", "weur", "enam", 8 more]]

</summary>

One of the following:

"wnam"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%200">Link to this property</a>

"weur"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%201">Link to this property</a>

"enam"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%202">Link to this property</a>

"eeur"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%203">Link to this property</a>

"apac"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%204">Link to this property</a>

"apac-ne"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%205">Link to this property</a>

"apac-se"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%206">Link to this property</a>

"oc"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%207">Link to this property</a>

"sam"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%208">Link to this property</a>

"afr"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%209">Link to this property</a>

"me"

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint%20%3E%20(member)%2010">Link to this property</a>

</details>

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20location_hint">Link to this property</a>

params: Optional\[str]

JSON-encoded event payload passed into the new instance.

<a href="#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20params">Link to this property</a>

</details>

[Link to this property](<#(resource)%20workflows.instances%20%3E%20(method)%20bulk%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class InstanceBulkResponse: …

</summary>

id: str

maxLength100

minLength1

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

status: Literal\["queued", "running", "paused", 6 more]

</summary>

One of the following:

"queued"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

"running"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

"paused"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

"errored"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%203">Link to this property</a>

"terminated"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%204">Link to this property</a>

"complete"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%205">Link to this property</a>

"waitingForPause"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%206">Link to this property</a>

"waiting"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%207">Link to this property</a>

"rollingBack"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%208">Link to this property</a>

</details>

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

version\_id: str

formatuuid

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20version_id">Link to this property</a>

workflow\_id: str

formatuuid

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20workflow_id">Link to this property</a>

<details>

<summary>

trigger\_source: Optional\[Literal\["unknown", "api", "binding", 2 more]]

</summary>

One of the following:

"unknown"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20trigger_source%20%3E%20(member)%200">Link to this property</a>

"api"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20trigger_source%20%3E%20(member)%201">Link to this property</a>

"binding"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20trigger_source%20%3E%20(member)%202">Link to this property</a>

"event"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20trigger_source%20%3E%20(member)%203">Link to this property</a>

"cron"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20trigger_source%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)%20%3E%20(property)%20trigger_source">Link to this property</a>

</details>

[Link to this property](<#(resource)%20workflows.instances%20%3E%20(model)%20instance_bulk_response%20%3E%20(schema)>)

### Batch create new Workflow instances

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.workflows.instances.bulk(
    workflow_name="x",
    account_id="account_id",
    body=[{}],
)
page = page.result[0]
print(page.id)
```

200 example

```
{
  "errors": [],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "x",
      "status": "queued",
      "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "trigger_source": "unknown"
    }
  ],
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0,
    "total_pages": 0
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "x",
      "status": "queued",
      "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "trigger_source": "unknown"
    }
  ],
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0,
    "total_pages": 0
  }
}
```