> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecontra.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows

> A workflow is an ordered list of verification nodes. Pick a built-in or compose your own.

## What's in a workflow

A workflow is:

```typescript theme={null}
{
  workflow_id: string,
  name: string,
  type: 'user' | 'business',
  nodes: [
    { type: 'document_verification', required: true,  provider: 'smile_id:job_6' },
    { type: 'aml_screening',         required: true,  provider: 'smile_id:aml' },
    // …
  ],
  built_in: boolean
}
```

## Built-in workflows

| `workflow_id`       | Nodes                                           |
| ------------------- | ----------------------------------------------- |
| `standard_kyc`      | `document_verification` · `aml_screening`       |
| `enhanced_kyc`      | + `biometric_kyc` · `phone_verification`        |
| `institutional_kyc` | + `address_verification` · `email_verification` |
| `aml_only`          | `aml_screening`                                 |
| `kyb`               | `business_verification` · `aml_screening`       |

## Custom workflows

```bash theme={null}
curl -X POST https://identity.contra.id/v1/workflows \
  -H "x-api-key: $CONTRA_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "Seller Onboarding",
    "type": "user",
    "nodes": [
      { "type": "document_verification", "required": true },
      { "type": "aml_screening",         "required": true },
      { "type": "phone_verification",    "required": false }
    ]
  }'
```

## Execution rules

* Nodes execute **in order**.
* A **required** node returning `declined` → session `declined`, stop.
* Any node returning `review` → session `in_review`, stop.
* All nodes pass → session `approved` + **ContraToken** issued.
* A non-required `declined` node → continue.
