# setWorkflowTargets

Audience: Developer

Replace the target surfaces of a running workflow execution.

Replace the target surfaces of a running workflow execution. Requires the
workflow's state to implement the WorkflowTargetsSetter SDK interface.
Passing an empty list clears the search attribute so the workflow no longer
matches any targets-based filter.

**Served by:** [workflow](https://docs.pyck.cloud/api/services/workflow.md)

## Arguments

| Name | Type |
| --- | --- |
| `input` | [SetWorkflowTargetsInput](https://docs.pyck.cloud/api/inputs/setworkflowtargetsinput.md)! |

## Returns

[SetWorkflowTargetsResponse](https://docs.pyck.cloud/api/types/setworkflowtargetsresponse.md)

## Example

Replaces the target client surfaces (WEB, MOBILE, SETUP) of a running workflow execution. Passing an empty list clears the search attribute so the workflow no longer matches any targets-based filter.

```graphql
mutation SetWorkflowTargets($input: SetWorkflowTargetsInput!) {
  setWorkflowTargets(input: $input) {
    targets
  }
}
```

**Variables**

```json
{
  "input": {
    "runID": "<run ID>",
    "targets": [
      "WEB",
      "MOBILE"
    ],
    "workflowID": "<workflow execution ID>"
  }
}
```
