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

[Skip to content](#_top)

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

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

[Instances](https://developers.cloudflare.com/api/go/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

client.Workflows.Instances.Bulk(ctx, workflowName, params) (\*SinglePage\[[InstanceBulkResponse](<https://developers.cloudflare.com/api/go/resources/workflows#(resource)%20workflows.instances%20%3E%20(model)%20InstanceBulkResponse%20%3E%20(schema)>)], error)

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

workflowName string

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>

params InstanceBulkParams

</summary>

AccountID param.Field\[string]

Path param

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

<details>

<summary>

Body param.Field\[\[]InstanceBulkParamsBody]

Body param

</summary>

InstanceID stringOptional

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>

InstanceRetention InstanceBulkParamsBodyInstanceRetentionOptional

</summary>

<details>

<summary>

ErrorRetention InstanceBulkParamsBodyInstanceRetentionErrorRetentionUnionOptional

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

</summary>

One of the following:

UnionInt

<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>

UnionString

<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>

SuccessRetention InstanceBulkParamsBodyInstanceRetentionSuccessRetentionUnionOptional

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

</summary>

One of the following:

UnionInt

<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>

UnionString

<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>

LocationHint InstanceBulkParamsBodyLocationHintOptional

</summary>

One of the following:

const InstanceBulkParamsBodyLocationHintWnam InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintWeur InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintEnam InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintEeur InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintApac InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintApacNe InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintApacSe InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintOc InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintSam InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintAfr InstanceBulkParamsBodyLocationHint = "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>

const InstanceBulkParamsBodyLocationHintMe InstanceBulkParamsBodyLocationHint = "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 stringOptional

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>

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

</details>

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

##### ReturnsExpand Collapse

<details>

<summary>

type InstanceBulkResponse struct{…}

</summary>

ID string

maxLength100

minLength1

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

<details>

<summary>

Status InstanceBulkResponseStatus

</summary>

One of the following:

const InstanceBulkResponseStatusQueued InstanceBulkResponseStatus = "queued"

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

const InstanceBulkResponseStatusRunning InstanceBulkResponseStatus = "running"

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

const InstanceBulkResponseStatusPaused InstanceBulkResponseStatus = "paused"

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

const InstanceBulkResponseStatusErrored InstanceBulkResponseStatus = "errored"

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

const InstanceBulkResponseStatusTerminated InstanceBulkResponseStatus = "terminated"

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

const InstanceBulkResponseStatusComplete InstanceBulkResponseStatus = "complete"

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

const InstanceBulkResponseStatusWaitingForPause InstanceBulkResponseStatus = "waitingForPause"

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

const InstanceBulkResponseStatusWaiting InstanceBulkResponseStatus = "waiting"

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

const InstanceBulkResponseStatusRollingBack InstanceBulkResponseStatus = "rollingBack"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20InstanceBulkResponse%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)%20InstanceBulkResponse%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

VersionID string

formatuuid

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

WorkflowID string

formatuuid

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

<details>

<summary>

TriggerSource InstanceBulkResponseTriggerSourceOptional

</summary>

One of the following:

const InstanceBulkResponseTriggerSourceUnknown InstanceBulkResponseTriggerSource = "unknown"

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

const InstanceBulkResponseTriggerSourceAPI InstanceBulkResponseTriggerSource = "api"

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

const InstanceBulkResponseTriggerSourceBinding InstanceBulkResponseTriggerSource = "binding"

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

const InstanceBulkResponseTriggerSourceEvent InstanceBulkResponseTriggerSource = "event"

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

const InstanceBulkResponseTriggerSourceCron InstanceBulkResponseTriggerSource = "cron"

<a href="#(resource)%20workflows.instances%20%3E%20(model)%20InstanceBulkResponse%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)%20InstanceBulkResponse%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)%20InstanceBulkResponse%20%3E%20(schema)>)

### Batch create new Workflow instances

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/workflows"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Workflows.Instances.Bulk(
    context.TODO(),
    "x",
    workflows.InstanceBulkParams{
      AccountID: cloudflare.F("account_id"),
      Body: []workflows.InstanceBulkParamsBody{workflows.InstanceBulkParamsBody{

      }},
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

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
  }
}
```