This guide explains how to use a Workflow to streamline the process of linking SOC 2 documents to an entity.
Create a Workflow to link SOC 2 documents to an entity
Prerequisites
Before getting started:
- You must have the
Edit Workflows permission to create the Workflow, and the Execute Workflow runs permission to run it.
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.
Step 1.2: Add blocks to the Workflow
Add the following blocks to your Workflow:
Retrieve entity descriptor
This block retrieves the entity descriptor.
- Click + in the center of the page. In the block library modal, select the Cortex > Retrieve entity descriptor block.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Retrieve entity descriptor and the slug retrieve-entity-descriptor.
- Configure the block:
- Entity ID or tag:
{{context.entity.tag}}
- At the bottom of the side panel, click Save.
This step retrieves the entity tag, validates required inputs, normalizes the data, and returns the updated link object in YAML format for use in the next Workflow block.
- Click + in the center of the page. In the block library modal, select the Cortex > Retrieve entity descriptor block.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
JavaScript and the slug javascript.
- In the text editor under the JavaScript header, enter the following:
- At the bottom of the side panel, click Save.
This block takes the object returned in the previous block and uses it to update the entity.
- Click + in the center of the page. In the block library modal, select the Cortex > Create or update entity block.
- In the side panel, enter a name and unique slug for the block.
- In this example, we use the name
Create or update entity and the slug create-or-update-entity.
- Configure the block:
- Descriptor:
{{{actions.javascript.outputs.result.updatedDescriptor}}}
- At the bottom of the side panel, click Save.
When you are finished adding blocks, click Save workflow in the upper right corner of the page.
Step 2: Run the Workflow
- In the list of Workflows, locate the “Link SOC 2 Documents to Entity” Workflow and click Run.
When you run the Workflow, the following events happen:
- The Workflow pauses to collect a response from the user during the User Input block. The user selects an entity, then enters a link type and link URL.
- The next step runs, retrieving the entity descriptor.
- The JavaScript block runs, which does the following:
- It retrieves the entity descriptor from the previous block, and it retrieves the link type and URL from the initial block. It validates that the required inputs exist.
- It normalizes the link type. It parses the descriptor string into a JavaScript object.
- It creates a new link object with url, name, and type, and it only adds the new link if it doesn’t already exist.
- It converts the updated object back to YAML format, and returns
{ updatedDescriptor } for use in subsequent Workflow blocks.
- The “Create or update entity” block runs, updating the entity with the
updatedDescriptor output of the previous block.
Last modified on September 28, 2026