# List Referral Documents

> Perform List Referral Documents through athenahealth.

Source: [https://genhealth.ai/docs/workflows/integrations/athenahealth/athena_list_referral_documents](https://genhealth.ai/docs/workflows/integrations/athenahealth/athena_list_referral_documents)

Integration: [athenahealth](https://genhealth.ai/docs/workflows/integrations/athenahealth.md)

- Handler: `athena_list_referral_documents`

- Connection type: `athenahealth`

## Use in a workflow

Copy this discovered node config, fill params from the input contract, and validate the complete graph. Integration results are available as {{node_id.default.field}}. Check business success before dependent writes; completion alone does not prove business success.

```json

{
  "_group": "athenahealth",
  "params": {
    "per_page": 50,
    "max_items": 200,
    "start_page": 0,
    "exclude_urgent": false,
    "document_sub_classes": "ADMIN_REFERRAL"
  },
  "handler": "athena_list_referral_documents"
}

```

[Action contracts](https://genhealth.ai/docs/workflows/action-contracts.md) · [Run recovery](https://genhealth.ai/docs/workflows/operations.md)

## Inputs

- `bucket_name` — Bucket Name (expression, required)
  Required literal value or workflow expression.
- `assigned_to` — Assigned To (expression, required)
  Required literal value or workflow expression.
- `subject_types` — Subject Types (expression)
  Optional literal value or workflow expression.
- `document_classes` — Document Classes (expression)
  Optional literal value or workflow expression.
- `document_sub_classes` — Document Sub Classes (expression)
  Optional literal value or workflow expression.
  Default: `"ADMIN_REFERRAL"`
- `statuses` — Statuses (expression)
  Optional literal value or workflow expression.
- `exclude_urgent` — Exclude Urgent (boolean)
  Optional true-or-false value.
  Default: `false`
- `per_page` — Per Page (number)
  Optional numeric value.
  Default: `50`
- `max_items` — Max Items (number)
  Optional numeric value.
  Default: `200`
- `start_page` — Start Page (number)
  Optional numeric value.
  Default: `0`
- `max_pages` — Max Pages (number)
  Optional numeric value.
- `sort_column` — Sort Column (expression)
  Optional literal value or workflow expression.
- `sort_direction` — Sort Direction (expression)
  Optional literal value or workflow expression.
- `sort_field` — Sort Field (expression)
  Optional literal value or workflow expression.

## Outputs

- `success` — Success
- `bucket_name` — Bucket Name
- `assigned_to` — Assigned To
- `source_context` — Source Context
- `documents` — Documents
- `document_count` — Document Count
- `count` — Count
- `document_ids` — Document Ids
- `scanned_count` — Scanned Count
- `filtered_out_count` — Filtered Out Count
- `bucket_total_count` — Bucket Total Count
- `start_page` — Start Page
- `pages_read` — Pages Read
- `truncated` — Truncated
- `has_previous_pages` — Has Previous Pages
- `window_limited` — Window Limited
- `subject_types_seen` — Subject Types Seen
- `document_classes_seen` — Document Classes Seen
- `document_sub_classes_seen` — Document Sub Classes Seen
- `statuses_seen` — Statuses Seen
- `error` — Error
- `error_message` — Error Message

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `read`
- Confirmation recommended: no
- Retry safe: yes
- Dry run supported: no

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "required": [
    "bucket_name",
    "assigned_to"
  ],
  "properties": {
    "per_page": {
      "type": "number",
      "default": 50,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "statuses": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "max_items": {
      "type": "number",
      "default": 200,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "max_pages": {
      "type": "number",
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "sort_field": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "start_page": {
      "type": "number",
      "default": 0,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "assigned_to": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "bucket_name": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "sort_column": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "subject_types": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "exclude_urgent": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "sort_direction": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_classes": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_sub_classes": {
      "default": "ADMIN_REFERRAL",
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "count": {},
    "error": {},
    "success": {},
    "documents": {},
    "truncated": {},
    "pages_read": {},
    "start_page": {},
    "assigned_to": {},
    "bucket_name": {},
    "document_ids": {},
    "error_message": {},
    "scanned_count": {},
    "statuses_seen": {},
    "document_count": {},
    "source_context": {},
    "window_limited": {},
    "bucket_total_count": {},
    "filtered_out_count": {},
    "has_previous_pages": {},
    "subject_types_seen": {},
    "document_classes_seen": {},
    "document_sub_classes_seen": {}
  },
  "additionalProperties": true
}
```
