# Find Sales Orders in WIP State

> Perform Find Sales Orders in WIP State through Brightree.

Source: [https://genhealth.ai/docs/workflows/integrations/brightree/brightree_search_sales_orders_by_wip_state](https://genhealth.ai/docs/workflows/integrations/brightree/brightree_search_sales_orders_by_wip_state)

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

- Handler: `brightree_search_sales_orders_by_wip_state`

- Connection type: `brightree`

## 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": "Brightree",
  "params": {
    "shard_count": 1,
    "shard_index": 0,
    "order_statuses": [
      "New",
      "Active"
    ],
    "max_orders_to_read": 1000,
    "created_within_days": 0
  },
  "handler": "brightree_search_sales_orders_by_wip_state"
}

```

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

## Inputs

- `wip_states` — Wip States (multi_select, required, dynamic options)
  Required list of selected values. Retrieve allowed values from the dynamic options endpoint.
- `order_statuses` — Order Statuses (multi_select)
  Optional list of selected values.
  Default: `["New","Active"]`
  Options: New ("New"), Active ("Active"), On-Hold ("On-Hold"), Delivered ("Delivered"), Closed ("Closed"), Stopped ("Stopped")
- `classification` — Classification (select, dynamic options)
  Optional selected identifier or value. Retrieve allowed values from the dynamic options endpoint.
- `order_branches` — Order Branches (multi_select)
  Optional list of selected values.
- `created_within_days` — Created Within Days (number)
  Optional numeric value.
  Default: `0`
- `max_orders_to_read` — Max Orders To Read (number)
  Optional numeric value.
  Default: `1000`
- `shard_count` — Shard Count (number)
  Optional numeric value.
  Default: `1`
- `shard_index` — Shard Index (number)
  Optional numeric value.
  Default: `0`

## Outputs

- `success` — Success
- `complete` — Complete
- `orders` — Orders
- `sales_order_keys` — Sales Order Keys
- `count` — Count
- `scanned_count` — Scanned Count
- `searched_count` — Searched Count
- `searched_statuses` — Searched Statuses
- `created_from` — Created From
- `wip_states` — Wip States
- `shard_index` — Shard Index
- `shard_count` — Shard Count
- `message` — Message
- `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": [
    "wip_states"
  ],
  "properties": {
    "wip_states": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Required list of selected values. Retrieve allowed values from the dynamic options endpoint.",
      "x-dynamic-options": true,
      "x-workflow-field-type": "multi_select"
    },
    "shard_count": {
      "type": "number",
      "default": 1,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "shard_index": {
      "type": "number",
      "default": 0,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "classification": {
      "type": "string",
      "description": "Optional selected identifier or value. Retrieve allowed values from the dynamic options endpoint.",
      "x-dynamic-options": true,
      "x-workflow-field-type": "select"
    },
    "order_branches": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional list of selected values.",
      "x-workflow-field-type": "multi_select"
    },
    "order_statuses": {
      "type": "array",
      "items": {
        "enum": [
          "New",
          "Active",
          "On-Hold",
          "Delivered",
          "Closed",
          "Stopped"
        ],
        "type": "string"
      },
      "default": [
        "New",
        "Active"
      ],
      "description": "Optional list of selected values.",
      "x-workflow-field-type": "multi_select"
    },
    "max_orders_to_read": {
      "type": "number",
      "default": 1000,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "created_within_days": {
      "type": "number",
      "default": 0,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "count": {},
    "error": {},
    "orders": {},
    "message": {},
    "success": {},
    "complete": {},
    "wip_states": {},
    "shard_count": {},
    "shard_index": {},
    "created_from": {},
    "error_message": {},
    "scanned_count": {},
    "searched_count": {},
    "sales_order_keys": {},
    "searched_statuses": {}
  },
  "additionalProperties": true
}
```
