> For the complete documentation index, see [llms.txt](https://docs.gradient.works/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gradient.works/kb/automation-builder-kit-abk/actions/dynamic-books/retrievalaction.md).

# Retrieval

{% hint style="info" %}
Bookbuilder must be enabled to use this action.
{% endhint %}

Use this action to execute an account retrieval to pull accounts from reps books. When used in a schedule-triggered flow, this action allows for automatically pulling back unworked accounts on a regular schedule from a team of reps so that the accounts can be redistributed to others.

To use this action, first set up a retrieval template in Bookbuilder to define the retrieval you’d like to use. Then in the Flow action, select the Retrieval Template you’ve previously configured to run in the flow.

Use the assignment or assignments output to see information about the assignments that were performed as part of a Flow run. You can use the individual [Assignment](/kb/automation-builder-kit-abk/models/assignment.md) objects as an input to other actions such as [Send Single Assignment Email](/kb/automation-builder-kit-abk/actions/next-steps/sendsingleemailnotificationaction.md).

## Inputs

Please note that you will not directly interact with these input fields as you do with some Flow Actions. Instead the Gradient Works custom editor takes care of the heavy lifting.

| Name                             | Required | Type                        | Description                                                                       |
| -------------------------------- | -------- | --------------------------- | --------------------------------------------------------------------------------- |
| distributionDefinitionIdentifier | No       | String                      | The Retrieval Template Id or Name from Bookbuilder to be used for this Retrieval. |
| distributionDefinitionRecord     | No       | DistributionDefinition\_\_c | Retrieval Template from Bookbuilder to be used for this Retrieval.                |

## Outputs

| Name         | Type                                                                    | Description                                                              |
| ------------ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| assignments  | List<[Assignment](/kb/automation-builder-kit-abk/models/assignment.md)> | Information about each of the assignments from the Retrieval.            |
| count        | Integer                                                                 | The total number of successful assignments performed from the Retrieval. |
| errorMessage | String                                                                  | Message describing any errors in the Retrieval.                          |
| isSuccess    | Boolean                                                                 | Whether the Retrieval was successful or not.                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.gradient.works/kb/automation-builder-kit-abk/actions/dynamic-books/retrievalaction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
