Configuring blocks
Blocks (formerly known as actions) are the building blocks of Workflows. Workflows are made up of individual blocks, which are each responsible for a specific task. A Workflow allows you to run a sequence of tasks that can reference contextual data from your workspace.
Cortex offers a searchable library of blocks that can be added to your Workflows:
Core blocks
Perform actions such as requiring a manual approval on a step within a Workflow.
Cortex blocks
Perform Cortex-based actions, such as getting Scorecard scores for an entity.
Note that Cortex blocks use the permissions of the Workflow's initiating user. If the user does not have permissions to execute the action associated with a given block, the block will fail.
See an example using a Cortex "Add custom data" block in Workflow example: Scaffolding a new service with custom data based on user input.
Third-party integration blocks
For example, you can add a block that creates a new repository in GitHub, or you can add a block that creates a new incident in ServiceNow.
Note that third-party integration blocks use the permissions associated with the integration token configured in Cortex settings.

Configuring blocks in a workflow
After you have created a Workflow and configured its basic settings, you are ready to add and configure blocks.
You must have the Edit Workflows
permission to create, update, and delete Workflows.
Note: The slug for each block must be unique across a Workflow.
Configure an integration block
Cortex provides prebuilt blocks to perform a variety of actions for the following integrations:
AWS: Create an S3 bucket, run EC2 instances, create an IAM role, and more.
Azure DevOps: Create a branch, create a repository, run a pipeline, and more.
Bitbucket: Create a repository, get a file from a repository, and more.
GitHub: Create a pull request, manage teams, trigger a GitHub workflow, and more.
GitLab: Create a project, run pipelines, update files, and more.
Jenkins: Run a build with or without parameters.
LaunchDarkly: Create a feature flag, delete a feature flag, and more.
Microsoft Teams: Send a Microsoft Teams message.
PagerDuty: Create an incident, create a team, list escalation policies, and more.
ServiceNow: Create an incident, list groups, get user information, and more.
Slack: Get channel info, list users, send a message, and more.
Before adding an integration-based block, make sure you have configured the integration with the correct permissions described in Cortex's documentation for that integration.
While viewing the blocks library, click the integration block you want to add.
The necessary permissions needed for the block are included in the block library. For example:
At the bottom of the modal, click Insert.
The block is inserted into your Workflow, and a configuration form appears in the side panel.
In the side panel, configure the block metadata:
Block name: Add a name for your block.
Slug: Add a unique identifier for your block.
When the integration supports multiple configurations, you'll be prompted to select the configuration alias to use with the block. The block will authenticate using the selected configuration, so ensure that you select the configuration with the required permissions.
Additional input fields differ depending on which block you choose.
These inputs are all template-able using Mustache-syntax (
{{ ... }}
). For fields that are not textual, click the "Path" icon on the right of the input to switch to Mustache-based templating.
Number input Number input in templating mode At the bottom of the side panel, click Save.
Additional instructions for Slack blocks
For additional information on configuring a Slack block, see below.
Configure a core block
Expand the tiles below for instructions on configuring each type of block.
Duplicating a block
There may be an instance where you want to repeat a task within your Workflow. It is possible to duplicate an existing block.
To duplicate a block:
In Cortex, navigate to the Workflow that contains the block you want to copy.
Click the 3 dots icon on the right side of the block.
In the dropdown menu, click Duplicate block.
A copy of the block will be duplicated in place within the Workflow.
If needed, drag and drop the block to reorder it in the Workflow.
Using request signing with Workflow blocks
If you're using a Workflow as a way to trigger hooks into internal tooling, we recommend validating that the request is actually originating from Cortex using request signing. Signing secrets are added to requests coming from Workflow blocks.
We add the following headers to each request made by Cortex. Use these headers to verify that the request is valid and originated from Cortex:
x-cortex-timestamp
This header uses the current timestamp in millis, and is used to prevent replay attacks. Cortex will sign the requests using the format
<timestamp>.<body>
.
x-cortex-timestamp-only-signature-256
This header calculates the SHA256 signature using only the timestamp. Use this header in environments where the HTTP request body is unavailable due to platform limitations.
x-cortex-signature-256
This header uses the SHA256 algorithm. For security best practices, we recommend using this header rather than
x-cortex-signature
.
x-cortex-signature
This header uses the SHA1 algorithm and exists for backward compatibility. SHA1 is considered unsafe and this signature should be considered deprecated.
To configure a signing secret:
In Cortex, navigate to Settings > Secrets, then scroll down to the "Request signing secret" section.
Enter a secret into the text field, then click Save secret.
Calculate the signature (an RFC2104 HMAC):
Create a string with the value
$timestamp.$requestBody
if the request body is non-null OR$timestamp
if the request body is null.Calculate an HMAC using the SHA256 algorithm. Use the Secret you provided to Cortex as the key and the string from Step 1 as the payload.
Verify that the
x-cortex-signature-256
matches the HMAC calculated in Step 2.
Referencing a Workflow state in a block
Learn how to reference a Workflow state in a block.
Additional information on Workflows
To learn more about Workflows, see the Workflows documentation.
Last updated
Was this helpful?