File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
src/content/docs/workflows Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,28 @@ export default {
266266}
267267```
268268
269+ ### createBatch
270+
271+ Create (trigger) a batch of new instance of the given Workflow, up to 100 instances at a time.
272+
273+ * <code >createBatch(batch: WorkflowInstanceCreateOptions[ ] ): Promise< ; WorkflowInstance[ ] > ; </code >
274+
275+ * ` batch ` - list of Options to pass when creating an instance, including a user-provided ID and payload parameters.
276+
277+ Each element of the ` batch ` list is expected to the
278+
279+ ``` ts
280+ // Create a new batch of 3 Workflow instances, each with its own ID and pass params to the Workflow instances
281+ const listOfInstances = [
282+ { id: " idFromBatch0" , params: { " hello" : " world-0" } },
283+ { id: " idFromBatch1" , params: { " hello" : " world-1" } },
284+ { id: " idFromBatch2" , params: { " hello" : " world-2" } }
285+ ];
286+ let instances = await env .MY_WORKFLOW .createBatch (listOfInstances );
287+ ```
288+
289+ Returns a list of ` WorkflowInstance ` .
290+
269291### get
270292
271293Get a specific Workflow instance by ID.
Original file line number Diff line number Diff line change @@ -188,6 +188,7 @@ class_name = "MyWorkflow"
188188You can then invoke the methods on this binding directly from your Worker script's ` env ` parameter. The ` Workflow ` type has methods for:
189189
190190* ` create() ` - creating (triggering) a new instance of the Workflow, returning the ID.
191+ * ` createBatch() ` - creating (triggering) a batch of new instances of the Workflow, returning the IDs.
191192* ` get() ` - retrieve a Workflow instance by its ID.
192193* ` status() ` - get the current status of a unique Workflow instance.
193194
You can’t perform that action at this time.
0 commit comments