# Aggregate Documents

> Perform Aggregate Documents through GenHealth.

Source: [https://genhealth.ai/docs/workflows/integrations/gen-health/genhealth_aggregate_documents](https://genhealth.ai/docs/workflows/integrations/gen-health/genhealth_aggregate_documents)

Integration: [GenHealth](https://genhealth.ai/docs/workflows/integrations/gen-health.md)

- Handler: `genhealth_aggregate_documents`

## Inputs

- `document_ids` — Document Ids (expression, required)
  Required literal value or workflow expression.
- `document_id_field` — Document Id Field (text)
  Optional text value.
- `add_bookmarks` — Add Bookmarks (boolean)
  Optional true-or-false value.
  Default: `false`
- `skip_unreadable` — Skip Unreadable (boolean)
  Optional true-or-false value.
  Default: `false`
- `show_in_inbox` — Show In Inbox (boolean)
  Optional true-or-false value.
  Default: `true`
- `title` — Title (expression, required)
  Required literal value or workflow expression.
- `patient_id` — Patient Id (expression)
  Optional literal value or workflow expression.
- `categories` — Categories (multi_select)
  Optional list of selected values.
- `metadata` — Metadata (json)
  Optional JSON value.
- `external_id` — External Id (expression)
  Optional literal value or workflow expression.

## Outputs

- `success` — Success
- `document_id` — Document Id
- `aggregate_document_id` — Aggregate Document Id
- `title` — Title
- `created` — Created
- `source_document_count` — Source Document Count
- `page_count` — Page Count
- `skipped_document_ids` — Skipped Document Ids
- `error` — Error

Output schema completeness: `best_effort_declared`

## Safety

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

## Schemas

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

### Input schema

```json
{
  "type": "object",
  "required": [
    "document_ids",
    "title"
  ],
  "properties": {
    "title": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "metadata": {
      "description": "Optional JSON value.",
      "x-workflow-field-type": "json"
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional list of selected values.",
      "x-workflow-field-type": "multi_select"
    },
    "patient_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "external_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_ids": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "add_bookmarks": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "show_in_inbox": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "skip_unreadable": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "document_id_field": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "title": {},
    "created": {},
    "success": {},
    "page_count": {},
    "document_id": {},
    "skipped_document_ids": {},
    "aggregate_document_id": {},
    "source_document_count": {}
  },
  "additionalProperties": true
}
```
