## Workflow Search

**post** `/search/workflows`

Search for workflows.
At least one of the following fields must have a value: `query` or `filter`.

### Query Parameters

- `originalAssets: optional boolean`

  If set to true, returns the original asset without transformation

- `projectId: optional string`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

### Body Parameters

- `filter: optional string`

  Filter queries by an attribute's value

- `hitsPerPage: optional number`

  Maximum number of documents returned for a page. Must be used with `page`.

- `limit: optional number`

  Maximum number of documents returned. Must be used with `offset`.

- `offset: optional number`

  Number of documents to skip. Must be used with `limit`. Starts from 0.

- `page: optional number`

  Request a specific page of results. Must be used with `hitsPerPage`.

- `public: optional boolean`

  Search for public workflows not necessarily belonging to the current `ownerId`

- `query: optional string`

  A string used for querying search results.

- `querySemanticRatio: optional number`

  Query embedding for hybrid search, if possible

- `sortBy: optional array of string`

  Sort the search results by the given attributes. Each attribute in the list must be followed by a colon (`:`) and the preferred sorting order: either ascending (`asc`) or descending (`desc`).

  Example: `['createdAt:desc']`

### Returns

- `hits: array of object { id, authorId, collectionIds, 14 more }`

  - `id: string`

    Unique identifier for the workflow (e.g., "workflow_abc123")

  - `authorId: string`

    User ID of the workflow creator/author

  - `collectionIds: array of string`

    Array of collection IDs this workflow belongs to

  - `createdAt: string`

    Creation timestamp in ISO 8601 format (e.g., "2025-01-16T11:19:41.579Z")

  - `description: string`

    Full description of the workflow

  - `name: string`

    Display name of the workflow

  - `ownerId: string`

    Project ID of the workflow owner

  - `privacy: string`

    Privacy setting of the workflow ("public", "private", or "unlisted")

  - `status: string`

    Status of the workflow (e.g., "ready", "draft", "deleted")

  - `tags: array of string`

    Array of user-assigned tags for categorization

  - `teamId: string`

    Team ID of the workflow owner

  - `updatedAt: string`

    Last modification timestamp in ISO 8601 format (e.g., "2025-01-16T11:19:41.579Z")

  - `after: optional object { assetId, url }`

    After image information for the workflow

    - `assetId: string`

      ID of the asset used as after image

    - `url: string`

      Signed URL of the after image

  - `before: optional object { assetId, url }`

    Before image information for the workflow

    - `assetId: string`

      ID of the asset used as before image

    - `url: string`

      Signed URL of the before image

  - `score: optional number`

    Score assigned to the workflow based on usage and popularity

  - `shortDescription: optional string`

    Short description of the workflow

  - `thumbnail: optional object { assetId, url }`

    Thumbnail image information for the workflow

    - `assetId: string`

      ID of the asset used as thumbnail

    - `url: string`

      Signed URL of the thumbnail

- `limit: number`

  Maximum number of documents returned

- `offset: number`

  Number of documents skipped

- `estimatedTotalHits: optional number`

  Estimated total number of hits

- `hitsPerPage: optional number`

  Number of results on each page

- `page: optional number`

  Current search results page

- `totalHits: optional number`

  Exhaustive total number of matches

- `totalPages: optional number`

  Exhaustive total number of search result pages

### Example

```http
curl https://api.cloud.scenario.com/v1/search/workflows \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

```json
{
  "hits": [
    {
      "id": "id",
      "authorId": "authorId",
      "collectionIds": [
        "string"
      ],
      "createdAt": "createdAt",
      "description": "description",
      "name": "name",
      "ownerId": "ownerId",
      "privacy": "privacy",
      "status": "status",
      "tags": [
        "string"
      ],
      "teamId": "teamId",
      "updatedAt": "updatedAt",
      "after": {
        "assetId": "assetId",
        "url": "url"
      },
      "before": {
        "assetId": "assetId",
        "url": "url"
      },
      "score": 0,
      "shortDescription": "shortDescription",
      "thumbnail": {
        "assetId": "assetId",
        "url": "url"
      }
    }
  ],
  "limit": 0,
  "offset": 0,
  "estimatedTotalHits": 0,
  "hitsPerPage": 0,
  "page": 0,
  "totalHits": 0,
  "totalPages": 0
}
```
