> For the complete documentation index, see [llms.txt](https://docs.middle.app/middle-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.middle.app/middle-docs/product/accounts/workflow-steps/bulk-workflow-execution.md).

# Bulk workflow execution

Run another workflow against stored records of a selected type

The **Bulk Workflow Execution** step starts another workflow using a record type you select. Use it when a process needs to operate on a collection of records.

## Configure the step

1. Add a **Bulk Workflow Execution** step to your workflow.
2. Select the workflow you want to run.
3. Select the synced record type that workflow should operate on.

![Select the workflow and data Middle should bulk execute on](https://932524191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mks_UuU2atghAuA9bQz%2Fuploads%2Fy8lta12KKAsXdEyqcoj8%2FScreen%20Shot%202021-10-27%20at%2011.13.42%20AM.png?alt=media\&token=ad1d8ef6-af18-4be1-bdd2-32fbb2431114)

## Use with a scheduled trigger

Combine this step with a [scheduled trigger](https://docs.middle.app/middle-docs/accounts/workflow-triggers#scheduled-workflows) to process stored records at a specified time.

For example, a scheduled workflow could start a bulk execution of a second workflow that checks member records and sends qualifying members to another system.

The scheduled workflow starts without record inputs. The workflow called by the bulk step should be configured to receive the selected record type in its Begin Step.

## Pass a single record to another workflow

Use the **Primary Key Filter** to run another workflow for a single stored record. This lets you reuse a workflow for one member, sale, or other record selected by its primary ID.

1. Configure the receiving workflow's Begin Step to accept the record type you want to pass, and publish a live version of that workflow.
2. In the calling workflow, add a **Bulk Workflow Execution** step. Select the **Workflow to execute**, **App connection**, and **Resource** containing the record.
3. Set **Primary Key Filter** to an array containing just that record's primary ID. You can use a fixed ID or build a one-item array from a workflow variable, such as the triggering record's or related record's primary ID.
4. Leave **Input record** and **Input record ID** blank in the step's **Input** configuration. Middle populates them automatically. Map any additional inputs the receiving workflow needs separately.

Middle runs the selected workflow for the matching stored member in that connection and resource. If no record matches the ID, no workflow execution is created for it. Leaving the PK filter unset does not restrict the selection to one record.

### Related documentation

{% content-ref url="/pages/-MlClKo-Xl6F31yC\_oE4" %}
[Triggers](https://docs.middle.app/middle-docs/product/accounts/workflow-triggers.md)
{% endcontent-ref %}

{% content-ref url="/pages/Vwqy0nudvSUYp5nAgc69" %}
[Begin](https://docs.middle.app/middle-docs/product/accounts/workflow-steps/begin.md)
{% endcontent-ref %}

{% content-ref url="/pages/pcP4mw1mPD5gFV4V4fez" %}
[Decision](https://docs.middle.app/middle-docs/product/accounts/workflow-steps/decision.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.middle.app/middle-docs/product/accounts/workflow-steps/bulk-workflow-execution.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
