# Reference: Document Actions Framework

### Quick facts

| Attribute              | Value                         |
| ---------------------- | ----------------------------- |
| Supported entry points | SDK, LWC generation, S-Sign   |
| Unsupported methods    | Legacy buttons, Batch SDK     |
| Action object          | `SDOC__Action__c`             |
| Parent object          | `SDOC__SDTemplate__c`         |
| Execution model        | Asynchronous after generation |

{% hint style="warning" %}
Document Actions do not run in Batch SDK flows.
{% endhint %}

### Field reference

| API name               | Label       | Type      | Use                               |
| ---------------------- | ----------- | --------- | --------------------------------- |
| `Name`                 | Action Name | Text      | Admin-facing label for the action |
| `SDOC__Template__c`    | Template    | Lookup    | Template that triggers the action |
| `SDOC__Apex_Class__c`  | Apex\_Class | Text area | Provider action class name        |
| `SDOC__Description__c` | Description | Text area | Optional admin notes              |
| `SDOC__Parameters__c`  | Parameters  | Text area | Provider settings as valid JSON   |

{% hint style="warning" %}
`SDOC__Parameters__c` must be valid JSON.

Invalid JSON prevents the action from running.
{% endhint %}

### Provider-specific prerequisites

#### Google Drive

* Use `StoreInGoogleDriveAction`
* Configure a working Google auth provider
* Configure a working named credential
* Confirm the destination folder is reachable

#### AWS S3

* Use `StoreInAWSS3Action`
* Configure AWS Signature Version 4 authentication
* Confirm the target bucket exists
* Confirm the target path is writable

#### SharePoint

* Use `StoreInSharepointAction`
* Configure working Microsoft authentication
* Confirm the target site and document library exist
* Confirm the destination path is reachable

#### Box

* Use `SDBoxUploadController`
* Configure working Box authentication
* Confirm the target folder exists
* Confirm the destination path is reachable

### Execution behavior

Document Actions run after document generation finishes.

They do not change template rendering.

They do not replace the generated Salesforce file.

The flow is:

1. S-Docs generates the document in Salesforce.
2. The template's Document Actions are queued.
3. Each action runs after generation completes.
4. The provider upload happens asynchronously.
5. The external file may appear after a short delay.

Practical implications:

* a generated Salesforce file can exist before the upload finishes
* a short upload delay is normal
* re-running generation will not fix auth or JSON issues by itself

### Batch SDK failure note and workaround

Document Actions are not supported with Batch SDK.

If a template with Document Actions is used in batch generation, the actions will not run.

In some batch flows, you may also see queueing failures such as:

* `Too many queueable jobs added to queue`

Recommended workaround:

1. Clone the template.
2. Remove Document Actions from the batch version.
3. Use the action-enabled template only in SDK, LWC, or S-Sign flows.
4. Use the batch-safe template for `generateDocsInBatch`.

Related pages:

* [Method: generateDocsInBatch](/developer-hub/document-generation-workflows/apex-and-programmatic-automation/software-development-kit/document-generation/method-generatedocsinbatch.md)
* [SDK Batch: Too Many Queueable Jobs Added to Queue](/developer-hub/document-generation-workflows/apex-and-programmatic-automation/software-development-kit/batch-sdk/sdk-batch-too-many-queueable-jobs-added-to-queue.md)

### Troubleshooting

<details>

<summary>The document generated, but nothing uploaded</summary>

Check these items:

* the action is attached to the template you used
* the action class matches the provider
* provider authentication is still valid
* the `Parameters` value is valid JSON
* the target folder, bucket, or library still exists

</details>

<details>

<summary>The upload target is wrong</summary>

Review the values in `SDOC__Parameters__c`.

Most default setups use a fixed destination path.

Dynamic destination logic needs custom implementation.

</details>

<details>

<summary>The action works in one flow, but not in batch generation</summary>

Document Actions are not supported in Batch SDK.

Use a non-batch generation path instead.

If you need both patterns, keep a separate batch-safe template.

</details>

<details>

<summary>The upload appears later than expected</summary>

A short delay is expected.

The action runs after document generation completes.

</details>

<details>

<summary>The Parameters field keeps failing</summary>

Check these items:

* the JSON starts with `{` and ends with `}`
* all keys use double quotes
* all string values use double quotes
* there are no trailing commas
* the destination values are valid for the target system

</details>

### Related page

* [Set Up Document Actions Framework](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/B8rmYCOTXmEZIoYHodj4)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/developer-hub/document-lifecycle/document-actions/reference-document-actions-framework.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
