---
isPublished: true
knowledgeIndex: false
hidden: true
noindex: true
template: "page.peb"
title: "Batch Generation Action (Docs and Flows) Flow Reference"
description: "Start a configured document-generation or Flow batch."
contentType: "reference"
audience: "admin,developer"
---

# Batch Generation Action (Docs and Flows)

Start a configured document-generation or Flow batch.
The namespaced Apex action name is `rooms__BatchAction`.

## Transaction summary

| Effect | Behavior |
| --- | --- |
| API callout | No HTTP callout in the action step. The selected batch can make callouts later. |
| Record writes | Queues a Salesforce batch job. Later processing creates or updates the Batch Run, generated documents, result records and Events as configured. |
| Platform event | The batch can publish lifecycle events during later processing. |
| Background work | Yes. Success reports job submission, not batch completion. |
| Email | The batch can send configured document or completion emails later. |

The selected definition determines whether the batch generates documents or invokes a Flow. Review its source records, template or Flow, limits and email settings before submission.

## Inputs

Required describes the Flow input setting. Additional configuration rules can still require a value.

| API name | Flow label | Required | Default or guidance |
| --- | --- | --- | --- |
| `batchDefinitionID` | Batch Definition ID | Yes | Select a valid Batch Definition record. |
| `batchSize` | Batch Size | No | Defaults to `10`. The definition and batch validation determine the effective size. |

## Outputs

| API name | Flow label | Meaning |
| --- | --- | --- |
| `batchDefinitionID` | Batch Definition ID | The selected definition ID. |
| `success` | Success | Whether validation and batch submission succeeded. |
| `message` | Message | Validation or submission error details. |

## Configure the Flow

1. Select the Batch Definition and review its configured operation.
2. Set Batch Size within the permitted range for the definition.
3. Store Success and Message. Continue only when Success is `true`.
4. Monitor the Batch Run and Salesforce job for completion.

Confirm the Flow user's Apex action access and access to the records or Files used by this operation. Review the configured Salesforce API connection user's access when the action makes an API request. For native Salesforce email, also confirm email access, permitted sender configuration and any required activity access.

## Troubleshooting

**Success is true but no document exists yet.** The action only submits the batch. Check its job and Batch Run before submitting it again.

**Validation fails.** Read Message. Check the definition, selected template or Flow, source records and effective batch size. A repeated submission can start another batch.

See the [Flow action catalog](/content/build/flows/index.md) for related actions and transaction guidance. Confirm that the action and input fields are available in the installed package.
