> This page is for version v2024-12-23.
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Conditional Workflow Step

> Guide to configuring and using conditional routing inside a workflow.

The conditional worfklow step allows you to apply conditional logic and routing to your workflows. Some example use cases include:

1. Routing to human review if an important value is `null`.
2. Routing to the correct downstream processor if a numeric value you extract is `>= 10`.

The conditional step can use these logical operators: `=`, `≥`, `≤`, `IS NULL`, and `Contains`.

## Configuration

To configure the Conditional step, you can start by adding it to your workflow from the add step menu.

![](/_fern-img/315c4354637e877a754a7e7adb5bd89c2c3dea220627f16ee0b276bb86c59884.webp)

Once you drag the step into your workflow, you can configure it in the UI. Here, we set up the conditional step to lead to a human review if a `delivery_address` we extracted is `null`. Note that you can add multiple conditions with the "Add condition" button at the bottom of the conditional step UI, allowing you to make more complex logic.

![](/_fern-img/0da59796747a68d46cd231f0a0e5b0f598c8109d6600be28827d46adbc9496a1.webp)

Let's examine how this works:

#### Fields on the extractor

The Extractor we use in the `extraction1` step is configured to have a field `delivery_address`. This was set within that Extractor's processor settings.

![](/_fern-img/9306464153171671c01bb30057678a4f2dbf64cc05d05519846db32a5d7447f9.webp)

#### Accessing the data in the conditional step

The conditional step we added, `conditional1`, has a term `{{extraction1.output.value.delivery_address}}`. Note the `{{}}` are required to use dynamic values. This grabs the extracted value from the preceding extraction step. Let's break it down:

`extraction1` - The name of the step feeding into the conditional

`.output` - This is the notation to access the actual outputted payload from the Extraction processor. View the "Output Type" section for your specific processor for more details.

`.value` - This is a field on the processor output shape for Extractors. See the above guide for more details.

`.delivery_address` - The actual field inside `.value` that we wish to run logic against.

In the below image, we've run a document missing a delivery address, through a workflow. Viewing the workflow run with the JSON view toggle in the top right shows us the full structure of the output. Here, we can see `.value.delivery_address` shows us we extracted `null` for that field. We can also see the workflow is in "review" since it was routed to conditional review based on our logic.

Similarly, other fields in the output can be referenced, such as the processor output's `metadata` or anything else you see present.

![](/_fern-img/bf17a1e58239932dfc589787486a6a9e05f335377c99be6d7b54b73717e4ae58.webp)

## Using Metadata

When running a workflow via our API, users can supply a `metadata` field to the workflow. This is useful for identifying your workflowRun. The metadata object is returned back to you in your API responses and webhooks. The `metadata` field can also be accessed in the conditional step.

Imagine this is the API request you make to run the workflow:

```bash
curl -X POST https://api.extend.ai/workflow_runs \
  -H "Authorization: Bearer sk_zKp9mQn8vWr_Lht4Ys2kP" \
  -H "X-Extend-Api-Version: 2025-04-21" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "workflow_kJmNpQrSt1wXyA_hKlMnE",
    "files": [
      { "fileUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" }
    ],
    "metadata": {
      "provider_name": "cigna"
    }
  }'
```

In the conditional step you can then reference the metadata value with:

`{{metadata.provider_name}}`

We can then use conditional logic on this value, such as checking if the `{{metadata.provider_name}}` equals `"cigna"`.

![](/_fern-img/2de37b1a6803305797628d1da9b1f29bbcfadcd4c241f2c8913bc4c325df322d.webp)

## Using External Data Validation Results

The External Data Validation step is a powerful tool that allows you to validate data within a workflow against your own system, provided that your system exposes an API for Extend to interact with.

The results from your external data validation can be used in the conditional logic step of your workflows. See the [External Data Validation Step results guide](/2024-12-23/product/workflows/external-data-validation-step#using-the-results) for more info.

## Summary of Accessible Data

The output of any processor step: `{{processorStepName.output.*}}`

Metadata for the workflow: `{{metadata.*}}`

External data validation: `{{externalDataValidationStepName.output.response.data}}`