The fastest way to get a correct definition is to build the Workflow in the UI first, then click Export Workflow YAML (see Workflows as code). The export shows the exact values Cortex expects, including IDs that are specific to your workspace.
How a block appears in a Workflow definition
In a definition, blocks are listed underactions. Each entry has the same outer fields, and the block-specific configuration sits under schema. The schema.type value sets which other fields the block takes.
Referencing run data in block fields
Blocks can read the Workflow run state through three top-level keys:context, actions, and variables. Each block writes its result to actions.<slug>.outputs. How you reference a value depends on the field:
- Text fields (URLs, headers, payloads, messages, descriptions) - Use Mustache templates, such as
{{variables.app-name}}or{{actions.get-user-email.outputs.result}}. Use three curly braces to avoid HTML escaping. - JQ expressions - Start with a dot, such as
.variables.app-name. - CEL expressions, JavaScript, and path fields - Use dot paths without a leading dot, such as
variables.app-name. - Slugs that contain a hyphen - In CEL, JavaScript, and JQ, quote them:
actions["get-user-email"](or.actions["get-user-email"]in JQ).
Core blocks
Branch (CONDITIONAL_BRANCH)
Cortex evaluates the paths in order and takes the first one whose expression returns true. If none do, it takes the fallback path. See Branch for how paths work.
Each path in
branches takes the following fields. fallbackBranch takes the same fields except expression, and its type is FALLBACK.
Outputs:
actions.<slug>.outputs.conditions.<path-slug>.result
Data transformation (JQ)
Outputs:
actions.<slug>.outputs.result
HTTP request (HTTP_REQUEST)
Outputs:
actions.<slug>.outputs.status, actions.<slug>.outputs.headers, actions.<slug>.outputs.body
Asynchronous HTTP request (HTTP_REQUEST_ASYNC)
This block takes all of the HTTP request fields, plus a timeout. The Workflow pauses until the external system calls the callback URL (available as {{callbackUrl}}) or the timeout expires. See Asynchronous HTTP request for the callback format.
JavaScript (JAVASCRIPT)
Outputs:
actions.<slug>.outputs.result, plus any top-level keys of the returned object.
Manual approval (MANUAL_APPROVAL)
Run Workflow (RUN_WORKFLOW)
Outputs:
actions.<slug>.outputs.runId. With waitForCompletion: true, also status, runResponse, and variables. See Run Workflow.
Scaffolder (SCAFFOLDER)
Set variable(s) (SET_VARIABLES)
The variables must be declared in the Workflow’s variables list (see Configuring Workflow settings).
User input (USER_INPUT)
Outputs:
actions.<slug>.outputs.<key> for each field.
User input field types
Every field takes these common keys:
Each type also takes the keys below. Keys in bold are required.
Notes on these keys:
- If you leave out a required boolean (
disabled,allowMultiple,allowAdditionalOptions,limitEntitiesToRunnerUserScope, orshouldDisplayOptionsAsHierarchy), Cortex usesfalse. If you leave outformat, Cortex usesDECIMALfor numbers andDATEfor dates. optionsLabelssets display labels in the same order asoptions. If you leave it out, Cortex shows the option values.entityFilteracceptstypeFilter({types: [service, team]}),groupTags,excludedGroupTags,teamIds,domainIds, andemailOwners. Use{}to allow all entities.- For
CORTEX_USER_FIELD,filteracceptsteamCidsanduserEmails. Use{}to allow all users.
Nested form fields
ANESTED_FORM_FIELD lets the user enter a list of items. It takes the common keys, plus:
Outputs: an array of objects for
OBJECT (for example, [{"name": "db-1", "size": 100}]), or a flat array for single values (for example, [8080, 8443]).
Input overrides
inputOverrides on User input and Scaffolder blocks fill a field from a value earlier in the run.
Integration blocks
Most prebuilt integration blocks use theADVANCED_HTTP_REQUEST type and identify the action with actionIdentifier. Each action has its own set of inputs, so the easiest way to get the identifier and input keys is to add the block in the UI and export the Workflow YAML.