<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# Workflow Templates — API Reference

## Workflow Execution

```bash
# Run workflow
nuclei -u https://target.com -w workflow.yaml -json

# With severity filter
nuclei -u https://target.com -w workflow.yaml -severity critical,high

# Bulk targets
nuclei -l targets.txt -w workflow.yaml -json -o results.json

# Multiple workflows
nuclei -u https://target.com -w workflow1.yaml -w workflow2.yaml
```

## Workflow Structure

```yaml
# Basic structure
workflows:
  - template: path/to/detect.yaml      # Parent template
    subtemplates:                        # Run if parent matches
      - template: path/to/exploit.yaml
      - tags: tagname                   # Tag-based routing
        templates:
          - path/to/dir/
```

## Workflow Fields

| Field | Type | Description |
|-------|------|-------------|
| `template` | string | Path to template file |
| `templates` | list | Paths to template files or directories |
| `subtemplates` | list | Templates to run if parent matches |
| `tags` | string | Tag filter for subtemplate routing |
| `matchers` | list | Custom match conditions for routing |

## Execution Flow

```
Parent Template Executes
    ├── Match Found → Run Subtemplates
    │   ├── Tag Match → Run Tag-Filtered Templates
    │   └── No Tag → Run All Subtemplates
    └── No Match → Skip Subtemplates
```

## CLI Options

| Flag | Description |
|------|-------------|
| `-w` | Workflow file path |
| `-severity` | Filter by severity |
| `-tags` | Filter by tags within workflow |
| `-rate-limit` | Requests per second |
| `-bulk-size` | Parallel host count |
| `-timeout` | Per-request timeout |
| `-json` | JSON output |
| `-silent` | Suppress banner |
| `-o` | Output file |

## Template Path Resolution

```yaml
# Relative to nuclei-templates directory
- template: technologies/tech-detect.yaml

# Relative to workflow file location
- template: ./local-detect.yaml

# Directory path (all templates in dir)
- templates:
    - cves/apache/

# Absolute path
- template: /path/to/template.yaml
```
