> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IAutomationsQuery

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/workspace/automations/index.ts

Service to query automations.

**Signature:**

```typescript
export interface IAutomationsQuery 
```

## Methods

| Method | Description |
| --- | --- |
| [query()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsqueryquery) | Starts the automations query. |
| [queryAll()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsqueryqueryall) | Starts the automations query. |
| [withAuthor(author, filterType)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithauthor) | Sets author of the automation for the query. |
| [withDashboard(dashboard, filterType)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithdashboard) | Sets dashboard id for the query. |
| [withExternalRecipient(externalRecipient)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithexternalrecipient) | Sets external recipient of the automation for the query. |
| [withFilter(filter)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithfilter) | Sets filter for the query. |
| [withPage(page)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithpage) | Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0 |
| [withRecipient(recipient, filterType)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithrecipient) | Sets recipient of the automation for the query. |
| [withSize(size)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithsize) | Sets number of automations to return per page. Default size: 100 |
| [withSorting(sort)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithsorting) | Sets sorting for the query. |
| [withStatus(status, filterType)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithstatus) | Sets status of automation results for the query. |
| [withType(type)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithtype) | Sets type of the automation for the query. |
| [withUser(user)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md#iautomationsquerywithuser) | This filter gets automations if either author or recipient of the automation is the provided user. |

## Method details

### IAutomationsQuery.query()

Starts the automations query.

**Signature:**

```typescript
query(): Promise<IAutomationsQueryResult>;
```
**Returns:**

Promise&lt;[IAutomationsQueryResult](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsqueryresult/index.md)&gt;

promise of first page of the results

### IAutomationsQuery.queryAll()

Starts the automations query.

**Signature:**

```typescript
queryAll(): Promise<IAutomationMetadataObject[]>;
```
**Returns:**

Promise&lt;[IAutomationMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iautomationmetadataobject/index.md)[]&gt;

promise with a list of all automations matching the specified options

### IAutomationsQuery.withAuthor()

Sets author of the automation for the query.

**Signature:**

```typescript
withAuthor(author: string | undefined, filterType?: AutomationFilterType): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| author | string \| undefined | author of the automation |
| filterType | [AutomationFilterType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.automationfiltertype/index.md) | _(Optional)_ type of filter behavior ("exact", "include", "exclude") |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withDashboard()

Sets dashboard id for the query.

**Signature:**

```typescript
withDashboard(dashboard: string | undefined, filterType?: AutomationFilterType): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dashboard | string \| undefined | dashboard id |
| filterType | [AutomationFilterType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.automationfiltertype/index.md) | _(Optional)_ type of filter behavior ("exact", "include", "exclude") |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withExternalRecipient()

Sets external recipient of the automation for the query.

**Signature:**

```typescript
withExternalRecipient(externalRecipient: string | undefined): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| externalRecipient | string \| undefined | external recipient of the automation |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withFilter()

Sets filter for the query.

**Signature:**

```typescript
withFilter(filter: {
        title?: string;
    }): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filter | { title?: string; } | filter to apply |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withPage()

Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0

**Signature:**

```typescript
withPage(page: number | undefined): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| page | number \| undefined | zero indexed, must be non-negative |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withRecipient()

Sets recipient of the automation for the query.

**Signature:**

```typescript
withRecipient(recipient: string | undefined, filterType?: AutomationFilterType): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| recipient | string \| undefined | recipient of the automation |
| filterType | [AutomationFilterType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.automationfiltertype/index.md) | _(Optional)_ type of filter behavior ("exact", "include", "exclude") |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withSize()

Sets number of automations to return per page. Default size: 100

**Signature:**

```typescript
withSize(size: number | undefined): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| size | number \| undefined | desired max number of automations per page must be a positive number |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withSorting()

Sets sorting for the query.

**Signature:**

```typescript
withSorting(sort: string[]): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sort | string[] | Sorting criteria in the format: property,(asc\|desc). Default sort order is ascending. Multiple sort criteria are supported. |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withStatus()

Sets status of automation results for the query.

**Signature:**

```typescript
withStatus(status: string | undefined, filterType?: AutomationFilterType): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| status | string \| undefined | status of the automation result ("SUCCESS" or "FAILED") |
| filterType | [AutomationFilterType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.automationfiltertype/index.md) | _(Optional)_ type of filter behavior ("exact", "include", "exclude") |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withType()

Sets type of the automation for the query.

**Signature:**

```typescript
withType(type: AutomationType | undefined): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| type | [AutomationType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.automationtype/index.md) \| undefined | type of the automation, e.g. "schedule" or "trigger" |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query

### IAutomationsQuery.withUser()

This filter gets automations if either author or recipient of the automation is the provided user.

**Signature:**

```typescript
withUser(user: string): IAutomationsQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| user | string | author or recipient of the automation |

**Returns:**

[IAutomationsQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iautomationsquery/index.md)

automations query
