This guide explains how to use a Workflow to let entity owners accept verification for many entities at once during a verification period.
By default, owners verify entities one at a time from each entity’s page. With this Workflow, an owner picks an open verification period, selects the entities they own, and marks all of them as verified correct in a single run.
Link to this Workflow in your verification period’s Verification instructions, for example: “To bulk accept the entities you own, run the Bulk Entity Verification workflow: [link]”. Owners can then choose to verify one entity from its entity page, or open the Workflow to accept several at once.
Create a Workflow to bulk accept entity verifications
Prerequisites
Before getting started:
- You must have the
Edit Workflows permission to create the Workflow, and the Execute Workflow runs permission to run it.
- To verify entities, at least one verification period must be open. If none are open, the run ends with a “No open verification periods found” message and nothing is verified.
- The person running the Workflow must own the entities they verify, and hold any roles the verification period requires.
Step 1: Create the Workflow
You can create a Workflow in the Cortex UI or via the Cortex CLI.
Add the Workflow via CLI
You can use the Cortex CLI to add the example Workflow to your workspace. This allows you to quickly set up the example configuration then iterate on it for your own use case. Expand the tile below to learn more:Import the Workflow via CLI
- Save the Workflow example YAML file below:
- Use the Cortex CLI to run this command, using the path to your Workflow YAML file:
cortex workflows create -f <path-to-your-workflow.yaml>
- In Cortex, navigate to Workflows. In the upper right corner, click +Create workflow. Choose a blank Workflow.
- Follow the documentation to configure the basic settings for your Workflow.
- In this example, we use the name
Bulk Entity Verification.
- Leave the scope set to Global, so the Workflow isn’t tied to a single entity.
- In the Workflow settings, add a variable:
- Slug:
result-message
- Type: String
- Set the Run response template to
{{variables.result-message}}.
Step 1.2: Add blocks to the Workflow
Add the following blocks to your Workflow:Fetch open verification periods
This block gets the verification periods that are open today.
- Click + in the center of the page. In the block library modal, choose HTTP request.
- In the block configuration side panel, enter a name and unique slug for this block.
- In this example, we use the name
Fetch open verification periods and the slug fetch-periods.
- Configure the block:
- HTTP method: GET
- Integration: Cortex
- URL:
/api/v1/verification-periods?isActive=true&pageSize=250&page=0
- Headers:
Accept: application/json
- At the bottom of the side panel, click Save.
Format periods for dropdown
This block stops the run with a clear message when no verification period is open.
- Click + below the previous block. In the block library modal, choose Branch.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Any open periods? and the slug check-periods.
- Add a conditional branch:
- Name: Open periods found
- Slug:
has-open-periods
- Expression:
size(actions["format-periods"].outputs.result) > 0
- Name the fallback branch
No open periods, with the slug no-open-periods.
- At the bottom of the side panel, click Save.
Set 'no periods found' message
On the No open periods branch, this block sets the message the user sees.
- On the No open periods branch, click +. In the block library modal, choose Set variables.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Set 'no periods found' message and the slug no-periods-message.
- Set the
result-message variable using JavaScript:
- At the bottom of the side panel, click Save.
Select entities to verify
On the Open periods found branch, this block collects the period, the entities, and a confirmation from the user.
- On the Open periods found branch, click +. In the block library modal, choose User input.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Select entities to verify and the slug select-entities.
- Click +Add user input. Add the following:
- Name: Verification period
- Key: period
- Type: Select
- Path to override value:
actions.format-periods.outputs.result
- Click Add input.
- Click +Add user input. Add the following:
- Name: Entities to verify
- Key: entities
- Type: Select
- Data source: Cortex entity
- Enable Allow multiple, and limit the options to entities the runner owns.
- Click Add input.
- Click +Add user input. Add the following:
- Name: I confirm these entities’ details are correct
- Key: confirm
- Type: Toggle
- Click Add input.
- At the bottom of the side panel, click Save.
Build verification payload
This block checks that the user turned on the confirmation toggle, reads the period ID from the selected option, and builds one request body for all of the selected entities.
- Click + below the previous block. In the block library modal, choose JQ.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Build verification payload and the slug build-payload.
- Enter the following JQ expression:
- At the bottom of the side panel, click Save.
This block sends every selected entity to the bulk verification endpoint in a single request.
- Click + below the previous block. In the block library modal, choose HTTP request.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Bulk verify and the slug bulk-verify.
- Configure the block:
- HTTP method: PUT
- Integration: Cortex
- URL:
/api/v1/verifications
- Headers:
Content-Type: application/json
- Payload:
{{{actions.build-payload.outputs.result.body}}}
- At the bottom of the side panel, click Save.
This block sets the message the user sees after the bulk request. It reports how many entities were verified and lists any that failed.
- Click + below the previous block. In the block library modal, choose Set variables.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Set result summary and the slug result-summary.
- Set the
result-message variable using JavaScript:
- At the bottom of the side panel, click Save.
Step 2: Run the Workflow
In the list of Workflows, locate the “Bulk Entity Verification” Workflow and click Run.
When you run the Workflow, the following events happen:
- The Workflow retrieves the verification periods that are open today and formats them as dropdown options.
- If no period is open, the run ends with the message “No open verification periods found.” Nothing is verified.
- If at least one period is open, the Workflow pauses to collect a response from the user during the User input block. The user selects a verification period, selects one or more entities they own, and turns on the confirmation toggle.
- The JQ block checks the confirmation toggle. If it is off, the run fails and nothing is verified. Otherwise, it builds a single request that marks each selected entity as
VERIFIED_CORRECT for the selected period.
- The HTTP request block sends the request to the bulk verification endpoint.
- The Workflow sets the run response to a summary of the result, such as “Verified 3 entities as correct for Q4 ownership review (vp0a1b2c3d4e5f6789).”
The bulk verification endpoint evaluates each entity separately. It can return 200 OK even when some entities were not recorded, for example because the user doesn’t own them. Those entities appear under errors in the response, and the Workflow lists them in the run summary.